diff options
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee')
1120 files changed, 0 insertions, 66831 deletions
diff --git a/plugins/org.eclipse.jst.j2ee/.classpath b/plugins/org.eclipse.jst.j2ee/.classpath deleted file mode 100644 index 9c9e23fae..000000000 --- a/plugins/org.eclipse.jst.j2ee/.classpath +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="j2eeplugin"/> - <classpathentry kind="src" path="contenttype"/> - <classpathentry kind="src" path="common"/> - <classpathentry kind="src" path="commonedit"/> - <classpathentry kind="src" path="earproject"/> - <classpathentry kind="src" path="j2eecreation"/> - <classpathentry kind="src" path="archiveops"/> - <classpathentry kind="src" path="applicationedit"/> - <classpathentry kind="src" path="appclientcreation"/> - <classpathentry kind="src" path="property_files"/> - <classpathentry kind="src" path="refactor"/> - <classpathentry kind="src" path="classpathdep"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.jst.j2ee/.cvsignore b/plugins/org.eclipse.jst.j2ee/.cvsignore deleted file mode 100644 index 590084fe0..000000000 --- a/plugins/org.eclipse.jst.j2ee/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -bin -runtime -temp.folder -build.xml -@dot -src.zip -javaCompiler...args diff --git a/plugins/org.eclipse.jst.j2ee/.project b/plugins/org.eclipse.jst.j2ee/.project deleted file mode 100644 index 8f2cf14e0..000000000 --- a/plugins/org.eclipse.jst.j2ee/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.jst.j2ee</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.jst.j2ee/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.jst.j2ee/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index e31f634b8..000000000 --- a/plugins/org.eclipse.jst.j2ee/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Thu May 03 00:58:38 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF deleted file mode 100644 index 48ac9baf6..000000000 --- a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF +++ /dev/null @@ -1,85 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name.0 -Bundle-SymbolicName: org.eclipse.jst.j2ee; singleton:=true -Bundle-Version: 1.1.105.qualifier -Bundle-Activator: org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin -Bundle-Vendor: %Bundle-Vendor.0 -Bundle-Localization: plugin -Export-Package: org.eclipse.jst.j2ee.application.internal.operations;x-internal:=true, - org.eclipse.jst.j2ee.applicationclient.componentcore.util, - org.eclipse.jst.j2ee.applicationclient.internal.creation;x-internal:=true, - org.eclipse.jst.j2ee.applicationclient.internal.modulecore.util;x-internal:=true, - org.eclipse.jst.j2ee.archive, - org.eclipse.jst.j2ee.classpathdep, - org.eclipse.jst.j2ee.common.internal.provider;x-internal:=true, - org.eclipse.jst.j2ee.componentcore, - org.eclipse.jst.j2ee.componentcore.util, - org.eclipse.jst.j2ee.contenttype, - org.eclipse.jst.j2ee.datamodel.properties, - org.eclipse.jst.j2ee.earcreation, - org.eclipse.jst.j2ee.internal;x-internal:=true, - org.eclipse.jst.j2ee.internal.application.common;x-internal:=true, - org.eclipse.jst.j2ee.internal.application.provider;x-internal:=true, - org.eclipse.jst.j2ee.internal.archive, - org.eclipse.jst.j2ee.internal.archive.operations;x-internal:=true, - org.eclipse.jst.j2ee.internal.classpathdep;x-internal:=true, - org.eclipse.jst.j2ee.internal.common;x-internal:=true, - org.eclipse.jst.j2ee.internal.common.classpath, - org.eclipse.jst.j2ee.internal.common.operations;x-internal:=true, - org.eclipse.jst.j2ee.internal.componentcore, - org.eclipse.jst.j2ee.internal.delete;x-internal:=true, - org.eclipse.jst.j2ee.internal.deploy;x-internal:=true, - org.eclipse.jst.j2ee.internal.deployables;x-internal:=true, - org.eclipse.jst.j2ee.internal.earcreation;x-internal:=true, - org.eclipse.jst.j2ee.internal.earcreation.modulemap;x-internal:=true, - org.eclipse.jst.j2ee.internal.modulecore.util;x-internal:=true, - org.eclipse.jst.j2ee.internal.moduleextension;x-internal:=true, - org.eclipse.jst.j2ee.internal.plugin;x-internal:=true, - org.eclipse.jst.j2ee.internal.project;x-internal:=true, - org.eclipse.jst.j2ee.internal.project.facet, - org.eclipse.jst.j2ee.internal.provider;x-internal:=true, - org.eclipse.jst.j2ee.internal.rename;x-internal:=true, - org.eclipse.jst.j2ee.internal.servertarget;x-internal:=true, - org.eclipse.jst.j2ee.internal.validation;x-internal:=true, - org.eclipse.jst.j2ee.internal.webservices;x-internal:=true, - org.eclipse.jst.j2ee.model, - org.eclipse.jst.j2ee.project.datamodel.properties, - org.eclipse.jst.j2ee.project.facet, - org.eclipse.jst.j2ee.refactor, - org.eclipse.jst.j2ee.refactor.listeners, - org.eclipse.jst.j2ee.refactor.operations -Require-Bundle: org.eclipse.emf.edit;bundle-version="[2.2.0,3.0.0)", - org.eclipse.jem.workbench;bundle-version="[2.0.0,3.0.0)", - org.eclipse.jst.j2ee.core;bundle-version="[1.1.0,1.2.0)", - org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)", - org.eclipse.wst.validation;bundle-version="[1.1.0,1.2.0)", - org.eclipse.emf.ecore.edit;bundle-version="[2.2.0,2.4.0)", - org.eclipse.wst.server.core;bundle-version="[1.0.102,1.1.0)", - org.eclipse.jst.server.core;bundle-version="[1.0.102,1.1.0)", - org.eclipse.wst.common.emf;bundle-version="[1.1.0,1.2.0)", - org.eclipse.emf.ecore.xmi;bundle-version="[2.2.0,3.0.0)", - org.eclipse.jem.workbench;bundle-version="[2.0.0,3.0.0)", - org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.0,1.2.0)", - org.eclipse.jem;bundle-version="[2.0.0,3.0.0)", - org.eclipse.wst.common.frameworks;bundle-version="[1.1.0,1.2.0)", - org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", - org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", - org.eclipse.emf.codegen;bundle-version="[2.2.0,2.4.0)", - org.eclipse.jdt.launching;bundle-version="[3.2.0,4.0.0)", - org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)", - org.eclipse.jface;bundle-version="[3.2.0,4.0.0)", - org.eclipse.jst.common.frameworks;bundle-version="[1.1.0,1.2.0)", - org.eclipse.wst.common.modulecore;bundle-version="[1.1.0,1.2.0)";visibility:=reexport, - org.eclipse.jem.util;bundle-version="[2.0.0,3.0.0)", - org.eclipse.jst.common.annotations.controller;bundle-version="[1.1.0,1.2.0)", - org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)", - org.eclipse.wst.common.project.facet.core;bundle-version="[1.1.0,2.0.0)", - org.eclipse.jst.common.project.facet.core;bundle-version="[1.1.0,1.2.0)", - org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)", - org.eclipse.wst.web;bundle-version="[1.1.0,1.2.0)", - com.ibm.icu;bundle-version="[3.4.4,4.0.0)", - org.eclipse.wst.common.environment;bundle-version="[1.0.100,1.1.0)", - org.eclipse.core.expressions -Eclipse-LazyStart: true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/plugins/org.eclipse.jst.j2ee/about.html b/plugins/org.eclipse.jst.j2ee/about.html deleted file mode 100644 index 73db36ed5..000000000 --- a/plugins/org.eclipse.jst.j2ee/about.html +++ /dev/null @@ -1,34 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<HTML> - -<head> -<title>About</title> -<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> -</head> - -<BODY lang="EN-US"> - -<H3>About This Content</H3> - -<P>June 06, 2007</P> - -<H3>License</H3> - -<P>The Eclipse Foundation makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to you -under the terms and conditions of the Eclipse Public License Version 1.0 -("EPL"). A copy of the EPL is available at -<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. -For purposes of the EPL, "Program" will mean the Content.</P> - -<P>If you did not receive this Content directly from the Eclipse Foundation, the -Content is being redistributed by another party ("Redistributor") and different -terms and conditions may apply to your use of any object code in the Content. -Check the Redistributor’s license that was provided with the Content. If no such -license exists, contact the Redistributor. Unless otherwise indicated below, the -terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at -<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P> - -</BODY> -</HTML> 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 746b3f60b..000000000 --- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/AppClientArtifactEdit.java +++ /dev/null @@ -1,437 +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.j2ee.applicationclient.componentcore.util; - -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -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.jem.util.emf.workbench.WorkbenchResourceHelperBase; -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.componentcore.AppClientBinaryComponentHelper; -import org.eclipse.jst.j2ee.internal.componentcore.EnterpriseBinaryComponentHelper; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IModelProvider; -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.BinaryComponentHelper; -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 { - - private static final String APPCLIENT_CONTENT_TYPE = "org.eclipse.jst.j2ee.appclientDD"; - /** - * <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(); - } - - public AppClientArtifactEdit(IVirtualComponent aModule) { - super(aModule); - } - - protected BinaryComponentHelper initBinaryComponentHelper(IVirtualComponent binaryModule) { - return new AppClientBinaryComponentHelper(binaryModule); - } - - - /** - * @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() { - verifyOperationSupported(); - if(isBinary()){ - return getBinaryComponentHelper().getResource(J2EEConstants.APP_CLIENT_DD_URI_OBJ); - } - 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() { - verifyOperationSupported(); - List contents = getDeploymentDescriptorResource().getContents(); - if (contents.size() > 0) - return (EObject) contents.get(0); - if(isBinary()){ - return null; - } - addAppClientIfNecessary(getApplicationClientXmiResource()); - return (EObject) contents.get(0); - } - - /** - * - * @return ApplicationClientResource from (@link getDeploymentDescriptorResource()) - * - */ - - public ApplicationClientResource getApplicationClientXmiResource() { - verifyOperationSupported(); - 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(isBinary()){ - throwAttemptedBinaryEditModelAccess(); - } - 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() { - if(isBinary()){ - throwAttemptedBinaryEditModelAccess(); - } - return ((ApplicationPackage) EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI)).getApplicationFactory().createJavaClientModule(); - } - - /** - * - * @return ApplicationClient from (@link getDeploymentDescriptorRoot()) - * - */ - public ApplicationClient getApplicationClient() { - verifyOperationSupported(); - return (ApplicationClient) getDeploymentDescriptorRoot(); - } - - /** - * <p> - * Retrieves J2EE version information from ApplicationClientResource. - * </p> - * - * @return an integer representation of a J2EE Spec version - * - */ - - public int getJ2EEVersion() { - verifyOperationSupported(); - 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} 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} 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} that - * will be used for editing. - * </p> - * <p> - * <b>The following method may return null. </b> - * </p> - * - * @param aModule - * A valid {@see WorkbenchComponent} 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} 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} 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; - if(aModule.isBinary()){ - return new AppClientArtifactEdit(aModule); - } - 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} 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} 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 || aModule.isBinary()) - 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() { - if(isBinary()){ - throwAttemptedBinaryEditModelAccess(); - } - return createModelRoot(getJ2EEVersion()); - } - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.modulecore.util.EnterpriseArtifactEdit#createModelRoot(java.lang.Integer) - */ - public EObject createModelRoot(int version) { - if(isBinary()){ - throwAttemptedBinaryEditModelAccess(); - } - 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, boolean includeClasspathComponents) throws OpenFailureException{ - if (isBinary()) { - return ((EnterpriseBinaryComponentHelper) getBinaryComponentHelper()).accessArchive(); - } else { - 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 { // Make sure new resource is removed - the uri used for creation shouldn't be cached - Resource newRes = appClientEdit.getDeploymentDescriptorResource(); - WorkbenchResourceHelperBase.getResourceSet(project).getResources().remove(newRes); - newRes.unload(); - appClientEdit.dispose(); - } - } - public IModelProvider create(IProject project) { - return (IModelProvider)getAppClientArtifactEditForRead(project); - } - - public IModelProvider create(IVirtualComponent component) { - return (IModelProvider)getAppClientArtifactEditForRead(component); - } - public void modify(Runnable runnable, IPath modelPath) { - setWritableEdit(getAppClientArtifactEditForWrite(getProject())); - try{ - runnable.run(); - if( getWritableEdit() != null ){ - // Always save regardless of resource path passed - Artifactedits save resources as a unit - getWritableEdit().saveIfNecessary( new NullProgressMonitor() ); - } - - } finally { //Properly dispose the write artifact edit - getWritableEdit().dispose(); - setWritableEdit(null); - } - } - - - protected String getContentTypeDescriber() { - - return APPCLIENT_CONTENT_TYPE; - } -} 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/AppClientComponentImportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentImportDataModelProvider.java deleted file mode 100644 index 9d1eba3cd..000000000 --- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentImportDataModelProvider.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.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.J2EEVersionConstants; -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.jst.j2ee.project.facet.IAppClientFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetInstallDataModelProperties; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; -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); - } - - protected void handleUnknownType(JavaEEQuickPeek jqp) { - jqp.setType(J2EEVersionConstants.APPLICATION_CLIENT_TYPE); - jqp.setVersion(J2EEVersionConstants.JEE_5_0_ID); - jqp.setJavaEEVersion(J2EEVersionConstants.JEE_5_0_ID); - } - - - public IDataModelOperation getDefaultOperation() { - return new AppClientComponentImportOperation(model); - } - - protected IDataModel createJ2EEComponentCreationDataModel() { - IDataModel appClientDataModel = DataModelFactory.createDataModel(new AppClientFacetProjectCreationDataModelProvider()); - FacetDataModelMap map = (FacetDataModelMap)appClientDataModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); - //need to ensure no default Main class is created during import - map.getFacetDataModel(J2EEProjectUtilities.APPLICATION_CLIENT).setBooleanProperty(IAppClientFacetInstallDataModelProperties.CREATE_DEFAULT_MAIN_CLASS, false); - return appClientDataModel; - } - - public boolean propertySet(String propertyName, Object propertyValue) { - boolean set = super.propertySet(propertyName, propertyValue); - if (propertyName.equals(ARCHIVE_WRAPPER)) { - IDataModel moduleDM = model.getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION); - if (getArchiveWrapper() != 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); - updateJavaFacetVersion(); - model.notifyPropertyChange(PROJECT_NAME, IDataModel.VALID_VALUES_CHG); - } - } - return set; - } - - public void init() { - super.init(); - IDataModel componentCreationDM = model.getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION); - FacetDataModelMap map = (FacetDataModelMap) componentCreationDM.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); - IDataModel appClientFacet = map.getFacetDataModel( IJ2EEFacetConstants.APPLICATION_CLIENT ); - appClientFacet.setBooleanProperty(IJ2EEFacetInstallDataModelProperties.GENERATE_DD, false); - } -} 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 410e3ef1b..000000000 --- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientFacetProjectCreationDataModelProvider.java +++ /dev/null @@ -1,77 +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.j2ee.applicationclient.internal.creation; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties; -import org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider; -import org.eclipse.jst.common.project.facet.JavaFacetUtils; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.project.facet.AppClientFacetInstallDataModelProvider; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants; -import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.J2EEFacetProjectCreationDataModelProvider; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties; -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; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.project.facet.ProductManager; - -public class AppClientFacetProjectCreationDataModelProvider extends J2EEFacetProjectCreationDataModelProvider { - - public AppClientFacetProjectCreationDataModelProvider() { - super(); - } - - public void init() { - super.init(); - - Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>(); - requiredFacets.add(JavaFacetUtils.JAVA_FACET); - requiredFacets.add(IJ2EEFacetConstants.APPLICATION_CLIENT_FACET); - setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets); - - FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP); - IDataModel javaFacet = map.getFacetDataModel(JavaFacetUtils.JAVA_FACET.getId()); - IDataModel appClientFacet = map.getFacetDataModel(IJ2EEFacetConstants.APPLICATION_CLIENT_FACET.getId()); - String appClientRoot = appClientFacet.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER); - javaFacet.setProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME, appClientRoot); - // If using optimized single root structure, set the output folder to the content root - if (ProductManager.shouldUseSingleRootStructure()) - javaFacet.setProperty(IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME, appClientRoot); - appClientFacet.addListener(new IDataModelListener() { - public void propertyChanged(DataModelEvent event) { - if (IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME.equals(event.getPropertyName())) { - if (isPropertySet(EAR_PROJECT_NAME)) - setProperty(EAR_PROJECT_NAME, event.getProperty()); - else - model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG); - }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 ce230840f..000000000 --- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDataModelProvider.java +++ /dev/null @@ -1,66 +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.j2ee.project.facet; - -import java.util.Set; - -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPreferences; -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 APPLICATION_CLIENT; - else if (propertyName.equals(CREATE_DEFAULT_MAIN_CLASS)) - return Boolean.TRUE; - else if (propertyName.equals(CONFIG_FOLDER)) - return J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.APP_CLIENT_CONTENT_FOLDER); - else if (propertyName.equals(MODULE_URI)) { - String projectName = model.getStringProperty(FACET_PROJECT_NAME).replace(' ','_'); - return projectName + IJ2EEModuleConstants.JAR_EXT; - } - return super.getDefaultProperty(propertyName); - } - - public boolean propertySet(String propertyName, Object propertyValue) { - if( propertyName.equals( FACET_VERSION ) ) - { - if( propertyValue == APPLICATION_CLIENT_50 ) - { - setProperty( GENERATE_DD, Boolean.FALSE ); - } - else - { - setProperty( GENERATE_DD, Boolean.TRUE ); - } - } - return super.propertySet(propertyName, propertyValue); - } - - - 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 42d6ab65c..000000000 --- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDelegate.java +++ /dev/null @@ -1,197 +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.j2ee.project.facet; - -import java.io.ByteArrayInputStream; -import java.io.UnsupportedEncodingException; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -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.jst.common.project.facet.WtpUtils; -import org.eclipse.jst.common.project.facet.core.ClasspathHelper; -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.classpath.J2EEComponentClasspathContainer; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainerUtils; -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.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -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; - -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, fv); - - // 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); - - if(J2EEComponentClasspathContainerUtils.getDefaultUseEARLibraries()){ - final IPath earLibContainer = new Path(J2EEComponentClasspathContainer.CONTAINER_ID); - addToClasspath(jproj, JavaCore.newContainerEntry(earLibContainer)); - } - - 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, IProjectFacetVersion fv) 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); - setOutputFolder(model, c); - 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( fv == IJ2EEFacetConstants.APPLICATION_CLIENT_50 ) - { - if(model.getBooleanProperty(IJ2EEFacetInstallDataModelProperties.GENERATE_DD)){ - // Create the deployment descriptor (web.xml) if one doesn't exist - IFile appClientFile = sourceFolder.getFile(new Path(J2EEConstants.APP_CLIENT_DD_URI)); - if (!appClientFile.exists()) { - try { - if(!appClientFile.getParent().exists() - && (appClientFile.getParent().getType() == IResource.FOLDER)){ - ((IFolder)appClientFile.getParent()).create(true, true, monitor); - } - final String appClientXmlContents = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<application-client version=\"5\" xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application-client_5.xsd\">\n</application-client>"; //$NON-NLS-1$ - appClientFile.create(new ByteArrayInputStream(appClientXmlContents.getBytes("UTF-8")), true, monitor); //$NON-NLS-1$ - } catch (UnsupportedEncodingException e) { - Logger.getLogger().logError(e); - } - } - } - } - else - { - 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 585ac14ff..000000000 --- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetPostInstallDelegate.java +++ /dev/null @@ -1,132 +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.j2ee.project.facet; - -import static org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties.FACETED_PROJECT_WORKING_COPY; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -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.IJavaProject; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProperties; -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -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.internal.operation.IArtifactEditOperationDataModelProperties; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -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.IFacetedProjectWorkingCopy; -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; - - // Add main class if necessary - if (model.getBooleanProperty(IAppClientFacetInstallDataModelProperties.CREATE_DEFAULT_MAIN_CLASS)) - addMainClass(monitor, model, 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); - - final IFacetedProjectWorkingCopy fpjwc - = (IFacetedProjectWorkingCopy) model.getProperty( FACETED_PROJECT_WORKING_COPY ); - - installAndAddModuletoEAR( j2eeVersionText, - earProjectName, - fpjwc.getPrimaryRuntime(), - project, - moduleURI, - monitor ); - - } - } - - if (monitor != null) - monitor.worked(1); - } catch (Exception e) { - Logger.getLogger().logError(e); - } finally { - if (monitor != null) - monitor.done(); - } - } - - 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/IAppClientFacetInstallDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/IAppClientFacetInstallDataModelProperties.java deleted file mode 100644 index c09ad9d06..000000000 --- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/IAppClientFacetInstallDataModelProperties.java +++ /dev/null @@ -1,28 +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.j2ee.project.facet; - -import org.eclipse.jst.j2ee.applicationclient.internal.creation.AppClientFacetProjectCreationDataModelProvider; - -public interface IAppClientFacetInstallDataModelProperties extends IJ2EEModuleFacetInstallDataModelProperties { - - /** - * This field should not be used. It is not part of the API and may be modified in the future. - */ - public static Class _provider_class = AppClientFacetProjectCreationDataModelProvider.class; - - /** - * 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$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/common/CreateChildCommand.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/common/CreateChildCommand.java deleted file mode 100644 index a1f94fd2b..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/common/CreateChildCommand.java +++ /dev/null @@ -1,131 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.internal.application.common; - - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandWrapper; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.CommandActionDelegate; -import org.eclipse.emf.edit.command.CommandParameter; -import org.eclipse.emf.edit.domain.EditingDomain; - - -/** - * This is used to generate a command that will add a new child of appropriate type to an object. - * The implementation specifies an owner, a feature, and a helper to which the implementation is - * delegated, - */ -public class CreateChildCommand extends CommandWrapper implements CommandActionDelegate { - - /** - * This is the helper interface to which child creation is delegated. - */ - public static interface Helper { - /** - * This implements the default command behavior - */ - public Object createChild(Object object); - - /** - * This returns the default label - */ - public String getCreateChildText(Object object); - - /** - * This returns the default help text - */ - public String getCreateChildToolTipText(Object object); - - /** - * This returns the default image - */ - public Object getCreateChildImage(Object object); - } - - /** - * This is the editing doman in which this command operates. - */ - protected EditingDomain domain; - /** - * This is the owner to which children will be added. - */ - protected EObject owner; - /** - * This is the feature of the owner to which children will be added. - */ - protected EReference feature; - /** - * This is the helper object to which child creation is delegated. - */ - protected CreateChildCommand.Helper helper; - - /** - * This creates an instances that will add something to the owner's feature based on the - * delegate helper. - */ - public CreateChildCommand(EditingDomain domain, EObject owner, EReference feature, CreateChildCommand.Helper helper) { - super(); - - this.domain = domain; - this.owner = owner; - this.feature = feature; - this.helper = helper; - } - - /** - * This returns a command that creates a new child of some appropriate type. - */ - public static Command create(EditingDomain domain, Object object) { - return domain.createCommand(CreateChildCommand.class, new CommandParameter(object)); - } - - /** - * This creates the add command that will implement this action and specifies the collection by - * delegating to {@link CreateChildCommand.Helper#getCreateChildImage}. - */ - protected Command createCommand() { - if (feature == null) { - return AddCommand.create(domain, owner, null, helper.createChild(owner)); - } - return new AddCommand(domain, owner, feature, helper.createChild(owner)); - } - - /** - * This delegates to {@link CreateChildCommand.Helper#getCreateChildToolTipText}. - */ - public String getDescription() { - return helper.getCreateChildToolTipText(owner); - } - - /** - * This delegates to {@link CreateChildCommand.Helper#getCreateChildImage}. - */ - public Object getImage() { - return helper.getCreateChildImage(owner); - } - - /** - * This delegates to {@link CreateChildCommand.Helper#getCreateChildText}. - */ - public String getText() { - return helper.getCreateChildText(owner); - } - - /** - * This delegates to {@link CreateChildCommand.Helper#getCreateChildToolTipText}. - */ - public String getToolTipText() { - return helper.getCreateChildToolTipText(owner); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProvider.java deleted file mode 100644 index b6f515c3e..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProvider.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.application.provider; - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.application.ApplicationFactory; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.internal.provider.CompatibilityDescriptionGroupItemProvider; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.Application}object. - */ -public class ApplicationItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public ApplicationItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: check that this is what you want. - Module child = org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getApplicationFactory().createModule(); - - // TODO: initialize child here... - - return child; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - ApplicationPackage pkg = ApplicationPackage.eINSTANCE; - Collection result = new ArrayList(); - result.add(pkg.getApplication_SecurityRoles()); - result.add(pkg.getApplication_Modules()); - return result; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getImage(refObject.eClass().getName() + "CreateModule"); //$NON-NLS-1$ - } - - /** - * This returns the label for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return ApplicationProvidersResourceHandler.getString("Create_Module_UI_"); //$NON-NLS-1$ - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return ApplicationProvidersResourceHandler.getString("Create_a_child_of_type_Module_for_the_selected_UI_") + refObject.eClass().getName() + "."; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This returns Application.gif. - */ - public Object getImage(Object object) { - String key = null; - if (((Application) object).eResource() == null) - return J2EEPlugin.getPlugin().getImage("earFile_obj"); //$NON-NLS-1$ - switch (((Application) object).getVersionID()) { - case J2EEVersionConstants.J2EE_1_2_ID : - key = "12_ear_obj"; //$NON-NLS-1$ - break; - case J2EEVersionConstants.J2EE_1_3_ID : - key = "13_ear_obj"; //$NON-NLS-1$ - break; - case J2EEVersionConstants.J2EE_1_4_ID : - default : - key = "14_ear_obj"; //$NON-NLS-1$ - break; - } - return J2EEPlugin.getPlugin().getImage(key); - } - - /** - * This returns the parent of the Application. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This adds a property descriptor for the Version feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addVersionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Application_version_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Application_version_feature", "_UI_Application_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ApplicationPackage.eINSTANCE.getApplication_Version(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - public String getText(Object object) { - - String displayName = ((Application) object).getDisplayName(); - return displayName == null ? ApplicationProvidersResourceHandler.getString("<<No_display_name>>_ERROR_") : displayName; //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(Application.class)) { - case ApplicationPackage.APPLICATION__VERSION : - case ApplicationPackage.APPLICATION__SECURITY_ROLES : - case ApplicationPackage.APPLICATION__MODULES : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_SecurityRoles(), CommonFactory.eINSTANCE.createSecurityRole())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createModule())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createWebModule())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createJavaClientModule())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createEjbModule())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createConnectorModule())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapter.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapter.java deleted file mode 100644 index 173415d7f..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapter.java +++ /dev/null @@ -1,65 +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.internal.application.provider; - - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; - - - -/** - * This extended item provider supports the following commands: - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. The - * commands are implemented uniformly on all our item adapters using this common base class. - */ -public class ApplicationItemProviderAdapter extends ItemProviderAdapter { - /** - * This creates and instance from an adapter factory and a domain notifier. - */ - protected ApplicationItemProviderAdapter(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This implements the default behavior for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - return null; - } - - /** - * This returns the default image for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getImage("CreateChild"); //$NON-NLS-1$ - } - - /** - * This returns the default label for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return ApplicationProvidersResourceHandler.getString("Create_Child_UI_"); //$NON-NLS-1$ - } - - /** - * This returns the default help text for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return ApplicationProvidersResourceHandler.getString("Create_a_new_child_for_the_selected_UI_") + refObject.eClass().getName() + "."; //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapterFactory.java deleted file mode 100644 index c1000c63d..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapterFactory.java +++ /dev/null @@ -1,267 +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.internal.application.provider; - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.Disposable; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITableItemLabelProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.application.internal.util.ApplicationAdapterFactory; - - -/** - * This is the factory that is used to provide the interfaces needed to support - * {@link org.eclipse.jface.viewers.Viewer}s. The adapters generated by this factory convert EMF - * adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters - * also support property sheets, see {@link org.eclipse.ui.views.properties}. Note that most of the - * adapters are shared among multiple instances. - */ -public class ApplicationItemProviderAdapterFactory extends ApplicationAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.Application}instances. - */ - protected ApplicationItemProvider applicationItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.Module}instances. - */ - protected ModuleItemProvider moduleItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.WebModule}instances. - */ - protected WebModuleItemProvider webModuleItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.JavaClientModule}instances. - */ - protected JavaClientModuleItemProvider javaClientModuleItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.JavaClientModule}instances. - */ - protected ConnectorModuleItemProvider connectorModuleItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.EjbModule}instances. - */ - protected EjbModuleItemProvider ejbModuleItemProvider; - protected Disposable disposable = new Disposable(); - - /** - * This constructs an instance. - */ - public ApplicationItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(ITableItemLabelProvider.class); - } - - public Adapter adapt(Notifier target, Object adapterKey) { - return super.adapt(target, this); - } - - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - public Adapter adaptNew(Notifier target, Object adapterType) { - Adapter adapter = super.adaptNew(target, adapterType); - disposable.add(adapter); - return adapter; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.Application}. - */ - public Adapter createApplicationAdapter() { - if (applicationItemProvider == null) { - applicationItemProvider = new ApplicationItemProvider(this); - } - - return applicationItemProvider; - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.EjbModule}. - */ - public Adapter createEjbModuleAdapter() { - if (ejbModuleItemProvider == null) { - ejbModuleItemProvider = new EjbModuleItemProvider(this); - } - - return ejbModuleItemProvider; - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.JavaClientModule}. - */ - public Adapter createJavaClientModuleAdapter() { - if (javaClientModuleItemProvider == null) { - javaClientModuleItemProvider = new JavaClientModuleItemProvider(this); - } - - return javaClientModuleItemProvider; - } - - /** - * This creates an adapter for a connector. - * - * @return Adapter - */ - public Adapter createConnectorModuleAdapter() { - if (connectorModuleItemProvider == null) { - connectorModuleItemProvider = new ConnectorModuleItemProvider(this); - }// if - - return connectorModuleItemProvider; - }// createConnectorModuleAdapter - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.Module}. - */ - public Adapter createModuleAdapter() { - if (moduleItemProvider == null) { - moduleItemProvider = new ModuleItemProvider(this); - } - - return moduleItemProvider; - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.WebModule}. - */ - public Adapter createWebModuleAdapter() { - if (webModuleItemProvider == null) { - webModuleItemProvider = new WebModuleItemProvider(this); - } - - return webModuleItemProvider; - } - - public void dispose() { - disposable.dispose(); - } - - /** - * This calls {@link INotifyChangedListener#fireNotifyChanged fireNotifyChanged}for each viewer - * in {@link #notifyChangedListeners}. - */ - /* - * public void fireNotifyChanged(Object object, int eventType, Object feature, Object oldValue, - * Object newValue, int index) { for (Iterator i = notifyChangedListeners.iterator(); - * i.hasNext(); ) { INotifyChangedListener notifyChangedListener = - * (INotifyChangedListener)i.next(); notifyChangedListener.notifyChanged(new - * ENotificationImpl((InternalEObject)object, eventType,(EStructuralFeature) feature, oldValue, - * newValue, index)); } - * - * if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(object, eventType, - * feature, oldValue, newValue, index); } } - */ - /** - * This returns the root adapter factory that contains this factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - public boolean isFactoryForType(Object type) { - return super.isFactoryForType(type) || supportedTypes.contains(type); - } - - /** - * This removes a listener. - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This sets the composed adapter factory that contains this factory. - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationProvidersResourceHandler.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationProvidersResourceHandler.java deleted file mode 100644 index 2bee27955..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationProvidersResourceHandler.java +++ /dev/null @@ -1,93 +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.internal.application.provider; - - - -import java.net.URL; -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -public class ApplicationProvidersResourceHandler { - - private static ResourceBundle fgResourceBundle; - public static ResourceLocator RESOURCE_LOCATOR = new ResourceLocator() { - public URL getBaseURL() { - return null; - } - - public Object getImage(String arg0) { - return J2EEPlugin.getPlugin().getImage(arg0); - } - - public String getString(String arg0) { - return ApplicationProvidersResourceHandler.getString(arg0); - } - - public String getString(String arg0, Object[] arg1) { - return ApplicationProvidersResourceHandler.getString(arg0, arg1); - } - public String getString(String key, boolean translate) { - // TODO For now... translate not supported - return getString(key); - } - - public String getString(String key, Object[] substitutions, boolean translate) { - // TODO For now... translate not supported - return getString(key,substitutions); - } - }; - - /** - * Returns the resource bundle used by all classes in this Project - */ - public static ResourceBundle getResourceBundle() { - try { - return ResourceBundle.getBundle("applicationproviders");//$NON-NLS-1$ - } catch (MissingResourceException e) { - // does nothing - this method will return null and - // getString(String, String) will return the key - // it was called with - } - return null; - } - - public static String getString(String key) { - if (fgResourceBundle == null) { - fgResourceBundle = getResourceBundle(); - } - - if (fgResourceBundle != null) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - } - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - - public static String getString(String key, Object[] args) { - - try { - return MessageFormat.format(getString(key), args); - } catch (IllegalArgumentException e) { - return getString(key); - } - - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ConnectorModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ConnectorModuleItemProvider.java deleted file mode 100644 index ee08848bc..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ConnectorModuleItemProvider.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.application.ConnectorModule; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adapter for a Connector modules in ears. - */ -public class ConnectorModuleItemProvider extends ModuleItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - * - * @param AdapterFactory - * adapterFactory - Current adapter - */ - public ConnectorModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - }// ConnectorModuleItemProvider - - /** - * This returns resource image - * - * @param Object - * object - resource - * @return Object - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("full/obj16/connector_module"); //$NON-NLS-1$ - }// getImage - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((ConnectorModule) object).getUri(); - return label == null || label.length() == 0 ? getString("_UI_ConnectorModule_type") : //$NON-NLS-1$ - getString("_UI_ConnectorModule_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - - /** - * This returns the parent of the ConnectorModule. - * - * @param Object - * object - resource - * @return Object - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - }// getParent - - /** - * This returns the property descriptors for the adapted class. - * - * @param Object - * object - resource - * @return List - */ - public List getPropertyDescriptors(Object object) { - - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - }// if - - return itemPropertyDescriptors; - }// getPropertyDescriptors - -}// ConnectorModuleItemProvider diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/EjbModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/EjbModuleItemProvider.java deleted file mode 100644 index 1dcc01e11..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/EjbModuleItemProvider.java +++ /dev/null @@ -1,108 +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.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.application.EjbModule; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.EjbModule}object. - */ -public class EjbModuleItemProvider extends ModuleItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public EjbModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns EjbModule.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("module_ejb_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((EjbModule) object).getUri(); - return label == null || label.length() == 0 ? getString("_UI_EjbModule_type") : //$NON-NLS-1$ - getString("_UI_EjbModule_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - - /** - * This returns the parent of the EjbModule. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/JavaClientModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/JavaClientModuleItemProvider.java deleted file mode 100644 index 9e14a7f18..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/JavaClientModuleItemProvider.java +++ /dev/null @@ -1,108 +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.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.application.JavaClientModule; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.JavaClientModule}object. - */ -public class JavaClientModuleItemProvider extends ModuleItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public JavaClientModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns JavaClientModule.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("module_clientapp_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((JavaClientModule) object).getUri(); - return label == null || label.length() == 0 ? getString("_UI_JavaClientModule_type") : //$NON-NLS-1$ - getString("_UI_JavaClientModule_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - - /** - * This returns the parent of the JavaClientModule. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ModuleItemProvider.java deleted file mode 100644 index c00f59193..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ModuleItemProvider.java +++ /dev/null @@ -1,179 +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.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.Module}object. - */ -public class ModuleItemProvider extends ApplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public ModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns Module.gif. - */ - public Object getImage(Object object) { - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getImage("Module"); //$NON-NLS-1$ - } - - /** - * This returns the parent of the Module. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - ApplicationPackage pkg = ApplicationPackage.eINSTANCE; - - // This is for the uri feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Uri_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_uri_property_UI_"), //$NON-NLS-1$ - pkg.getModule_Uri())); - - // This is for the altDD feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("AltDD_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_altDD_property_UI_"), //$NON-NLS-1$ - pkg.getModule_AltDD(), false)); - - // This is for the application feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Application_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_application_property_UI_"), //$NON-NLS-1$ - pkg.getModule_Application(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Uri feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUriPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Module_uri_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Module_uri_feature", "_UI_Module_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ApplicationPackage.eINSTANCE.getModule_Uri(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Alt DD feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addAltDDPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Module_altDD_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Module_altDD_feature", "_UI_Module_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ApplicationPackage.eINSTANCE.getModule_AltDD(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return getURIIfPossible((Module) object); - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(Module.class)) { - case ApplicationPackage.MODULE__URI : - case ApplicationPackage.MODULE__ALT_DD : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - public static String getURIIfPossible(Module m) { - return m.getUri() == null ? ApplicationProvidersResourceHandler.getString("<<URI_not_set>>_ERROR_") : m.getUri(); //$NON-NLS-1$ - } - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. - */ - /* - * public void notifyChanged(Notifier notifier, int eventType, EObject feature, Object oldValue, - * Object newValue, int index) { ApplicationPackage pkg = ApplicationPackage.eINSTANCE;; if - * (feature == pkg.getModule_Uri() || feature == pkg.getModule_AltDD() || feature == - * pkg.getModule_Application()) { fireNotifyChanged(notifier, eventType, feature, oldValue, - * newValue, index); // ModuleExtension does not update automatically. // The following code is - * to explicitly notify ApplicationExtension if (feature == pkg.getModule_Uri() || feature == - * pkg.getModule_AltDD() ) { ApplicationExtension applicationExtension = - * ApplicationExtensionsHelper.getApplicationExtension(((Module)notifier).getApplication()); if - * (applicationExtension == null) return; EObject newFeature = - * ApplicationextPackage.eINSTANCE.getApplicationExtension_ModuleExtensions(); Object - * moduleExtension = applicationExtension.getModuleExtension((Module)notifier); Notification - * notification = new NotificationImpl(applicationExtension, Notification.SET, newFeature, - * moduleExtension, moduleExtension); applicationExtension.eNotify(notification); } // code ends - * return; } super.notifyChanged(notifier, eventType, feature, oldValue, newValue, index); } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/WebModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/WebModuleItemProvider.java deleted file mode 100644 index 7b185b653..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/WebModuleItemProvider.java +++ /dev/null @@ -1,138 +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.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.WebModule}object. - */ -public class WebModuleItemProvider extends ModuleItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public WebModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns WebModule.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("module_web_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((WebModule) object).getUri(); - return label == null || label.length() == 0 ? getString("_UI_WebModule_type") : //$NON-NLS-1$ - getString("_UI_WebModule_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(WebModule.class)) { - case ApplicationPackage.WEB_MODULE__CONTEXT_ROOT : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - - /** - * This returns the parent of the WebModule. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - ApplicationPackage pkg = ApplicationPackage.eINSTANCE; - - // This is for the contextRoot feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("ContextRoot_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_contextRoot_property_UI_"), //$NON-NLS-1$ - pkg.getWebModule_ContextRoot(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Context Root feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addContextRootPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WebModule_contextRoot_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WebModule_contextRoot_feature", "_UI_WebModule_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ApplicationPackage.eINSTANCE.getWebModule_ContextRoot(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ApplicationClientItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ApplicationClientItemProvider.java deleted file mode 100644 index 3fb8b9d26..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ApplicationClientItemProvider.java +++ /dev/null @@ -1,275 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.provider; - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.client.ApplicationClient; -import org.eclipse.jst.j2ee.client.ClientPackage; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.internal.provider.CompatibilityDescriptionGroupItemProvider; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.webservices.WSDLServiceExtManager; -import org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper; -import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientFactory; - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.client.ApplicationClient}object. - */ -public class ApplicationClientItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public ApplicationClientItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: create some child object. - return null; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - ClientPackage pkg = ClientPackage.eINSTANCE; - Collection result = new ArrayList(); - result.add(pkg.getApplicationClient_EjbReferences()); - result.add(pkg.getApplicationClient_ResourceRefs()); - result.add(pkg.getApplicationClient_ResourceEnvRefs()); - result.add(pkg.getApplicationClient_EnvironmentProps()); - result.add(pkg.getApplicationClient_MessageDestinationRefs()); - result.add(pkg.getApplicationClient_ServiceRefs()); - return result; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return J2EEPlugin.getPlugin().getImage(refObject.eClass().getName() + "Create#CHILD_CLASS_NAME#"); //$NON-NLS-1$ - } - - /** - * This returns the label for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return ApplicationProvidersResourceHandler.getString("Create_Child_UI_"); //$NON-NLS-1$ - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return ApplicationProvidersResourceHandler.getString("Create_a_child_for_the_selected_UI_") + refObject.eClass().getName() + "."; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This returns ApplicationClient.gif. - */ - public Object getImage(Object object) { - String key = null; - if (((ApplicationClient) object).eResource() == null) - return J2EEPlugin.getPlugin().getImage("applclientJAR_obj"); //$NON-NLS-1$ - switch (((ApplicationClient) object).getVersionID()) { - case J2EEVersionConstants.J2EE_1_2_ID : - key = "appclient_12"; //$NON-NLS-1$ - break; - case J2EEVersionConstants.J2EE_1_3_ID : - key = "appclient_13"; //$NON-NLS-1$ - break; - case J2EEVersionConstants.J2EE_1_4_ID : - default : - key = "appclient_14"; //$NON-NLS-1$ - break; - } - return J2EEPlugin.getPlugin().getImage(key); - } - - /** - * This returns the parent of the ApplicationClient. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This adds a property descriptor for the Version feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addVersionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ApplicationClient_version_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ApplicationClient_version_feature", "_UI_ApplicationClient_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ClientPackage.eINSTANCE.getApplicationClient_Version(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Callback Handler feature. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void addCallbackHandlerPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ApplicationClient_callbackHandler_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ApplicationClient_callbackHandler_feature", "_UI_ApplicationClient_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ClientPackage.eINSTANCE.getApplicationClient_CallbackHandler(), true)); - } - - public String getText(Object object) { - - /* - * String displayName = ((ApplicationClient) object).getDisplayName(); return displayName == - * null ? "" ApplicationProvidersResourceHandler.getString(" < <No_display_name>>_ERROR_") : - * displayName; //$NON-NLS-1$ - */ - ApplicationClient appclient = ((ApplicationClient) object); - if (appclient.getDisplayName() == null) { - try { - IProject project = ProjectUtilities.getProject(appclient); - return project.getDescription().getName(); - } catch (Exception e) { - //Ignore - } - - Resource resource = appclient.eResource(); - if (resource != null) { - return new Path(resource.getURI().toString()).removeFileExtension().lastSegment(); - } - return ""; //$NON-NLS-1$ - } - return appclient.getDisplayName(); - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ApplicationClient.class)) { - case ClientPackage.APPLICATION_CLIENT__VERSION : - case ClientPackage.APPLICATION_CLIENT__RESOURCE_REFS : - case ClientPackage.APPLICATION_CLIENT__ENVIRONMENT_PROPS : - case ClientPackage.APPLICATION_CLIENT__EJB_REFERENCES : - case ClientPackage.APPLICATION_CLIENT__RESOURCE_ENV_REFS : - case ClientPackage.APPLICATION_CLIENT__SERVICE_REFS : - case ClientPackage.APPLICATION_CLIENT__MESSAGE_DESTINATION_REFS : - case ClientPackage.APPLICATION_CLIENT__MESSAGE_DESTINATIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_ResourceRefs(), CommonFactory.eINSTANCE.createResourceRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_EnvironmentProps(), CommonFactory.eINSTANCE.createEnvEntry())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_EjbReferences(), CommonFactory.eINSTANCE.createEjbRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_EjbReferences(), CommonFactory.eINSTANCE.createEJBLocalRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_ResourceEnvRefs(), CommonFactory.eINSTANCE.createResourceEnvRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_ServiceRefs(), Webservice_clientFactory.eINSTANCE.createServiceRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_MessageDestinationRefs(), CommonFactory.eINSTANCE.createMessageDestinationRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_MessageDestinations(), CommonFactory.eINSTANCE.createMessageDestination())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object) - */ - public Collection getChildren(Object object) { - ApplicationClient client = (ApplicationClient) object; - Collection myChildren = super.getChildren(object); - myChildren.addAll(client.getMessageDestinations()); - if (client.getVersionID() <= J2EEVersionConstants.J2EE_1_3_ID) { - WSDLServiceHelper serviceHelper = WSDLServiceExtManager.getServiceHelper(); - myChildren.addAll(serviceHelper.get13ServiceRefs(client)); - } - return myChildren; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapter.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapter.java deleted file mode 100644 index 4253a6b5a..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapter.java +++ /dev/null @@ -1,80 +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.internal.provider; - - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.command.CommandParameter; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.application.common.CreateChildCommand; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; - - - -/** - * This extended item provider supports the following commands: - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. The commands - * are implemented uniformly on all our item adapters using this common base class. - */ -public class ClientItemProviderAdapter extends ItemProviderAdapter implements org.eclipse.jst.j2ee.internal.application.common.CreateChildCommand.Helper { - /** - * This creates and instance from an adapter factory and a domain notifier. - */ - protected ClientItemProviderAdapter(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This implements the default behavior for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - return null; - } - - /** - * This creates the supported commands. - */ - public Command createCommand(Object object, EditingDomain editingDomain, Class commandClass, CommandParameter commandParameter) { - if (commandClass == CreateChildCommand.class) { - return new CreateChildCommand(editingDomain, (EObject) object, null, this); - } - return super.createCommand(object, editingDomain, commandClass, commandParameter); - } - - /** - * This returns the default image for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getImage("CreateChild"); //$NON-NLS-1$ - } - - /** - * This returns the default label for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return ApplicationProvidersResourceHandler.getString("Create_Child_UI_"); //$NON-NLS-1$ - } - - /** - * This returns the default help text for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return ApplicationProvidersResourceHandler.getString("Create_a_new_child_for_the_selected_UI_") + refObject.eClass().getName() + "."; //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapterFactory.java deleted file mode 100644 index 5a5b15955..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapterFactory.java +++ /dev/null @@ -1,180 +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.internal.provider; - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.Disposable; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITableItemLabelProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.client.internal.util.ClientAdapterFactory; - - -/** - * This is the factory that is used to provide the interfaces needed to support - * {@link org.eclipse.jface.viewers.Viewer}s. The adapters generated by this factory convert EMF - * adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters - * also support property sheets, see {@link org.eclipse.ui.views.properties}. Note that most of the - * adapters are shared among multiple instances. - */ -public class ClientItemProviderAdapterFactory extends ClientAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - /** - * This is used to implement {@link #IChangeNotifier}. - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.client.ApplicationClient}instances. - */ - protected ApplicationClientItemProvider applicationClientItemProvider; - protected Disposable disposable = new Disposable(); - - /** - * This constructs an instance. - */ - public ClientItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(ITableItemLabelProvider.class); - } - - public Adapter adapt(Notifier target, Object adapterKey) { - return super.adapt(target, this); - } - - public Object adapt(Object object, Object type) { - // This is a kludge to deal with enumerators, which crash the doSwitch. - // - if (object instanceof EObject && ((EObject) object).eClass() == null) { - return null; - } - - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - public Adapter adaptNew(Notifier target, Object adapterType) { - Adapter adapter = super.adaptNew(target, adapterType); - disposable.add(adapter); - return adapter; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.client.ApplicationClient}. - */ - public Adapter createApplicationClientAdapter() { - if (applicationClientItemProvider == null) { - applicationClientItemProvider = new ApplicationClientItemProvider(this); - } - - return applicationClientItemProvider; - } - - public void dispose() { - disposable.dispose(); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. - */ - /* - * public void fireNotifyChanged(Object object, int eventType, Object feature, Object oldValue, - * Object newValue, int index) { changeNotifier.fireNotifyChanged(object, eventType, feature, - * oldValue, newValue, index); - * - * if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(object, eventType, - * feature, oldValue, newValue, index); } } - */ - /** - * This returns the root adapter factory that contains this factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - public boolean isFactoryForType(Object type) { - return super.isFactoryForType(type) || supportedTypes.contains(type); - } - - /** - * This removes a listener. - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This sets the composed adapter factory that contains this factory. - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/EARProjectMapItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/EARProjectMapItemProvider.java deleted file mode 100644 index 1edbb7d92..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/EARProjectMapItemProvider.java +++ /dev/null @@ -1,166 +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.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.EARProjectMap; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.EARProjectMap} - * object. - */ -public class EARProjectMapItemProvider extends ModulemapItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** Added to generated code */ - protected boolean includeModules = false; - - /** - * This constructs an instance from a factory and a notifier. - */ - public EARProjectMapItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - public EARProjectMapItemProvider(AdapterFactory adapterFactory, boolean includeModules) { - this(adapterFactory); - this.includeModules = includeModules; - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - if (includeModules) - childrenReferences.add(ModulemapPackage.eINSTANCE.getEARProjectMap_Mappings()); - childrenReferences.add(ModulemapPackage.eINSTANCE.getEARProjectMap_UtilityJARMappings()); - } - return childrenReferences; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // TODO: Check the type of the specified child object and return the proper feature to use - // for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the parent of the EARProjectMap. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns EARProjectMap.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("EARProjectMap"); //$NON-NLS-1$ - } - - public String getText(Object object) { - return ApplicationProvidersResourceHandler.getString("EARProjectMap_UI_"); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(EARProjectMap.class)) { - case ModulemapPackage.EAR_PROJECT_MAP__MAPPINGS : - case ModulemapPackage.EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. - */ - /* - * public void notifyChanged(Notifier notifier, int eventType, EObject feature, Object oldValue, - * Object newValue, int index) { ModulemapPackage pkg = ModulemapPackage.eINSTANCE;; if - * (!includeModules && feature == pkg.getEARProjectMap_Mappings()) return; - * - * if (feature == pkg.getEARProjectMap_Mappings() || feature == - * pkg.getEARProjectMap_UtilityJARMappings()) { fireNotifyChanged(notifier, eventType, feature, - * oldValue, newValue, index); return; } super.notifyChanged(notifier, eventType, feature, - * oldValue, newValue, index); } - */ - - /** - * This adds to the collection of {@linkcom.ibm.etools.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - if (includeModules) - newChildDescriptors.add(createChildParameter(modulemapPackage.getEARProjectMap_Mappings(), modulemapPackage.getModuleMapping())); - newChildDescriptors.add(createChildParameter(modulemapPackage.getEARProjectMap_UtilityJARMappings(), modulemapPackage.getUtilityJARMapping())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/FacetedProjectPropertyTester.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/FacetedProjectPropertyTester.java deleted file mode 100644 index 09474d081..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/FacetedProjectPropertyTester.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.eclipse.jst.j2ee.internal.provider; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework; - -public class FacetedProjectPropertyTester extends PropertyTester - -{ - public boolean test( final Object receiver, - final String property, - final Object[] args, - final Object value ) - { - try - { - if( ! ( receiver instanceof J2EEItemProvider ) ) - { - return false; - } - - IResource resource = ((J2EEItemProvider) receiver).getAssociatedFile(); - final IProject pj = resource.getProject(); - - if( pj == null ) - { - return false; - } - - final String val = (String) value; - final int colon = val.indexOf( ':' ); - - final String fid; - final String vexpr; - - if( colon == -1 || colon == val.length() - 1 ) - { - fid = val; - vexpr = null; - } - else - { - fid = val.substring( 0, colon ); - vexpr = val.substring( colon + 1 ); - } - - return FacetedProjectFramework.hasProjectFacet( pj, fid, vexpr ); - } - catch( CoreException e ) - { - // - } - - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/J2EEItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/J2EEItemProvider.java deleted file mode 100644 index d7b71f178..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/J2EEItemProvider.java +++ /dev/null @@ -1,250 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.provider; - - -import java.util.Collection; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ItemProvider; - -public class J2EEItemProvider extends ItemProvider implements IAdaptable { - - protected static final Class IRESOURCE_CLASS = IResource.class; - protected static final Class IFILE_CLASS = IFile.class; - - - /** - * Constructor for J2EEItemProvider. - */ - public J2EEItemProvider() { - super(); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param children - */ - public J2EEItemProvider(Collection children) { - super(children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - */ - public J2EEItemProvider(String text) { - super(text); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param children - */ - public J2EEItemProvider(String text, Collection children) { - super(text, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param image - */ - public J2EEItemProvider(String text, Object image) { - super(text, image); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param image - * @param children - */ - public J2EEItemProvider(String text, Object image, Collection children) { - super(text, image, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param image - * @param parent - */ - public J2EEItemProvider(String text, Object image, Object parent) { - super(text, image, parent); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param image - * @param parent - * @param children - */ - public J2EEItemProvider(String text, Object image, Object parent, Collection children) { - super(text, image, parent, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - */ - public J2EEItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text) { - super(adapterFactory, text); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param image - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Object image) { - super(adapterFactory, text, image); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param image - * @param parent - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent) { - super(adapterFactory, text, image, parent); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param children - */ - public J2EEItemProvider(AdapterFactory adapterFactory, Collection children) { - super(adapterFactory, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param children - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Collection children) { - super(adapterFactory, text, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param image - * @param children - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Object image, Collection children) { - super(adapterFactory, text, image, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param image - * @param parent - * @param children - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent, Collection children) { - super(adapterFactory, text, image, parent, children); - } - - protected boolean notificationOn = true; - - protected void disableNotification() { - notificationOn = false; - } - - protected void enableNotification() { - notificationOn = true; - } - - - public void fireNotifyChanged(Notification notification) { - if (notificationOn) - super.fireNotifyChanged(notification); - } - - public Collection getChildren(Object object) { - if (children.isEmpty()) { - try { - disableNotification(); - initializeChildren(); - } finally { - enableNotification(); - } - } - return children; - } - - protected void initializeChildren() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - if (adapter == IRESOURCE_CLASS || adapter == IFILE_CLASS) - return null; //return getAssociatedFile(); - return Platform.getAdapterManager().getAdapter(this, adapter); - } - - public IFile getAssociatedFile() { - return null; - } - - /** - * @return - */ -// private IProject getProjectFromParent() { -// return ProjectUtilities.getProject(getParent()); -// } - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModuleMappingItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModuleMappingItemProvider.java deleted file mode 100644 index d7c6f84b0..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModuleMappingItemProvider.java +++ /dev/null @@ -1,166 +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.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModuleMapping; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.ModuleMapping} - * object. - */ -public class ModuleMappingItemProvider extends ModulemapItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - */ - public ModuleMappingItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - ModulemapPackage pkg = ModulemapPackage.eINSTANCE; - ; - - // This is for the projectName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Project_Name_1"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_project_name_property_of_the_module_mapping_UI_"), //$NON-NLS-1$ - pkg.getModuleMapping_ProjectName(), true, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - // This is for the module feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Module_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_module_of_the_module_mapping_UI_"), //$NON-NLS-1$ - pkg.getModuleMapping_Module(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Project Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addProjectNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ModuleMapping_projectName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ModuleMapping_projectName_feature", "_UI_ModuleMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ModulemapPackage.eINSTANCE.getModuleMapping_ProjectName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Module feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addModulePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ModuleMapping_module_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ModuleMapping_module_feature", "_UI_ModuleMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ModulemapPackage.eINSTANCE.getModuleMapping_Module(), true)); - } - - - /** - * This returns the parent of the ModuleMapping. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns ModuleMapping.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("ModuleMapping"); //$NON-NLS-1$ - } - - public String getText(Object object) { - ModuleMapping moduleMapping = ((ModuleMapping) object); - return ApplicationProvidersResourceHandler.getString("ModuleMapping_UI_") + moduleMapping.getProjectName(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ModuleMapping.class)) { - case ModulemapPackage.MODULE_MAPPING__PROJECT_NAME : - case ModulemapPackage.MODULE_MAPPING__MODULE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. - */ - /* - * public void notifyChanged(Notifier notifier, int eventType, EObject feature, Object oldValue, - * Object newValue, int index) { ModulemapPackage pkg = ModulemapPackage.eINSTANCE;; if ( - * feature == pkg.getModuleMapping_ProjectName() || feature == pkg.getModuleMapping_Module() ) { - * fireNotifyChanged(notifier, eventType, feature, oldValue, newValue, index); return; } - * super.notifyChanged(notifier, eventType, feature, oldValue, newValue, index); } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapEditPlugin.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapEditPlugin.java deleted file mode 100644 index ebf6adf34..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapEditPlugin.java +++ /dev/null @@ -1,125 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.internal.provider; - - -import java.net.MalformedURLException; -import java.net.URL; -import java.text.MessageFormat; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapFactory; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; - - - -/** - * @deprecated Leaving this in for now, to minimize breakage to all the providers; should delete - * when we regen all providers for mof5 - * - * This is the central singleton for the modulemap plugin. - */ -public class ModulemapEditPlugin extends Plugin { - /** - * Keep track of the singleton. - */ - protected static ModulemapEditPlugin plugin; - - /** - * Keep track of the modulemap package. - */ - protected ModulemapPackage modulemapPackage; - - /** - * Create the instance. - */ - public ModulemapEditPlugin(IPluginDescriptor descriptor) { - super(descriptor); - - // Remember the static instance. - // - plugin = this; - } - - /** - * Get the one modulemap package. - */ - public ModulemapPackage getModulemapPackage() { - return modulemapPackage; - } - - /** - * Get the one modulemap factory. - */ - public ModulemapFactory getModulemapFactory() { - return (ModulemapFactory) modulemapPackage.getEFactoryInstance(); - } - - /** - * Do initialization stuff here. - */ - public void startup() throws CoreException { - super.startup(); - modulemapPackage = org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapFactoryImpl.getPackage(); - } - - /** - * Get the singleton instance. - */ - public static ModulemapEditPlugin getPlugin() { - return plugin; - } - - /** - * Get a .gif from the icons folder. - */ - public Object getImage(String key) { - try { - return new URL(getDescriptor().getInstallURL(), "icons/" + key + ".gif"); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (MalformedURLException exception) { - System.out.println(ApplicationProvidersResourceHandler.getString("Failed_to_load_image_for_ERROR_") + key + "'"); //$NON-NLS-1$ //$NON-NLS-2$ - exception.printStackTrace(); - } - - return null; - } - - /** - * Get a translated string from the resource bundle. - */ - public String getString(String key) { - return getDescriptor().getResourceBundle().getString(key); - } - - /** - * Get a translated string from the resource bundle, with an object substitution. - */ - public String getString(String key, Object s1) { - return MessageFormat.format(getString(key), new Object[]{s1}); - } - - /** - * Get a translated string from the resource bundle, with two object substitutions. - */ - public String getString(String key, Object s1, Object s2) { - return MessageFormat.format(getString(key), new Object[]{s1, s2}); - } - - /** - * Get a translated string from the resource bundle, with three object substitutions. - */ - public String getString(String key, Object s1, Object s2, Object s3) { - return MessageFormat.format(getString(key), new Object[]{s1, s2, s3}); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapter.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapter.java deleted file mode 100644 index 49bc8c44b..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapter.java +++ /dev/null @@ -1,137 +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.internal.provider; - - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.CommandParameter; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapFactory; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This extended item provider supports the following commands: - * <ul> - * <li>{@link CreateChildCommand} - * </ul> - * <p> - * The commands are implemented uniformly on all our item adapters using this common base class. - */ -public class ModulemapItemProviderAdapter extends ItemProviderAdapter { - /** - * This is the package for the modulemap model. - */ - protected static final ModulemapPackage modulemapPackage = (ModulemapPackage) EPackage.Registry.INSTANCE.getEPackage(ModulemapPackage.eNS_URI); - /** - * This is the factory for the modulemap model. - */ - protected static final ModulemapFactory modulemapFactory = modulemapPackage.getModulemapFactory(); - - /** - * This creates an instance from an adapter factory and a domain notifier. - */ - protected ModulemapItemProviderAdapter(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates the supported commands. - */ - public Command createCommand(Object object, EditingDomain editingDomain, Class commandClass, CommandParameter commandParameter) { - return super.createCommand(object, editingDomain, commandClass, commandParameter); - } - - /** - * This is a convenience method for creating <code>CommandParameter</code> s for a given - * parent feature and child type (MOF meta-object). - */ - protected CommandParameter createChildParameter(EReference feature, EObject childType) { - return new CommandParameter(null, feature, modulemapFactory.create(childType.eClass())); - } - - /** - * This returns the default owner object for {@link CreateChildCommand}. - */ - public Object getCreateChildOwner(Object parent) { - return parent; - } - - /** - * This returns the default result collection for {@link CreateChildCommand}. - */ - public Collection getCreateChildResult(Object child) { - Collection result = new ArrayList(1); - result.add(child); - return result; - } - - /** - * This returns the default label for {@link CreateChildCommand}. - */ - public String getCreateChildText(Object parent, Object feature, Object child) { - return J2EEPlugin.getPlugin().getString("_UI_CreateChild_text"); //$NON-NLS-1$ - } - - /** - * This returns the default description for {@link CreateChildCommand}. - */ - public String getCreateChildDescription(Object parent, Object feature, Object child) { - return J2EEPlugin.getPlugin().getString("_UI_CreateChild_description"); //$NON-NLS-1$ - } - - /** - * This returns the default help text for {@link CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object parent, Object feature, Object child) { - return J2EEPlugin.getPlugin().getString("_UI_CreateChild_tooltip"); //$NON-NLS-1$ - } - - /** - * This returns the default image for {@link CreateChildCommand}. - */ - public Object getCreateChildImage(Object parent, Object feature, Object child) { - Object image = null; - - if (parent instanceof EObject && child instanceof EObject) { - String name = ((EObject) parent).eClass().getName() + "Create" + ((EObject) child).eClass().getName(); //$NON-NLS-1$ - image = J2EEPlugin.getPlugin().getImage(name); - } - return image; - } - - /** - * This looks up the name of the type of the specified object. - */ - protected String getTypeText(Object object) { - String typeKey = object instanceof EObject ? ((EObject) object).eClass().getName() : "Unknown"; //$NON-NLS-1$ - return J2EEPlugin.getPlugin().getString("_UI_" + typeKey + "_type"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This looks up the name of the specified feature. - */ - protected String getFeatureText(Object feature) { - String featureKey = feature instanceof EReference ? ((EReference) feature).getName() : "Unknown"; //$NON-NLS-1$ - return J2EEPlugin.getPlugin().getString("_UI_" + featureKey + "_feature"); //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapterFactory.java deleted file mode 100644 index bc415ac53..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapterFactory.java +++ /dev/null @@ -1,215 +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.internal.provider; - - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITableItemLabelProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapAdapterFactory; - - - -/** - * This is the factory that is used to provide the interfaces needed to support - * {@link org.eclipse.jface.viewers.Viewer}s. The adapters generated by this factory convert EMF - * adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters - * also support property sheets, see {@link org.eclipse.ui.views.properties}. Note that most of the - * adapters are shared among multiple instances. - */ -public class ModulemapItemProviderAdapterFactory extends ModulemapAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement {@link #com.ibm.etools.emf.edit.provider.IChangeNotifier}. - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - - /** - * This constructs an instance. - */ - public ModulemapItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(ITableItemLabelProvider.class); - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.ModuleMapping} - * instances. - */ - protected ModuleMappingItemProvider moduleMappingItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.ModuleMapping}. - */ - public Adapter createModuleMappingAdapter() { - if (moduleMappingItemProvider == null) { - moduleMappingItemProvider = new ModuleMappingItemProvider(this); - } - - return moduleMappingItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.EARProjectMap} - * instances. - */ - protected EARProjectMapItemProvider earProjectMapItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.EARProjectMap}. - */ - public Adapter createEARProjectMapAdapter() { - if (earProjectMapItemProvider == null) { - earProjectMapItemProvider = new EARProjectMapItemProvider(this); - } - - return earProjectMapItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.UtilityJARMapping} - * instances. - */ - protected UtilityJARMappingItemProvider utilityJARMappingItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.UtilityJARMapping}. - */ - public Adapter createUtilityJARMappingAdapter() { - if (utilityJARMappingItemProvider == null) { - utilityJARMappingItemProvider = new UtilityJARMappingItemProvider(this); - } - - return utilityJARMappingItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - public boolean isFactoryForType(Object type) { - return super.isFactoryForType(type) || supportedTypes.contains(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. - */ - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - public Object adapt(Object object, Object type) { - // This is a kludge to deal with enumerators, which crash the doSwitch. - // - if (object instanceof EObject && ((EObject) object).eClass() == null) { - return null; - } - - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. - */ - /* - * public void fireNotifyChanged(Object object, int eventType, Object feature, Object oldValue, - * Object newValue, int index) { changeNotifier.fireNotifyChanged(object, eventType, feature, - * oldValue, newValue, index); - * - * if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(object, eventType, - * feature, oldValue, newValue, index); } } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/UtilityJARMappingItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/UtilityJARMappingItemProvider.java deleted file mode 100644 index 6cf3c105f..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/UtilityJARMappingItemProvider.java +++ /dev/null @@ -1,191 +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.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.UtilityJARMapping; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.UtilityJARMapping} - * object. - */ -public class UtilityJARMappingItemProvider extends ModulemapItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - */ - public UtilityJARMappingItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - ModulemapPackage pkg = ModulemapPackage.eINSTANCE; - ; - - // This is for the projectName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Project_Name_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_project_name_property_of_the_utility_jar_mapping_UI_"), //$NON-NLS-1$ - pkg.getUtilityJARMapping_ProjectName(), false, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - // This is for the uri feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Uri_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_uri_property_of_the_utility_jar_mapping_UI_"), //$NON-NLS-1$ - pkg.getUtilityJARMapping_Uri(), true, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Project Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addProjectNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_UtilityJARMapping_projectName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_UtilityJARMapping_projectName_feature", "_UI_UtilityJARMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ModulemapPackage.eINSTANCE.getUtilityJARMapping_ProjectName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Uri feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUriPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_UtilityJARMapping_uri_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_UtilityJARMapping_uri_feature", "_UI_UtilityJARMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ModulemapPackage.eINSTANCE.getUtilityJARMapping_Uri(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns the parent of the UtilityJARMapping. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns UtilityJARMapping.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("icons/full/obj16/prjutiljar_obj"); //$NON-NLS-1$ - } - - // /** - // * @param object - // * @return - // */ - // private boolean isEJBClientJAR(Object object) { - // UtilityJARMapping map = (UtilityJARMapping) object; - // IProject project = ProjectUtilities.getProject(map); - // if (project == null) - // return false; - // - // EARNatureRuntime runtime = EARNatureRuntime.getRuntime(project); - // if (runtime == null) - // return false; - // - // EAREditModel model = null; - // try { - // model = runtime.getEarEditModelForRead(this); - // return model.isEjbClientJarMapping(map); - // } finally { - // if (model != null) - // model.releaseAccess(this); - // } - // } - - public String getText(Object object) { - UtilityJARMapping map = ((UtilityJARMapping) object); - return map == null ? "<??>" : map.getUri(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(UtilityJARMapping.class)) { - case ModulemapPackage.UTILITY_JAR_MAPPING__PROJECT_NAME : - case ModulemapPackage.UTILITY_JAR_MAPPING__URI : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. - */ - /* - * public void notifyChanged(Notifier notifier, int eventType, EObject feature, Object oldValue, - * Object newValue, int index) { ModulemapPackage pkg = ModulemapPackage.eINSTANCE;; if ( - * feature == pkg.getUtilityJARMapping_ProjectName() || feature == - * pkg.getUtilityJARMapping_Uri() ) { fireNotifyChanged(notifier, eventType, feature, oldValue, - * newValue, index); return; } super.notifyChanged(notifier, eventType, feature, oldValue, - * newValue, index); } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/archive/IArchiveExportParticipant.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/archive/IArchiveExportParticipant.java deleted file mode 100644 index b38176d8b..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/archive/IArchiveExportParticipant.java +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005, 2007 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - ******************************************************************************/ - -package org.eclipse.jst.j2ee.archive; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -/** - * Used in conjunction with the <code>org.eclipse.jst.j2ee.archiveExportParticipants</code> - * extension point in order to extend the base module archive export operation. - * - * @since 3.0 - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public interface IArchiveExportParticipant -{ - /** - * Creates the data model that will be used to configure the operation. - * - * @param rootArchiveExportDataModel the data model of the module archive export - * operation that this participant is extending - * @return the created data model - */ - - IDataModel createDataModel( IDataModel rootArchiveExportDataModel ); - - /** - * Creates the operation that will be invoked in order to let this extension - * participate in the export process. - * - * @param extensionDataModel the data model associated with this export - * participant (previously returned by the createDataModel() method) - * @return the created operation - */ - - IDataModelOperation createOperation( IDataModel extensionDataModel ); -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAddWebComponentToEnterpriseApplicationDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAddWebComponentToEnterpriseApplicationDataModelProperties.java deleted file mode 100644 index 45d5e29ea..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAddWebComponentToEnterpriseApplicationDataModelProperties.java +++ /dev/null @@ -1,19 +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.datamodel.properties; - -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; - -public interface IAddWebComponentToEnterpriseApplicationDataModelProperties extends ICreateReferenceComponentsDataModelProperties{ - - public static final String CONTEXT_ROOT = "IAddWebComponentToEnterpriseApplicationDataModelProperties.CONTEXT_ROOT"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAppClientComponentExportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAppClientComponentExportDataModelProperties.java deleted file mode 100644 index 00fa5d0ba..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAppClientComponentExportDataModelProperties.java +++ /dev/null @@ -1,30 +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.datamodel.properties; -/** - * <p> - * IAppClientComponentExportDataModelProperties provides properties to the IDataModel associated with the - * AppClientComponentExportDataModelProvider. - * NOTE: The associated Provider and Operations will be created during M5 - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ -public interface IAppClientComponentExportDataModelProperties extends IJ2EEComponentExportDataModelProperties { - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAppClientComponentImportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAppClientComponentImportDataModelProperties.java deleted file mode 100644 index f2895dc90..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IAppClientComponentImportDataModelProperties.java +++ /dev/null @@ -1,31 +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.datamodel.properties; - -/** - * <p> - * IAppClientComponentImportDataModelProperties provides properties to the IDataModel associated with the - * AppClientComponentImportDataModelProvider. - * NOTE: The associated Provider and Operations will be created during M5 - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ -public interface IAppClientComponentImportDataModelProperties extends IJ2EEModuleImportDataModelProperties { - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IEARComponentExportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IEARComponentExportDataModelProperties.java deleted file mode 100644 index d6e8b1a81..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IEARComponentExportDataModelProperties.java +++ /dev/null @@ -1,30 +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.datamodel.properties; -/** - * <p> - * IEARComponentExportDataModelProperties provides properties to the DataModel associated with the - * EARComponentExportDataModelProvider. - * NOTE: The associated Provider and Operations will be created during M5 - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ -public interface IEARComponentExportDataModelProperties extends IJ2EEComponentExportDataModelProperties { - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IEARComponentImportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IEARComponentImportDataModelProperties.java deleted file mode 100644 index c30fa4a1b..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IEARComponentImportDataModelProperties.java +++ /dev/null @@ -1,79 +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.datamodel.properties; - -/** - * <p> - * IEARComponentImportDataModelProperties provides properties to the IDataModel associated with the - * EARComponentImportDataModelProvider. NOTE: The associated Provider and Operations will be created - * during M5 - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ -public interface IEARComponentImportDataModelProperties extends IJ2EEComponentImportDataModelProperties { - - /** - * Optional, type IPath default is ear location - */ - public static final String NESTED_MODULE_ROOT = "IEnterpriseApplicationImportDataModelProperties.NESTED_MODULE_ROOT"; //$NON-NLS-1$ - - /** - * Optional, A List containing utililty jars. This list should consist of the CommonArchive - * Archives of all the Utility Jars that should be extracted into projects. - */ - public static final String UTILITY_LIST = "IEnterpriseApplicationImportDataModelProperties.UTILITY_LIST"; //$NON-NLS-1$ - /** - * Optional, A List containing modules to be imported list; - */ - public static final String SELECTED_MODELS_LIST = "IEnterpriseApplicationImportDataModelProperties.SELECTED_MODELS_LIST"; //$NON-NLS-1$ - /** - * Optional, A List containing ejb client jars associated with any ejb components which are to - * be imported. - */ - public static final String EJB_CLIENT_LIST = "IEnterpriseApplicationImportDataModelProperties.EJB_CLIENT_LIST"; //$NON-NLS-1$ - - /** - * Optional. This is a list of data models. This list must contain all non-utilty projects in - * the ear to be imported - */ - public static final String MODULE_MODELS_LIST = "IEnterpriseApplicationImportDataModelProperties.MODULE_MODELS_LIST"; //$NON-NLS-1$ - - /** - * Optional. This is a list of data models. This list must contain all utility jars selected to - * be imported - */ - public static final String UTILITY_MODELS_LIST = "IEnterpriseApplicationImportDataModelProperties.UTILITY_MODELS_LIST"; //$NON-NLS-1$ - - /** - * This is an unsettable property which will return all the project DataModels. - */ - public static final String ALL_PROJECT_MODELS_LIST = "IEnterpriseApplicationImportDataModelProperties.ALL_PROJECT_MODELS_LIST"; //$NON-NLS-1$ - - /** - * This is an unsettable property which will return . - */ - public static final String UNHANDLED_PROJECT_MODELS_LIST = "IEnterpriseApplicationImportDataModelProperties.UNHANDLED_PROJECT_MODELS_LIST"; //$NON-NLS-1$ - - /** - * This is an unsettable property which will return . - */ - public static final String HANDLED_PROJECT_MODELS_LIST = "IEnterpriseApplicationImportDataModelProperties.HANDLED_PROJECT_MODELS_LIST"; //$NON-NLS-1$ - - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentCreationDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentCreationDataModelProperties.java deleted file mode 100644 index 3771f1538..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentCreationDataModelProperties.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.datamodel.properties; - -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetProjectCreationDataModelProperties; -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; - - - -/** - * <p> - * IJ2EEComponentCreationDataModelProperties provides properties to the - * J2EEComponentCreationDataModelProvider as well as all extending interfaces extending - * IJ2EEComponentCreationDataModelProperties - * @see org.eclipse.jst.j2ee.internal.archive.operations.J2EEComponentCreationDataModelProvider - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * @see org.eclipse.jst.j2ee.datamodel.properties.IJavaComponentCreationDataModelProperties - * @plannedfor 1.0 - */ - -/** - * This has been slated for removal post WTP 1.5. Do not use this class/interface - * - * @deprecated - * - * @see IJ2EEFacetProjectCreationDataModelProperties - */ -public interface IJ2EEComponentCreationDataModelProperties extends IJavaComponentCreationDataModelProperties, DoNotUseMeThisWillBeDeletedPost15{ - - /** - * Required, type Boolean, the default value is <code>Boolean.FALSE</code>. - */ - public static final String ADD_TO_EAR = "IJ2EEComponentCreationDataModelProperties.ADD_TO_EAR"; //$NON-NLS-1$ - - public static final String MODULE_URI = "IJ2EEComponentCreationDataModelProperties.MODULE_URI"; //$NON-NLS-1$ - /** - * type String, this property needs to be set if the value of the property ADD_TO_EAR is set to <code>Boolean.TRUE</code> - */ - public static final String EAR_COMPONENT_NAME = "IJ2EEComponentCreationDataModelProperties.EAR_COMPONENT_NAME"; //$NON-NLS-1$ - /** - * type String, this property needs to be set if the value of the property ADD_TO_EAR is set to <code>Boolean.TRUE</code> - */ - public static final String EAR_COMPONENT_DEPLOY_NAME = "IJ2EEComponentCreationDataModelProperties.EAR_COMPONENT_DEPLOY_NAME"; //$NON-NLS-1$ - /** - * type ComponentHandle, this property needs to be set if the value of the property ADD_TO_EAR is set to <code>Boolean.TRUE</code>. Represents - * a handle to the EAR - */ - public static final String EAR_COMPONENT_PROJECT = "IJ2EEComponentCreationDataModelProperties.EAR_COMPONENT_PROJECT"; //$NON-NLS-1$ - - /** - * type Boolean; the default value is <code>Boolean.TRUE</code>, this is UI only property - */ - public static final String UI_SHOW_EAR_SECTION = "IJ2EEComponentCreationDataModelProperties.UI_SHOW_EAR_SECTION"; //$NON-NLS-1$ - - /** - * Optional, type String - * String indicates the name of the the folder where the deployment descriptor exists. - * Each J2EE componenr provider will default the Deployment descriptor folder. - * - */ - - public static final String DD_FOLDER = "IJ2EEComponentCreationDataModelProperties.DD_FOLDER"; //$NON-NLS-1$ - - /** - * Required, type Integer. The user defined version of the component. - */ - public static final String COMPONENT_VERSION = "IComponentCreationDataModelProperties.COMPONENT_VERSION"; //$NON-NLS-1$ - - /** - * type Integer - */ - public static final String VALID_COMPONENT_VERSIONS_FOR_PROJECT_RUNTIME = "IComponentCreationDataModelProperties.VALID_COMPONENT_VERSIONS_FOR_PROJECT_RUNTIME"; //$NON-NLS-1$ - /** - * type AddComponentToEnterpriseApplicationDataModel - */ - public static final String NESTED_ADD_COMPONENT_TO_EAR_DM = "IComponentCreationDataModelProperties.NESTED_ADD_COMPONENT_TO_EAR_DM"; //$NON-NLS-1$ - /** - * type EARComponentCreationDataModel - */ - public static final String NESTED_EAR_COMPONENT_CREATION_DM = "IComponentCreationDataModelProperties.NESTED_EAR_COMPONENT_CREATION_DM"; //$NON-NLS-1$ - /** - * type UpdateManifestDataModel - */ - public static final String NESTED_UPDATE_MANIFEST_DM = "IComponentCreationDataModelProperties.NESTED_UPDATE_MANIFEST_DM"; //$NON-NLS-1$ - /** - * type ClassPathSelection - */ - public static final String CLASSPATH_SELECTION = "IComponentCreationDataModelProperties.CLASSPATH_SELECTION"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentExportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentExportDataModelProperties.java deleted file mode 100644 index d8663bf1e..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentExportDataModelProperties.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.datamodel.properties; - -import org.eclipse.jst.j2ee.archive.IArchiveExportParticipant; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties; -/** - * <p> - * IJ2EEComponentExportDataModelProperties provides properties to the IDataModel associated with the - * J2EEComponentExportDataModelProvider as well as all extending interfaces extending - * IJ2EEComponentExportDataModelProperties specifically all J2EE component specific exports. - * NOTE: The associated Provider and Operations will be created during M5 - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ -public interface IJ2EEComponentExportDataModelProperties extends IDataModelProperties { - - /** - * Required, type String. The user defined name of the project to be exported. - */ - public static final String PROJECT_NAME = "IJ2EEComponentExportDataModelProperties.PROJECT_NAME"; //$NON-NLS-1$ - - /** - * Required, type IPath. The user defined export location including fully qualified Path and archive file - * to be created name. - */ - public static final String ARCHIVE_DESTINATION = "IJ2EEComponentExportDataModelProperties.ARCHIVE_DESTINATION"; //$NON-NLS-1$ - /** - * Optional, type Boolean. If <code>Boolean.TRUE</code> source and class fields will both be archived and exported. - * Otherwise if <code>Boolean.FALSE</code> only output files are exported. - */ - public static final String EXPORT_SOURCE_FILES = "IJ2EEComponentExportDataModelProperties.EXPORT_SOURCE_FILES"; //$NON-NLS-1$ - /** - * Optional, type Boolean. If <code>Boolean.TRUE</code> and an archive with the same name exists in the - * ARCHIVE_DESTINATION, the existing will be overwritten by the archive to be created. Otherwise, - * if <code>Boolean.FALSE</code> a error message will be show indicating name collisions. - */ - public static final String OVERWRITE_EXISTING = "IJ2EEComponentExportDataModelProperties.OVERWRITE_EXISTING"; //$NON-NLS-1$ - /** - * Optional, type boolean, Default <code>Boolean.TRUE</code> indicating a Build runs before exporting thus output files are created - * and archived. However, if <code>Boolean.FALSE</code> the component is archived as is. - */ - public static final String RUN_BUILD = "IJ2EEComponentExportDataModelProperties.RUN_BUILD"; //$NON-NLS-1$} - - public static final String COMPONENT = "IJ2EEComponentExportDataModelProperties.COMPONENT"; //$NON-NLS-1$ - - /** - * @since 3.0 - */ - - public static final String OPTIMIZE_FOR_SPECIFIC_RUNTIME = "IJ2EEComponentExportDataModelProperties.OPTIMIZE_FOR_SPECIFIC_RUNTIME"; - - /** - * @since 3.0 - */ - - public static final String RUNTIME = "IJ2EEComponentExportDataModelProperties.RUNTIME"; //$NON-NLS-1 - - /** - * @since 3.0 - */ - - public static final String RUNTIME_SPECIFIC_PARTICIPANTS - = "IJ2EEComponentExportDataModelProperties.RUNTIME_SPECIFIC_PARTICIPANTS"; //$NON-NLS-1 - - /** - * @since 3.0 - */ - - interface IArchiveExportParticipantData - { - String getId(); - IArchiveExportParticipant getParticipant(); - IDataModel getDataModel(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentImportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentImportDataModelProperties.java deleted file mode 100644 index 645eeea06..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEComponentImportDataModelProperties.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.datamodel.properties; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties; - -/** - * <p> - * IJ2EEComponentImportDataModelProperties provides properties to the IDataModel associated with the - * J2EEComponentImportDataModelProvider as well as all extending interfaces extending - * IJ2EEComponentImportDataModelProperties specifically all J2EE component specific imports. - * - * NOTE: The associated Provider and Operations will be created during M5 - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ - -public interface IJ2EEComponentImportDataModelProperties extends IDataModelProperties { - - /** - * Required, type String, name of the file to be imported. - */ - public static final String FILE_NAME = "IJ2EEArtifactImportDataModelProperties.FILE_NAME"; //$NON-NLS-1$ - - /** - * Optional, type Archive, used when a file is available as an object rather than a url (i.e. - * using the FILE_NAME property will not work). - * @deprecated use {@link #ARCHIVE_WRAPPER} - */ - public static final String FILE = "IJ2EEArtifactImportDataModelProperties.FILE"; //$NON-NLS-1$ - /** - * Required, type String, name of the Project which the Archive will be imported. - */ - public static final String PROJECT_NAME = "IJ2EEComponentImportDataModelProperties.PROJECT_NAME"; //$NON-NLS-1$ - - /** - * Unsettable property used to retreive the component after the operation has executed. - */ - public static final String COMPONENT = "IJ2EEComponentImportDataModelProperties.COMPONENT"; //$NON-NLS-1$ - - /** - * Unsettable property used for archive switch. - */ - public static final String ARCHIVE_WRAPPER = "IJ2EEComponentImportDataModelProperties.ARCHIVE_WRAPPER"; //$NON-NLS-1$ - - - /** - * Optional, type IOverwriteHandler. Defines a IOverwriteHandler for the component in the - * workspace if an existing component should be overwritten (OVERWRITE_COMPONENT). - */ - public static final String OVERWRITE_HANDLER = "IJ2EEArtifactImportDataModelProperties.OVERWRITE_HANDLER"; //$NON-NLS-1$ - - /** - * Optional, type SaveFilter, default is null - * @deprecated - */ - public static final String SAVE_FILTER = "IJ2EEArtifactImportDataModelProperties.SAVE_FILTER"; //$NON-NLS-1$ - - /** - * Optional, type Boolean - Should the archive be closed on dispose? - */ - public static final String CLOSE_ARCHIVE_ON_DISPOSE = "IJ2EEArtifactImportDataModelProperties.closeArchiveOnDispose"; //$NON-NLS-1$ - /** - * Optional - type List, populated list of files previously selected. This can be used for GUIs - * which wish to show preivous selections. - */ - public static final String FILE_SELECTION_HISTORY = "IJ2EEArtifactImportDataModelProperties.FILE_SELECTION_HISTORY"; //$NON-NLS-1$ - /** - * Optional, type IDataModel. This IDataModel will have a J2EE specific component creation - * provider associated with it. - */ - public static final String NESTED_MODEL_J2EE_COMPONENT_CREATION = "IJ2EEArtifactImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEModuleImportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEModuleImportDataModelProperties.java deleted file mode 100644 index 25c1ca9e2..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEModuleImportDataModelProperties.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.datamodel.properties; - -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; - - -/** - * <p> - * IJ2EEModuleImportDataModelProperties provides properties to the IDataModel associated with the - * J2EEModuleImportDataModelProvider as well as all extending interfaces extending - * IJ2EEModuleImportDataModelProperties specifically all J2EE component specific imports. - * - * NOTE: The associated Provider and Operations will be created during M5 - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ -public interface IJ2EEModuleImportDataModelProperties extends IJ2EEComponentImportDataModelProperties { - - /** - * @deprecated use the {@link IJ2EEFacetProjectCreationDataModelProperties#EAR_PROJECT_NAME} on the nested project creation model - * - * @see DoNotUseMeThisWillBeDeletedPost15 - */ - public static final String EAR_COMPONENT_NAME = "IJ2EEModuleImportDataModelProperties.EAR_COMPONENT_NAME"; //$NON-NLS-1$ - /** - * @deprecated use the {@link IJ2EEFacetProjectCreationDataModelProperties#ADD_TO_EAR} on the nested project creation model - * - * @see DoNotUseMeThisWillBeDeletedPost15 - */ - public static final String ADD_TO_EAR = "IJ2EEModuleImportDataModelProperties.ADD_TO_EAR"; //$NON-NLS-1$ - - public static final String EXTENDED_IMPORT_FACTORY = "IJ2EEModuleImportDataModelProperties.EXTENDED_IMPORT_FACTORY"; //$NON-NLS-1$ - - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEUtilityJarListImportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEUtilityJarListImportDataModelProperties.java deleted file mode 100644 index d60cf433f..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJ2EEUtilityJarListImportDataModelProperties.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.datamodel.properties; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties; - -public interface IJ2EEUtilityJarListImportDataModelProperties extends IDataModelProperties{ - - /** - * Required. The EAR Project to which Utility Jars should be added. - */ - public static final String EAR_PROJECT_NAME = IJavaUtilityJarImportDataModelProperties.EAR_PROJECT_NAME; - - /** - * Optional. Boolean Property. True indicates to create a Project Can be used with - * LINK_IMPORT="true|"false" or BINARY_IMPORT="true|false" The default value is true. - */ - public static final String CREATE_PROJECT = "J2EEUtilityJarListImportDataModel.CREATE_PROJECT"; //$NON-NLS-1$ - - /** - * Optional. Boolean property. True indicates to import the jar as a linked project Can be - * specified with BINARY_IMPORT="true|false" and/or CREATE_PROJECT="true|false" The default - * value is false. - */ - public static final String LINK_IMPORT = "J2EEUtilityJarListImportDataModel.LINK_IMPORT"; //$NON-NLS-1$ - - /** - * Optional. Boolean Property. True indicates to create a Project Can be used with - * LINK_IMPORT="true|"false" or BINARY_IMPORT="true|false" The default value is true. - */ - public static final String CREATE_LINKED_PROJECT = "J2EEUtilityJarListImportDataModel.CREATE_LINKED_PROJECT"; //$NON-NLS-1$ - - /** - * Optional. Boolean property. True indicates to import the jar as a linked project Can be - * specified with BINARY_IMPORT="true|false" and/or CREATE_PROJECT="true|false" The default - * value is false. - */ - public static final String COPY = "J2EEUtilityJarListImportDataModel.COPY"; //$NON-NLS-1$ - - /** - * Optional. Boolean property. True indicates to import the jar as a binary project Can be - * specified with LINK_IMPORT="true|false" and/or CREATE_PROJECT="true|false" The default value - * is false. - */ - public static final String BINARY_IMPORT = "J2EEUtilityJarListImportDataModel.BINARY_IMPORT"; //$NON-NLS-1$ - - /** - * Required. A java.util.List of fully qualified file names for each Utility Jar that should be - * imported. - */ - public static final String UTILITY_JAR_LIST = "J2EEUtilityJarListImportDataModel.UTILITY_JAR_LIST"; //$NON-NLS-1$ - - public static final String AVAILABLE_JARS_DIRECTORY = "J2EEUtilityJarListImportDataModel.AVAILABLE_JARS_DIRECTORY"; //$NON-NLS-1$ - - public static final String PROJECT_ROOT = "J2EEUtilityJarListImportDataModel.PROJECT_ROOT"; //$NON-NLS-1$ - - public static final String OVERRIDE_PROJECT_ROOT = "J2EEUtilityJarListImportDataModel.OVERRIDE_PROJECT_ROOT"; //$NON-NLS-1$ - - public static final String OVERWRITE_IF_NECESSARY = "J2EEUtilityJarListImportDataModel.OVERWRITE_IF_NECESSARY"; //$NON-NLS-1$ - - public static final String CREATE_LINKED_PATH_VARIABLE = "J2EEUtilityJarListImportDataModel.CREATE_LINKED_PATH"; //$NON-NLS-1$ - - public static final String LINKED_PATH_VARIABLE = "J2EEUtilityJarListImportDataModel.LINKED_PATH_VARIABLE"; //$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJavaComponentCreationDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJavaComponentCreationDataModelProperties.java deleted file mode 100644 index dd037fd8d..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJavaComponentCreationDataModelProperties.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.datamodel.properties; - -import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.project.datamodel.properties.IJ2EEProjectServerTargetDataModelProperties; -import org.eclipse.wst.common.componentcore.datamodel.properties.IComponentCreationDataModelProperties; -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; - -/** - * <p> - * IJavaComponentCreationDataModelProperties provides properties to the - * JavaComponentCreationDataModelProvider as well as all extending interfaces extending - * IJavaComponentCreationDataModelProperties specifically, but not limited to all J2EE component related - * creation. - * @see org.eclipse.jst.j2ee.internal.archive.operations.JavaComponentCreationDataModelProvider - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ - -/** - * This has been slated for removal post WTP 1.5. Do not use this class/interface - * - * @deprecated - * - * @see IJavaFacetInstallDataModelProperties - */ -public interface IJavaComponentCreationDataModelProperties extends IComponentCreationDataModelProperties, DoNotUseMeThisWillBeDeletedPost15 { - /** - * Optional, type String - * String indicating the name of the the root Java Source Folder in the component being created. - * The DataModelProvider will default the Java Source Folder to the Component folder. - * - */ - public static final String JAVASOURCE_FOLDER = "IJavaComponentCreationDataModelProperties.JAVASOURCE_FOLDER"; - /** - * Optional, type String - * String indicating the name of the the root folder containing the Manifest.MF in the component being created. - * The DataModelProvider will default the Manifest folder to the Component folder/META-INF. - */ - public static final String MANIFEST_FOLDER = "IJavaComponentCreationDataModelProperties.MANIFEST_FOLDER"; - - /** - * Required, type String. This is used to specify the server target. - * - */ - public static final String RUNTIME_TARGET_ID = IJ2EEProjectServerTargetDataModelProperties.RUNTIME_TARGET_ID; -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJavaUtilityJarImportDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJavaUtilityJarImportDataModelProperties.java deleted file mode 100644 index a8570f94e..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/IJavaUtilityJarImportDataModelProperties.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.datamodel.properties; - -/** - * <p> - * IJavaUtilityJarImportDataModelProperties provides properties to the IDataModel associated with the - * JavaUtilityJarImportDataModelProvider. - * - * NOTE: The associated Provider and Operations will be created during M5 - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider - * @see org.eclipse.wst.common.frameworks.datamodel.DataModelFactory - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties - * - * @plannedfor 1.0 - */ -public interface IJavaUtilityJarImportDataModelProperties extends IJ2EEComponentImportDataModelProperties { - /** - * Required, type String. Represents the name of the Project containing the EAR component, which the utility - * jar will be added. - */ - public static final String EAR_PROJECT_NAME = "J2EEUtilityJarImportDataModel.EAR_PROJECT_NAME"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/package.xml b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/package.xml deleted file mode 100644 index 3bf43aad3..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/datamodel/properties/package.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<html> - <head> - <meta - name="root" - content="../../../../../../../" /> - <title>j2ee module common data model api overview</title> - </head> - - <body> - <abstract> - This package includes the api the common create, import and export j2ee modules. It also includes the enterprise application and applciation client creation, import and export api. The interfaces in this package - define the properties that can be set on the j2ee modules data models that are used to run the data model operations and drive the wizard data, validation. - </abstract> - - <a href="#top">top</a> - </body> -</html> -
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientArchiveTypeHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientArchiveTypeHandler.java deleted file mode 100644 index e839d8025..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientArchiveTypeHandler.java +++ /dev/null @@ -1,31 +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.j2ee.internal.archive; - -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveHandler; - -public class AppClientArchiveTypeHandler implements IArchiveHandler { - - public boolean handlesArchive(IArchive archive) { - if (archive.getLoadAdapter() instanceof AppClientComponentArchiveLoadAdapter) { - return true; - } else if (archive.containsArchiveResource(new Path(J2EEConstants.APP_CLIENT_DD_URI))) { - return true; - } else { - // TODO handle the no DD case - return false; - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientComponentArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientComponentArchiveLoadAdapter.java deleted file mode 100644 index 56387a5f7..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientComponentArchiveLoadAdapter.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class AppClientComponentArchiveLoadAdapter extends ComponentArchiveLoadAdapter { - - public AppClientComponentArchiveLoadAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - - @Override - protected IPath getDefaultModelObjectPath() { - return new Path(J2EEConstants.APP_CLIENT_DD_URI); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientComponentArchiveSaveAdapter.java deleted file mode 100644 index 632669faa..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/AppClientComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class AppClientComponentArchiveSaveAdapter extends J2EEComponentArchiveSaveAdapter { - - public AppClientComponentArchiveSaveAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveExportParticipantsExtensionPoint$PluginUtil.properties b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveExportParticipantsExtensionPoint$PluginUtil.properties deleted file mode 100644 index 24734903a..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveExportParticipantsExtensionPoint$PluginUtil.properties +++ /dev/null @@ -1,4 +0,0 @@ -missingAttribute = Extension element <{2}> is missing required attribute "{3}". [plugin: "{0}"; extension point: "{1}"] -missingElement = Extension element <{2}> is missing required child element <{3}>. [plugin: "{0}"; extension point: "{1}"] -failedToCreate = Failed to instantiate class {0}. -doesNotImplement = Class {0} does not implement {1} interface. diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveExportParticipantsExtensionPoint.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveExportParticipantsExtensionPoint.java deleted file mode 100644 index 7075a1e20..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveExportParticipantsExtensionPoint.java +++ /dev/null @@ -1,436 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005, 2007 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - ******************************************************************************/ - -package org.eclipse.jst.j2ee.internal.archive; - -import static org.eclipse.jst.j2ee.internal.archive.ArchiveExportParticipantsExtensionPoint.PluginUtil.*; -import static org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.*; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.expressions.EvaluationContext; -import org.eclipse.core.expressions.EvaluationResult; -import org.eclipse.core.expressions.Expression; -import org.eclipse.core.expressions.ExpressionConverter; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jst.j2ee.archive.IArchiveExportParticipant; -import org.eclipse.jst.j2ee.internal.archive.ArchiveExportParticipantsExtensionPoint.PluginUtil.InvalidExtensionException; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponentType; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponentVersion; -import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager; -import org.osgi.framework.Bundle; - -/** - * Contains the logic for processing the <code>org.eclipse.jst.j2ee.archiveExportParticipants</code> - * extension point. - * - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public final class ArchiveExportParticipantsExtensionPoint -{ - public static final String EXTENSION_POINT_ID = "archiveExportParticipants"; //$NON-NLS-1$ - - private static final String EL_PARTICIPANT = "participant"; //$NON-NLS-1$ - private static final String EL_RUNTIME_COMPONENT = "runtime-component"; //$NON-NLS-1$ - private static final String EL_FACTORY = "factory"; //$NON-NLS-1$ - private static final String EL_ENABLEMENT = "enablement"; - private static final String ATTR_ID = "id"; //$NON-NLS-1$ - private static final String ATTR_TYPE = "type"; //$NON-NLS-1$ - private static final String ATTR_VERSION = "version"; //$NON-NLS-1$ - private static final String ATTR_CLASS = "class"; //$NON-NLS-1$ - - private static List<ParticipantInfo> extensions = null; - - public static class ParticipantInfo - { - private String id; - private String pluginId = null; - private String className = null; - private IRuntimeComponentType runtimeComponentType = null; - private String runtimeComponentVersionExpr = null; - private Expression enablementCondition = null; - - public String getId() - { - return this.id; - } - - public IArchiveExportParticipant loadParticipant() - { - try - { - return instantiate( this.pluginId, this.className, IArchiveExportParticipant.class ); - } - catch( CoreException e ) - { - log( e.getStatus() ); - return null; - } - } - } - - public static List<ParticipantInfo> getExtensions( final IProject project, - final IRuntime runtime ) - { - readExtensions(); - - final List<ParticipantInfo> result = new ArrayList<ParticipantInfo>(); - - for( ParticipantInfo partInfo : extensions ) - { - boolean match = false; - - for( IRuntimeComponent rc : runtime.getRuntimeComponents() ) - { - final IRuntimeComponentType rct = rc.getRuntimeComponentType(); - - if( rct == partInfo.runtimeComponentType ) - { - final IRuntimeComponentVersion rcv = rc.getRuntimeComponentVersion(); - - try - { - if( rct.getVersions( partInfo.runtimeComponentVersionExpr ).contains( rcv ) ) - { - match = true; - break; - } - } - catch( CoreException e ) - { - logError( -1, e.getMessage(), e ); - } - } - } - - if( match && partInfo.enablementCondition != null ) - { - final EvaluationContext evalContext = new EvaluationContext( null, project ); - evalContext.setAllowPluginActivation( true ); - - try - { - final EvaluationResult evalResult - = partInfo.enablementCondition.evaluate( evalContext ); - - if( evalResult != EvaluationResult.TRUE ) - { - match = false; - } - } - catch( CoreException e ) - { - logError( -1, e.getMessage(), e ); - } - } - - if( match ) - { - result.add( partInfo ); - } - } - - return Collections.unmodifiableList( result ); - } - - private static synchronized void readExtensions() - { - if( extensions != null ) - { - return; - } - - extensions = new ArrayList<ParticipantInfo>(); - - for( IConfigurationElement element - : getTopLevelElements( findExtensions( PLUGIN_ID, EXTENSION_POINT_ID ) ) ) - { - if( element.getName().equals( EL_PARTICIPANT ) ) - { - try - { - readExtension( element ); - } - catch( InvalidExtensionException e ) - { - // Continue. The problem has been reported to the user via the log. - } - } - } - } - - private static void readExtension( final IConfigurationElement config ) - - throws InvalidExtensionException - - { - final ParticipantInfo info = new ParticipantInfo(); - - info.pluginId = config.getContributor().getName(); - info.id = info.pluginId + "." + findRequiredAttribute( config, ATTR_ID ); - - final IConfigurationElement elFactory = findRequiredElement( config, EL_FACTORY ); - info.className = findRequiredAttribute( elFactory, ATTR_CLASS ); - - final IConfigurationElement elRuntimeComponent - = findRequiredElement( config, EL_RUNTIME_COMPONENT ); - - final String rcTypeString = findRequiredAttribute( elRuntimeComponent, ATTR_TYPE ); - - if( ! RuntimeManager.isRuntimeComponentTypeDefined( rcTypeString ) ) - { - // TODO: Log the problem - throw new InvalidExtensionException(); - } - - info.runtimeComponentType = RuntimeManager.getRuntimeComponentType( rcTypeString ); - info.runtimeComponentVersionExpr = elRuntimeComponent.getAttribute( ATTR_VERSION ); - - final IConfigurationElement elEnablement = findOptionalElement( config, EL_ENABLEMENT ); - - try - { - info.enablementCondition = ExpressionConverter.getDefault().perform( elEnablement ); - } - catch( CoreException e ) - { - logError( -1, e.getMessage(), e ); - throw new InvalidExtensionException(); - } - - extensions.add( info ); - } - - /** - * Utility methods that are helpful for implementing extension points. - * - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - - public static final class PluginUtil - { - public static final class InvalidExtensionException - - extends Exception - - { - private static final long serialVersionUID = 1L; - } - - private PluginUtil() {} - - public static Collection<IExtension> findExtensions( final String pluginId, - final String extensionPointId ) - { - final IExtensionRegistry registry = Platform.getExtensionRegistry(); - final IExtensionPoint point = registry.getExtensionPoint( pluginId, extensionPointId ); - - if( point == null ) - { - throw new RuntimeException(); - } - - final List<IExtension> extensions = new ArrayList<IExtension>(); - - for( IExtension extension : point.getExtensions() ) - { - extensions.add( extension ); - } - - return extensions; - } - - public static Collection<IConfigurationElement> getTopLevelElements( final Collection<IExtension> extensions ) - { - final List<IConfigurationElement> elements = new ArrayList<IConfigurationElement>(); - - for( IExtension extension : extensions ) - { - for( IConfigurationElement element : extension.getConfigurationElements() ) - { - elements.add( element ); - } - } - - return elements; - } - - public static void reportMissingAttribute( final IConfigurationElement el, - final String attribute ) - { - final String pluginId = el.getContributor().getName(); - final String extPointId = el.getDeclaringExtension().getExtensionPointUniqueIdentifier(); - - final String msg - = Resources.bind( Resources.missingAttribute, pluginId, extPointId, el.getName(), - attribute ); - - log( createErrorStatus( -1, msg, null ) ); - } - - public static void reportMissingElement( final IConfigurationElement el, - final String element ) - { - final String pluginId = el.getContributor().getName(); - final String extPointId = el.getDeclaringExtension().getExtensionPointUniqueIdentifier(); - - final String msg - = Resources.bind( Resources.missingElement, pluginId, extPointId, el.getName(), - element ); - - log( createErrorStatus( -1, msg, null ) ); - } - - public static String findRequiredAttribute( final IConfigurationElement el, - final String attribute ) - - throws InvalidExtensionException - - { - final String val = el.getAttribute( attribute ); - - if( val == null ) - { - reportMissingAttribute( el, attribute ); - throw new InvalidExtensionException(); - } - - return val; - } - - public static IConfigurationElement findRequiredElement( final IConfigurationElement el, - final String childElement ) - - throws InvalidExtensionException - - { - final IConfigurationElement[] children = el.getChildren( childElement ); - - if( children.length == 0 ) - { - reportMissingElement( el, childElement ); - throw new InvalidExtensionException(); - } - - return children[ 0 ]; - } - - public static IConfigurationElement findOptionalElement( final IConfigurationElement el, - final String childElement ) - { - final IConfigurationElement[] children = el.getChildren( childElement ); - - if( children.length == 0 ) - { - return null; - } - else - { - return children[ 0 ]; - } - } - - public static String getElementValue( final IConfigurationElement el, - final String defaultValue ) - { - if( el != null ) - { - String text = el.getValue(); - - if( text != null ) - { - text = text.trim(); - - if( text.length() > 0 ) - { - return text; - } - } - } - - return defaultValue; - } - - @SuppressWarnings( "unchecked" ) - public static <T> T instantiate( final String pluginId, - final String clname, - final Class<T> interfc ) - - throws CoreException - - { - final Bundle bundle = Platform.getBundle( pluginId ); - - final Object obj; - - try - { - final Class cl = bundle.loadClass( clname ); - obj = cl.newInstance(); - } - catch( Exception e ) - { - final String msg = NLS.bind( Resources.failedToCreate, clname ); - throw new CoreException( createErrorStatus( -1, msg, e ) ); - } - - if( ! interfc.isAssignableFrom( obj.getClass() ) ) - { - final String msg - = NLS.bind( Resources.doesNotImplement, clname, interfc.getClass().getName() ); - - throw new CoreException( createErrorStatus( -1, msg, null ) ); - } - - return (T) obj; - } - - private static final class Resources - - extends NLS - - { - public static String missingAttribute; - public static String missingElement; - public static String failedToCreate; - public static String doesNotImplement; - - static - { - initializeMessages( PluginUtil.class.getName(), Resources.class ); - } - - public static String bind( final String message, - final String arg1, - final String arg2, - final String arg3, - final String arg4 ) - { - return bind( message, new Object[] { arg1, arg2, arg3, arg4 } ); - } - } - - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveWrapper.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveWrapper.java deleted file mode 100644 index 54ed138cb..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ArchiveWrapper.java +++ /dev/null @@ -1,573 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.j2ee.internal.archive; - -import java.io.FileNotFoundException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.FileImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.archive.operations.EARArchiveOpsResourceHandler; -import org.eclipse.jst.javaee.application.Application; -import org.eclipse.jst.javaee.application.Module; -import org.eclipse.jst.jee.archive.ArchiveModelLoadException; -import org.eclipse.jst.jee.archive.ArchiveOpenFailureException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; - -public class ArchiveWrapper { - - //TODO remove commonArchive; possibly remove this entire class and - //code directly to IArchive - private Archive commonArchive = null; - private IArchive archive = null; - private JavaEEQuickPeek jqp = null; - - public ArchiveWrapper(IArchive archive) { - this.archive = archive; - JavaEEArchiveUtilities jea = JavaEEArchiveUtilities.INSTANCE; - jqp = jea.getJavaEEQuickPeek(archive); - } - - public ArchiveWrapper(Archive mFile) { - this.commonArchive = mFile; - int type = J2EEConstants.UNKNOWN; - - if (mFile.isApplicationClientFile()) { - type = J2EEConstants.APPLICATION_CLIENT_TYPE; - } else if (mFile.isEARFile()) { - type = J2EEConstants.APPLICATION_TYPE; - } else if (mFile.isEJBJarFile()) { - type = J2EEConstants.EJB_TYPE; - } else if (mFile.isWARFile()) { - type = J2EEConstants.WEB_TYPE; - } else if (mFile.isRARFile()) { - type = J2EEConstants.CONNECTOR_TYPE; - } - if (type != J2EEConstants.UNKNOWN) { - int version = ArchiveUtil.getFastSpecVersion((ModuleFile) mFile); - jqp = new JavaEEQuickPeek(type, version); - } else { - jqp = new JavaEEQuickPeek(null); - } - } - - public JavaEEQuickPeek getJavaEEQuickPeek() { - return jqp; - } - - public Archive getCommonArchive() { - return (Archive) commonArchive; - } - - public Object getUnderLyingArchive() { - if (archive != null) { - return archive; - } - if (commonArchive != null) { - return commonArchive; - } - fail(); - return null; - } - - private ArchiveWrapper cachedParent = null; - - public ArchiveWrapper getParent() { - if (null != cachedParent) { - return cachedParent; - } - if (archive != null) { - cachedParent = new ArchiveWrapper(archive.getArchive()); - return cachedParent; - } - if (commonArchive != null) { - cachedParent = new ArchiveWrapper((Archive) commonArchive.eContainer()); - return cachedParent; - } - fail(); - return null; - } - - public IArchive getIArchive() { - return archive; - } - - public void close() { - try { - if (commonArchive != null) { - commonArchive.close(); - } - if (archive != null) { - JavaEEArchiveUtilities.INSTANCE.closeArchive(archive); - } - } catch (RuntimeException e) { - Logger.getLogger().logError(e); - throw e; - } - } - - public IPath getPath() { - if (commonArchive != null) { - IPath path = new Path(commonArchive.getURI()); - return path; - } - if (archive != null) { - return archive.getPath(); - } - fail(); - return null; - } - - private void fail() { - throw new RuntimeException("ArchiveWrapper is inconsistent."); - } - - public int getSize() { - if (commonArchive != null) - return commonArchive.getFiles().size(); - else - return archive.getArchiveResources().size(); - } - - private List<ArchiveWrapper> cachedWebLibs; - - public List<ArchiveWrapper> getWebLibs() { - if (cachedWebLibs != null) { - return cachedWebLibs; - } - if (jqp.getType() != J2EEVersionConstants.WEB_TYPE) { - fail(); - } - - cachedWebLibs = new ArrayList<ArchiveWrapper>(); - - if (commonArchive != null) { - WARFile war = (WARFile) commonArchive; - List libs = war.getLibArchives(); - for (int i = 0; i < libs.size(); i++) { - cachedWebLibs.add(new ArchiveWrapper((Archive) libs.get(i))); - } - return cachedWebLibs; - } - if (archive != null) { - List<IArchiveResource> resources = archive.getArchiveResources(); - for (IArchiveResource resource : resources) { - if (resource.getType() != IArchiveResource.DIRECTORY_TYPE) { - IPath path = resource.getPath(); - if (path.segmentCount() > 2) { - if (path.segment(0).equals("WEB-INF") && path.segment(1).equals("lib")) { - String lastSegment = path.lastSegment(); - if (lastSegment.endsWith("jar") || lastSegment.endsWith("zip")) { - IArchive webLib; - try { - webLib = archive.getNestedArchive(resource); - cachedWebLibs.add(new ArchiveWrapper(webLib)); - } catch (ArchiveOpenFailureException e) { - Logger.getLogger().logError(e); - } - } - } - } - } - } - return cachedWebLibs; - } - fail(); - return null; - } - - private List <String>cachedDDMappedModuleURIs = null; - - public List<String> getDDMappedModuleURIs() { - if(cachedDDMappedModuleURIs != null){ - return cachedDDMappedModuleURIs; - } - if (jqp.getType() != J2EEVersionConstants.APPLICATION_TYPE) { - fail(); - } - - cachedDDMappedModuleURIs = new ArrayList<String>(); - - if (commonArchive != null) { - EARFile ear = (EARFile) commonArchive; - List earMods = ear.getModuleFiles(); - for (int i = 0; i < earMods.size(); i++) { - cachedDDMappedModuleURIs.add(((Archive) earMods.get(i)).getURI()); - } - return cachedDDMappedModuleURIs; - } else if(archive != null) { - if(archive.containsArchiveResource(new Path(J2EEConstants.APPLICATION_DD_URI))){ - if(jqp.getJavaEEVersion() == JavaEEQuickPeek.JEE_5_0_ID){ - try { - Application application = (Application) archive.getModelObject(); - List modules = application.getModules(); - for(int i=0;i<modules.size();i++){ - Module module = (Module)modules.get(i); - String uri = module.getUri(); - cachedDDMappedModuleURIs.add(uri); - } - } catch (ArchiveModelLoadException e) { - Logger.getLogger().logError(e); - } - } else { - try{ - org.eclipse.jst.j2ee.application.Application application = (org.eclipse.jst.j2ee.application.Application)archive.getModelObject(); - List modules = application.getModules(); - for(int i=0;i<modules.size();i++){ - org.eclipse.jst.j2ee.application.Module module = (org.eclipse.jst.j2ee.application.Module)modules.get(i); - String uri = module.getUri(); - cachedDDMappedModuleURIs.add(uri); - } - }catch (ArchiveModelLoadException e) { - Logger.getLogger().logError(e); - } - } - } - } - return cachedDDMappedModuleURIs; - } - - - private List<ArchiveWrapper> cachedEARModules; - - public List<ArchiveWrapper> getEarModules() { - if (cachedEARModules != null) { - return cachedEARModules; - } - if (jqp.getType() != J2EEVersionConstants.APPLICATION_TYPE) { - fail(); - } - cachedEARModules = new ArrayList<ArchiveWrapper>(); - - if (commonArchive != null) { - EARFile ear = (EARFile) commonArchive; - List earMods = ear.getModuleFiles(); - for (int i = 0; i < earMods.size(); i++) { - cachedEARModules.add(new ArchiveWrapper((Archive) earMods.get(i))); - } - return cachedEARModules; - } - if (archive != null) { - List<IArchiveResource> resources = archive.getArchiveResources(); - for (IArchiveResource resource : resources) { - if (resource.getType() != IArchiveResource.DIRECTORY_TYPE) { - IPath path = resource.getPath(); - if (path.segmentCount() > 0) { - String lastSegment = path.lastSegment(); - if (lastSegment.endsWith("jar") || lastSegment.endsWith("zip") || lastSegment.endsWith("rar") || lastSegment.endsWith("war")) { - IArchive earmodule; - try { - earmodule = archive.getNestedArchive(resource); - cachedEARModules.add(new ArchiveWrapper(earmodule)); - } catch (ArchiveOpenFailureException e) { - Logger.getLogger().logError(e); - } - } - } - } - } - return cachedEARModules; - } - fail(); - return null; - } - - public String getName() { - if (commonArchive != null) { - return commonArchive.getName(); - } - if (archive != null) { - return archive.getPath().lastSegment(); - } - fail(); - return null; - } - - public boolean isModule() { - if (isApplicationClientFile()) { - return true; - } - if (isWARFile()) { - return true; - } - if (isEJBJarFile()) { - return true; - } - if (isRARFile()) { - return true; - } - return false; - } - - public boolean isApplicationClientFile() { - if (commonArchive != null) - return commonArchive.isApplicationClientFile(); - if (archive != null) - return (JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archive).getType() == J2EEConstants.APPLICATION_CLIENT_TYPE); - fail(); - return false; - } - - public boolean isWARFile() { - if (commonArchive != null) - return commonArchive.isWARFile(); - if (archive != null) - return (JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archive).getType() == J2EEConstants.WEB_TYPE); - fail(); - return false; - } - - public boolean isEJBJarFile() { - if (commonArchive != null) - return commonArchive.isEJBJarFile(); - if (archive != null) - return (JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archive).getType() == J2EEConstants.EJB_TYPE); - fail(); - return false; - } - - public boolean isEarFile() { - if (commonArchive != null) - return commonArchive.isEARFile(); - if (archive != null) - return (JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archive).getType() == J2EEConstants.APPLICATION_TYPE); - fail(); - return false; - } - - public boolean isRARFile() { - if (commonArchive != null) - return commonArchive.isRARFile(); - if (archive != null) - return (JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archive).getType() == J2EEConstants.CONNECTOR_TYPE); - fail(); - return false; - } - - // This is an array so we can tell the difference between initialized and null vs not initialized - private String[] cachedWebContextRoot = null; - - public String getWebContextRoot() { - if (cachedWebContextRoot != null) { - return cachedWebContextRoot[0]; - } - - if (!isWARFile()) { - fail(); - return null; - } - cachedWebContextRoot = new String[1]; - - if (commonArchive != null) { - cachedWebContextRoot[0] = ((WebModule) ((EARFile) commonArchive.getContainer()).getModule(commonArchive.getURI(), null)).getContextRoot(); - return cachedWebContextRoot[0]; - } - if (archive != null) { - IArchive earArchive = archive.getArchive(); - if(earArchive.containsArchiveResource(new Path(J2EEConstants.APPLICATION_DD_URI))){ - JavaEEQuickPeek earJQP = JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(earArchive); - if(earJQP.getJavaEEVersion() == JavaEEQuickPeek.JEE_5_0_ID){ - try { - Application application = (Application) earArchive.getModelObject(); - String moduleName = archive.getPath().toString(); - Module module = (Module) application.getFirstModule(moduleName); - if(module != null){ - cachedWebContextRoot[0] = module.getWeb().getContextRoot(); - } else { - cachedWebContextRoot[0] = getDefaultContextRoot(); - } - } catch (ArchiveModelLoadException e) { - Logger.getLogger().logError(e); - } - } else { - try{ - org.eclipse.jst.j2ee.application.Application application = (org.eclipse.jst.j2ee.application.Application)earArchive.getModelObject(); - String moduleName = archive.getPath().toString(); - org.eclipse.jst.j2ee.application.WebModule module = (org.eclipse.jst.j2ee.application.WebModule)application.getFirstModule(moduleName); - if(module == null){ - cachedWebContextRoot[0] = null; - } else { - cachedWebContextRoot[0] = module.getContextRoot(); - } - } catch (ArchiveModelLoadException e) { - Logger.getLogger().logError(e); - } - } - } else { - cachedWebContextRoot[0] = getDefaultContextRoot(); - } - return cachedWebContextRoot[0]; - } - fail(); - return null; - } - - private String getDefaultContextRoot() { - //J2EE spec 8.3.1.3.c (pg 149) - String contextRoot = archive.getPath().toString(); - contextRoot = contextRoot.substring(0, contextRoot.lastIndexOf('.')); - return contextRoot; - } - - // This is an array so we can tell the difference between initialized and null vs not initialized - private HashMap<ArchiveWrapper, ArchiveWrapper> cachedEJBClientArchiveWrapper = null; - - public ArchiveWrapper getEJBClientArchiveWrapper(ArchiveWrapper ejbWrapper) { - if (cachedEJBClientArchiveWrapper == null) { - cachedEJBClientArchiveWrapper = new HashMap<ArchiveWrapper, ArchiveWrapper>(); - } - - if(cachedEJBClientArchiveWrapper.containsKey(ejbWrapper)){ - return cachedEJBClientArchiveWrapper.get(ejbWrapper); - } - - - if (!ejbWrapper.isEJBJarFile() || !isEarFile()) { - fail(); - return null; - } - - ArchiveWrapper ejbClientArchiveWrapper = null; - try{ - if (commonArchive != null) { - try { - EJBJar jar = ((EJBJarFile) ejbWrapper.getUnderLyingArchive()).getDeploymentDescriptor(); - if (jar != null) { - if (jar.getEjbClientJar() != null) { - String clientName = jar.getEjbClientJar(); - ejbClientArchiveWrapper = new ArchiveWrapper((Archive) ((EARFile) commonArchive).getFile(clientName)); - } - } - return ejbClientArchiveWrapper; - } catch (FileNotFoundException e) { - Logger.getLogger().logError(e); - } - } - if (archive != null) { - try { - JavaEEQuickPeek jqp = JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(ejbWrapper.archive); - String clientJarName = null; - if(jqp.getVersion() == J2EEVersionConstants.EJB_3_0_ID){ - if(ejbWrapper.archive.containsArchiveResource(new Path(J2EEConstants.EJBJAR_DD_URI))){ - org.eclipse.jst.javaee.ejb.EJBJar edd = (org.eclipse.jst.javaee.ejb.EJBJar) ejbWrapper.archive.getModelObject(); - clientJarName = edd.getEjbClientJar(); - } - } else { - EJBJar jar = (EJBJar)ejbWrapper.archive.getModelObject(); - if (jar != null) { - clientJarName = jar.getEjbClientJar(); - } - } - - if (null != clientJarName) { - IPath clientJarPath = new Path(clientJarName); - if(archive.containsArchiveResource(clientJarPath)){ - IArchiveResource clientJar = archive.getArchiveResource(clientJarPath); - if(null != clientJar){ - if (clientJar.getType() == IArchiveResource.ARCHIVE_TYPE) { - ejbClientArchiveWrapper = new ArchiveWrapper((IArchive) clientJar); - } else { - try { - ejbClientArchiveWrapper = new ArchiveWrapper(archive.getNestedArchive(clientJar)); - } catch (ArchiveOpenFailureException e) { - Logger.getLogger().logError(e); - } - } - } - } else { - Logger.getLogger().logWarning(EARArchiveOpsResourceHandler.bind(EARArchiveOpsResourceHandler.MISSING_CLIENT_JAR, new Object[] {clientJarName, ejbWrapper.getName(), archive.getPath()})); - } - } - return ejbClientArchiveWrapper; - } catch (FileNotFoundException e) { - Logger.getLogger().logError(e); - } catch (ArchiveModelLoadException e) { - Logger.getLogger().logError(e); - } - } - } finally { - cachedEJBClientArchiveWrapper.put(ejbWrapper, ejbClientArchiveWrapper); - } - fail(); - return null; - } - - private List<ArchiveWrapper> cachedEARUtilitiesAndWebLibs = null; - - public List<ArchiveWrapper> getEARUtilitiesAndWebLibs() { - if (null != cachedEARUtilitiesAndWebLibs) { - return cachedEARUtilitiesAndWebLibs; - } - - if (!isEarFile()) { - fail(); - return null; - } - - cachedEARUtilitiesAndWebLibs = new ArrayList<ArchiveWrapper>(); - if (commonArchive != null) { - List files = commonArchive.getFiles(); - for (int i = 0; i < files.size(); i++) { - FileImpl file = (FileImpl) files.get(i); - if (file.isArchive() && !file.isModuleFile() && file.getURI().endsWith(".jar")) { //$NON-NLS-1$ - cachedEARUtilitiesAndWebLibs.add(new ArchiveWrapper((Archive) file)); - } - if (file.isWARFile()) { - ArchiveWrapper wrapper = new ArchiveWrapper((Archive) file); - cachedEARUtilitiesAndWebLibs.addAll(wrapper.getWebLibs()); - } - } - return cachedEARUtilitiesAndWebLibs; - } - if (archive != null) { - List files = archive.getArchiveResources(); - for (int i = 0; i < files.size(); i++) { - IArchiveResource file = (IArchiveResource) files.get(i); - String lastSegment = file.getPath().lastSegment(); - if (lastSegment.endsWith(".jar") || lastSegment.endsWith(".rar") || lastSegment.endsWith(".war") || lastSegment.endsWith("zip")) { - IArchive nestedArchive; - try { - nestedArchive = archive.getNestedArchive(file); - ArchiveWrapper nestedWrapper = new ArchiveWrapper(nestedArchive); - if (nestedWrapper.isWARFile()) { - cachedEARUtilitiesAndWebLibs.addAll(nestedWrapper.getWebLibs()); - } else if (!nestedWrapper.isModule()) { - cachedEARUtilitiesAndWebLibs.add(nestedWrapper); - } - } catch (ArchiveOpenFailureException e) { - Logger.getLogger().logError(e); - } - } - } - return cachedEARUtilitiesAndWebLibs; - - } - fail(); - return null; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ComponentArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ComponentArchiveLoadAdapter.java deleted file mode 100644 index 3ab350983..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ComponentArchiveLoadAdapter.java +++ /dev/null @@ -1,672 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; - -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.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.archive.operations.EARArchiveOpsResourceHandler; -import org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyManifestUtil; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.jee.archive.AbstractArchiveLoadAdapter; -import org.eclipse.jst.jee.archive.ArchiveModelLoadException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveLoadAdapter; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.jst.jee.archive.internal.ArchiveURIConverter; -import org.eclipse.wst.common.componentcore.UnresolveableURIException; -import org.eclipse.wst.common.componentcore.internal.ComponentResource; -import org.eclipse.wst.common.componentcore.internal.DependencyType; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualContainer; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.componentcore.resources.IVirtualResource; - -public abstract class ComponentArchiveLoadAdapter extends AbstractArchiveLoadAdapter { - - protected static final String DOT_SQLJ = ".sqlj"; //$NON-NLS-1$ - - protected static final String DOT_JSP = ".jsp"; //$NON-NLS-1$ - - protected static final String DOT_PROJECT = ".project"; //$NON-NLS-1$ - - protected static final String DOT_CLASSPATH = ".classpath"; //$NON-NLS-1$ - - protected static final String DOT_SETTINGS = ".settings"; //$NON-NLS-1$ - - protected static final String DOT_CVS_IGORE = ".cvsignore"; //$NON-NLS-1$ - - protected IVirtualComponent vComponent; - - protected boolean exportSource = true; - - private List zipFiles = new ArrayList(); - - private List javaClasspathURIs = new ArrayList(); - - protected boolean includeClasspathComponents = true; - - protected class FilesHolder { - - private Map pathsToArchiveResources = new HashMap(); - - private Map pathsToWorkbenchResources = new HashMap(); - - private Map workbenchResourcesToPaths = new HashMap(); - - private Map pathsToDiskFiles; - - private Map pathsToZipEntry = new HashMap(); - - public void removeIFile(IFile file) { - IPath path = (IPath) workbenchResourcesToPaths.get(file); - remove(path); - } - - public void remove(IPath path) { - pathsToArchiveResources.remove(path); - Object resource = pathsToWorkbenchResources.remove(path); - if (resource != null) { - workbenchResourcesToPaths.remove(resource); - } - if (pathsToDiskFiles != null) { - pathsToDiskFiles.remove(path); - } - } - - public void addFile(IArchiveResource file) { - IPath path = file.getPath(); - pathsToArchiveResources.put(path, file); - } - - public void addFile(IArchiveResource file, java.io.File externalDiskFile) { - IPath path = file.getPath(); - pathsToArchiveResources.put(path, file); - if (null == pathsToDiskFiles) { - pathsToDiskFiles = new HashMap(); - } - pathsToDiskFiles.put(path, externalDiskFile); - } - - public void addFile(IArchiveResource file, IResource resource) { - IPath path = file.getPath(); - pathsToArchiveResources.put(path, file); - pathsToWorkbenchResources.put(path, resource); - } - - public InputStream getInputStream(IPath path) throws IOException, FileNotFoundException { - java.io.File diskFile = null; - - if (pathsToDiskFiles != null && pathsToDiskFiles.containsKey(path)) { - diskFile = (java.io.File) pathsToDiskFiles.get(path); - } else if (pathsToWorkbenchResources != null && pathsToWorkbenchResources.containsKey(path)) { - IResource resource = (IResource) pathsToWorkbenchResources.get(path); - diskFile = new java.io.File(resource.getLocation().toOSString()); - } - if (diskFile != null) { - return new FileInputStream(diskFile); - } else if (pathsToZipEntry.containsKey(path)) { - Map fileURIMap = (Map) pathsToZipEntry.get(path); - Iterator it = fileURIMap.keySet().iterator(); - - String sourceFileUri = ""; //$NON-NLS-1$ - ZipFile zipFile = null; - - // there is only one key, pair - while (it.hasNext()) { - sourceFileUri = (String) it.next(); - zipFile = (ZipFile) fileURIMap.get(sourceFileUri); - } - ZipEntry entry = zipFile.getEntry(sourceFileUri); - InputStream in = zipFile.getInputStream(entry); - return in; - } else { - IArchiveResource res = getArchiveResource(path); - return ComponentArchiveLoadAdapter.this.getSuperInputStream(res); - } - } - - public List<IArchiveResource> getFiles() { - return new ArrayList<IArchiveResource>(pathsToArchiveResources.values()); - } - - public boolean contains(IPath path) { - return pathsToArchiveResources.containsKey(path); - } - - public IArchiveResource getArchiveResource(IPath path) { - return (IArchiveResource) pathsToArchiveResources.get(path); - } - - public void addEntry(ZipEntry entry, ZipFile zipFile, IPath runtimePath) { - if (runtimePath != null) { - if (!runtimePath.equals("/")) //$NON-NLS-1$ - runtimePath = runtimePath.append(entry.getName()); - else - runtimePath = new Path(entry.getName()); - } else { - runtimePath = new Path(entry.getName()); - } - - IArchiveResource file = createFile(runtimePath); - - Map fileURIMap = new HashMap(); - fileURIMap.put(entry.getName(), zipFile); - - pathsToZipEntry.put(file.getPath(), fileURIMap); - pathsToArchiveResources.put(file.getPath(), file); - } - } - - protected FilesHolder filesHolder; - - private IVirtualFile manifestFile = null; - - public ComponentArchiveLoadAdapter(IVirtualComponent vComponent) { - this(vComponent, true); - } - - public ComponentArchiveLoadAdapter(IVirtualComponent vComponent, boolean includeClasspathComponents) { - this.vComponent = vComponent; - filesHolder = new FilesHolder(); - setIncludeClasspathComponents(includeClasspathComponents); - } - - public void setIncludeClasspathComponents(boolean includeClasspathComponents) { - this.includeClasspathComponents = includeClasspathComponents; - if (includeClasspathComponents) { - this.manifestFile = vComponent.getRootFolder().getFile(new Path(J2EEConstants.MANIFEST_URI)); - saveJavaClasspathReferences(); - } else { - this.manifestFile = null; - javaClasspathURIs.clear(); - } - } - - public IArchiveResource getArchiveResource(IPath resourcePath) throws FileNotFoundException { - initArchiveResources(); - return filesHolder.getArchiveResource(resourcePath); - } - - public boolean containsArchiveResource(IPath path) { - initArchiveResources(); - return filesHolder.contains(path); - } - - protected boolean archiveResourcesInitialized = false; - - protected void initArchiveResources() { - if (!archiveResourcesInitialized) { - archiveResourcesInitialized = true; - aggregateSourceFiles(); - aggregateClassFiles(); - addUtilities(); - } - } - - public List<IArchiveResource> getArchiveResources() { - - initArchiveResources(); - return filesHolder.getFiles(); - } - - protected void saveJavaClasspathReferences() { - if (vComponent instanceof J2EEModuleVirtualComponent) { - final J2EEModuleVirtualComponent j2eeComp = (J2EEModuleVirtualComponent) vComponent; - final IVirtualReference[] refs = j2eeComp.getJavaClasspathReferences(); - if (refs == null) { - return; - } - for (int i = 0; i < refs.length; i++) { - if (refs[i].getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - javaClasspathURIs.add(refs[i].getArchiveName()); - } - } - } - } - - protected void addUtilities() { - IVirtualReference[] components = vComponent.getReferences(); - for (int i = 0; i < components.length; i++) { - IVirtualReference reference = components[i]; - IVirtualComponent referencedComponent = reference.getReferencedComponent(); - - if (referencedComponent.isBinary() && reference.getDependencyType() == DependencyType.CONSUMES) { - java.io.File diskFile = ((VirtualArchiveComponent) referencedComponent).getUnderlyingDiskFile(); - ZipFile zipFile; - IPath path = reference.getRuntimePath(); - try { - zipFile = new ZipFile(diskFile); - zipFiles.add(zipFile); - Enumeration enumeration = zipFile.entries(); - while (enumeration.hasMoreElements()) { - ZipEntry entry = (ZipEntry) enumeration.nextElement(); - filesHolder.addEntry(entry, zipFile, path); - } - } catch (ZipException e) { - Logger.getLogger().logError(e); - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - } - } - - /** - * This is a cache of the IResource roots for all java source folders and is - * used by {@link #inJavaSrc(IVirtualResource)}. - */ - private IResource[] sourceRoots = null; - - protected void aggregateSourceFiles() { - try { - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualResource[] members = rootFolder.members(); - IPackageFragmentRoot[] srcPkgs = J2EEProjectUtilities.getSourceContainers(vComponent.getProject()); - sourceRoots = new IResource[srcPkgs.length]; - for (int i = 0; i < srcPkgs.length; i++) { - sourceRoots[i] = srcPkgs[i].getCorrespondingResource(); - } - inJavaSrc = false; - aggregateFiles(members); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } - - protected void aggregateClassFiles() { - StructureEdit se = null; - try { - IPackageFragmentRoot[] sourceRoots = J2EEProjectUtilities.getSourceContainers(vComponent.getProject()); - se = StructureEdit.getStructureEditForRead(vComponent.getProject()); - for (int i = 0; i < sourceRoots.length; i++) { - IPath outputPath = sourceRoots[i].getRawClasspathEntry().getOutputLocation(); - if (outputPath == null) { - IProject project = vComponent.getProject(); - if (project.hasNature(JavaCore.NATURE_ID)) { - IJavaProject javaProject = JavaCore.create(project); - outputPath = javaProject.getOutputLocation(); - } - } - - if (outputPath != null) { - IContainer javaOutputContainer = outputPath.segmentCount() > 1 ? (IContainer) ResourcesPlugin.getWorkspace().getRoot().getFolder(outputPath) : (IContainer) ResourcesPlugin - .getWorkspace().getRoot().getProject(outputPath.lastSegment()); - IPath runtimePath = null; - try { - ComponentResource[] componentResources = se.findResourcesBySourcePath(sourceRoots[i].getResource().getProjectRelativePath()); - if (componentResources.length > 0) { - IPath tmpRuntimePath = componentResources[0].getRuntimePath(); - IPath tmpSourcePath = componentResources[0].getSourcePath(); - if (!tmpRuntimePath.equals(tmpSourcePath)) { - while (tmpSourcePath.segmentCount() > 0 && tmpRuntimePath.segmentCount() > 0 && tmpRuntimePath.lastSegment().equals(tmpSourcePath.lastSegment())) { - tmpRuntimePath = tmpRuntimePath.removeLastSegments(1); - tmpSourcePath = tmpSourcePath.removeLastSegments(1); - } - if (tmpRuntimePath.segmentCount() != 0) { - runtimePath = tmpRuntimePath.makeRelative(); - } - } - } - } catch (UnresolveableURIException e) { - Logger.getLogger().logError(e); - } - if (null == runtimePath) { - runtimePath = new Path(""); //$NON-NLS-1$ - } - - aggregateOutputFiles(new IResource[] { javaOutputContainer }, runtimePath, javaOutputContainer.getProjectRelativePath().segmentCount()); - } - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } finally { - if (se != null) { - se.dispose(); - } - } - } - - protected boolean aggregateOutputFiles(IResource[] resources, final IPath runtimePathPrefix, int outputFolderSegmentCount) throws CoreException { - boolean fileAdded = false; - for (int i = 0; i < resources.length; i++) { - IArchiveResource cFile = null; - if (!resources[i].exists()) { - continue; - } - // We have to avoid duplicates between the source and output folders - // (non-java - // resources) - IPath runtimePath = runtimePathPrefix.append(resources[i].getProjectRelativePath().removeFirstSegments(outputFolderSegmentCount)); - if (runtimePath == null) - continue; - if (resources[i].getType() == IResource.FILE) { - if (!shouldInclude(runtimePath)) - continue; - cFile = createFile(runtimePath); - cFile.setLastModified(getLastModified(resources[i])); - filesHolder.addFile(cFile, resources[i]); - fileAdded = true; - } else if (shouldInclude((IContainer) resources[i])) { - IResource[] nestedResources = ((IContainer) resources[i]).members(); - aggregateOutputFiles(nestedResources, runtimePathPrefix, outputFolderSegmentCount); - if (!filesHolder.contains(runtimePath)) { - if (!shouldInclude(runtimePath)) - continue; - cFile = createDirectory(runtimePath); - cFile.setLastModified(getLastModified(resources[i])); - filesHolder.addFile(cFile); - fileAdded = true; - } - } - } - return fileAdded; - } - - /** - * This is used to track whether {@link #aggregateFiles(IVirtualResource[])} - * is currently within a Java Source folder. - */ - private boolean inJavaSrc = false; - - protected boolean aggregateFiles(IVirtualResource[] virtualResources) throws CoreException { - boolean fileAdded = false; - for (int i = 0; i < virtualResources.length; i++) { - if (!virtualResources[i].exists()) { - continue; - } - // We have to avoid duplicates between the source and output folders - // (non-java - // resources) - IPath runtimePath = virtualResources[i].getRuntimePath(); - if (runtimePath == null) - continue; - runtimePath = runtimePath.setDevice(null).makeRelative(); - if (filesHolder.contains(runtimePath)) - continue; - - IArchiveResource cFile = null; - - if (virtualResources[i].getType() == IVirtualResource.FILE) { - if (!shouldInclude(runtimePath)) - continue; - IResource resource = virtualResources[i].getUnderlyingResource(); - // want to ignore derived resources nested within Java src - // directories; this covers the case where - // a user has nested a Java output directory within a Java src - // directory (note: should ideally be - // respecting Java src path exclusion filters) - if (inJavaSrc && resource.isDerived()) { - continue; - } - cFile = createFile(runtimePath); - cFile.setLastModified(getLastModified(resource)); - filesHolder.addFile(cFile, resource); - fileAdded = true; - } else if (shouldInclude((IVirtualContainer) virtualResources[i])) { - boolean inJavaSrcAtThisLevel = inJavaSrc; - try { - if (!inJavaSrc) { - // if not already inside a Java src dir, check again - inJavaSrc = inJavaSrc(virtualResources[i]); - } - IVirtualResource[] nestedVirtualResources = ((IVirtualContainer) virtualResources[i]).members(); - aggregateFiles(nestedVirtualResources); - if (!filesHolder.contains(runtimePath)) { - if (!shouldInclude(runtimePath)) - continue; - IResource resource = virtualResources[i].getUnderlyingResource(); - if (inJavaSrc && resource.isDerived()) { - continue; - } - cFile = createDirectory(runtimePath); - cFile.setLastModified(getLastModified(resource)); - filesHolder.addFile(cFile); - fileAdded = true; - } - } finally { - inJavaSrc = inJavaSrcAtThisLevel; - } - } - } - return fileAdded; - } - - /** - * Determines if the specified IVirtualResource maps to a IResource that is - * contained within a Java src root. - * - * @param virtualResource - * IVirtualResource to check. - * @param sourceRoots - * Current Java src roots. - * @return True if contained in a Java src root, false otherwise. - */ - private boolean inJavaSrc(final IVirtualResource virtualResource) { - if (sourceRoots.length == 0) { - return false; - } - // all mapped resources must be associated with Java src for the - // resource to be considered in Java src - final IResource[] resources = virtualResource.getUnderlyingResources(); - boolean inJavaSrc = false; - for (int i = 0; i < resources.length; i++) { - inJavaSrc = false; - for (int j = 0; j < sourceRoots.length; j++) { - if (sourceRoots[j].getFullPath().isPrefixOf(resources[i].getFullPath())) { - inJavaSrc = true; - break; - } - } - // if this one was not in Java src, can break - if (!inJavaSrc) { - break; - } - } - - return inJavaSrc; - } - - protected long getLastModified(IResource aResource) { - return aResource.getLocation().toFile().lastModified(); - } - - public void setExportSource(boolean newExportSource) { - exportSource = newExportSource; - } - - public boolean isExportSource() { - return exportSource; - } - - protected boolean shouldInclude(IContainer aContainer) { - return true; - } - - protected boolean shouldInclude(IVirtualContainer vContainer) { - IContainer iContainer = (IContainer) vContainer.getUnderlyingResource(); - return shouldInclude(iContainer); - } - - // TODO add a mechanism for ignoring specific file types - protected boolean shouldInclude(IPath path) { - String lastSegment = path.lastSegment(); - if (null == lastSegment) { - return false; - } - if (lastSegment.endsWith(DOT_PROJECT) || lastSegment.endsWith(DOT_CLASSPATH) || lastSegment.endsWith(DOT_CVS_IGORE) || path.segment(0).startsWith(DOT_SETTINGS)) { - return false; - } - return isExportSource() || !isSource(path); - } - - // TODO add a mechanism for ignoring specific file types - protected boolean isSource(IPath path) { - if (path == null) - return false; - return path.lastSegment().endsWith(JavaEEArchiveUtilities.DOT_JAVA) || path.lastSegment().endsWith(DOT_SQLJ); - } - - protected void addExternalFile(IPath path, java.io.File externalDiskFile) { - IArchiveResource aFile = createFile(path); - filesHolder.addFile(aFile, externalDiskFile); - } - - protected InputStream getSuperInputStream(IArchiveResource archiveResource) throws IOException, FileNotFoundException { - if (archiveResource.getType() == IArchive.ARCHIVE_TYPE) { - IArchiveLoadAdapter nestedLoadAdapter = (IArchiveLoadAdapter)((IArchive)archiveResource).getLoadAdapter(); - if(nestedLoadAdapter instanceof ComponentArchiveLoadAdapter){ - ((ComponentArchiveLoadAdapter)nestedLoadAdapter).setExportSource(isExportSource()); - } - } - - return super.getInputStream(archiveResource); - } - - public InputStream getInputStream(IArchiveResource archiveResource) throws IOException, FileNotFoundException { - IPath path = archiveResource.getPath(); - // If the MANIFEST.MF of a module component is being requested and that - // module component references - // Java build path-based components, need to dynamically update the - // manifest classpath to reflect the resolved - // contributions from the build path - if (includeClasspathComponents && path.equals(J2EEConstants.MANIFEST_URI) && !javaClasspathURIs.isEmpty() && manifestFile != null && manifestFile.getUnderlyingFile() != null - && manifestFile.getUnderlyingFile().exists()) { - // update the manifest classpath for the component - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ClasspathDependencyManifestUtil.updateManifestClasspath(manifestFile.getUnderlyingFile(), javaClasspathURIs, baos); - return new ByteArrayInputStream(baos.toByteArray()); - } - - if (filesHolder.contains(path)) { - return filesHolder.getInputStream(path); - } - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualResource vResource = rootFolder.findMember(path); - String filePath = null; - if (null != vResource && vResource.exists()) { - filePath = vResource.getUnderlyingResource().getLocation().toOSString(); - java.io.File file = new java.io.File(filePath); - return new FileInputStream(file); - } - String eString = EARArchiveOpsResourceHandler.ARCHIVE_OPERATION_FileNotFound; - throw new FileNotFoundException(eString); - } - - public IVirtualComponent getComponent() { - return vComponent; - } - - protected JavaEEEMFArchiveAdapterHelper emfHelper = null; - - protected void initEMFHelper() { - if (emfHelper == null) { - emfHelper = new JavaEEEMFArchiveAdapterHelper(getArchive()); - emfHelper.setArchiveURIConverter(new ArchiveURIConverter(emfHelper.getArchive()) { - protected URI convertPathToURI(IPath modelObjectPath) { - // TODO find a better way to getplatformURI - IPath path = getComponent().getRootFolder().getFile(modelObjectPath).getUnderlyingFile().getFullPath(); - return URI.createURI("platform:/resource/" + path.toString()); - } - }); - } - } - - public boolean containsModelObject(IPath modelObjectPath) { - initEMFHelper(); - if (IArchive.EMPTY_MODEL_PATH == modelObjectPath) { - modelObjectPath = getDefaultModelObjectPath(); - } - return emfHelper.containsModelObject(modelObjectPath); - } - - public Object getModelObject(IPath modelObjectPath) throws ArchiveModelLoadException { - initEMFHelper(); - if (IArchive.EMPTY_MODEL_PATH == modelObjectPath) { - modelObjectPath = getDefaultModelObjectPath(); - } - return emfHelper.getModelObject(modelObjectPath); - } - - protected IPath getDefaultModelObjectPath() { - return new Path("/"); //$NON-NLS-1$ - } - - public String toString() { - int packageLength = this.getClass().getPackage().getName().length() + 1; - StringBuffer buffer = new StringBuffer(this.getClass().getName().substring(packageLength)); - buffer.append(", Component: "); //$NON-NLS-1$ - buffer.append(getComponent()); - return buffer.toString(); - } - - /** - * protected IProgressMonitor monitor = null; - * - * public void setProgressMonitor(IProgressMonitor monitor){ this.monitor = - * monitor; } - * - * protected final int FILE_SAVE_WORK = 100; - * - * public FileIterator getFileIterator() throws IOException { return new - * FileIteratorImpl(getContainer().getFiles()){ protected SubProgressMonitor - * lastSubMon = null; boolean firstVisit = true; - * - * public File next() { if(firstVisit){ firstVisit = false; if(monitor != - * null){ - * monitor.beginTask(ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.Exporting_archive, - * new Object [] { getContainer().getURI() }), files.size() * - * FILE_SAVE_WORK); } } if(lastSubMon != null){ lastSubMon.done(); - * lastSubMon = null; } else if(monitor != null){ - * monitor.worked(FILE_SAVE_WORK); } File file = super.next(); if(monitor != - * null){ if(file.isContainer() && - * ComponentArchiveLoadAdapter.class.isInstance(((ContainerImpl)file).getLoadStrategy())){ - * ComponentArchiveLoadAdapter ls = - * (ComponentArchiveLoadAdapter)((ContainerImpl)file).getLoadStrategy(); - * lastSubMon = new SubProgressMonitor(monitor, FILE_SAVE_WORK, - * SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); - * ls.setProgressMonitor(lastSubMon); } else { - * monitor.subTask(file.getURI()); } } return file; } }; } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ComponentArchiveSaveAdapter.java deleted file mode 100644 index 07c1be8bf..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,285 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -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.IWorkspaceRoot; -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.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jst.j2ee.internal.archive.operations.EJBArchiveOpsResourceHandler; -import org.eclipse.jst.j2ee.internal.archive.operations.IOverwriteHandler; -import org.eclipse.jst.j2ee.internal.archive.operations.OverwriteHandlerException; -import org.eclipse.jst.jee.archive.AbstractArchiveSaveAdapter; -import org.eclipse.jst.jee.archive.ArchiveSaveFailureException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -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.internal.DoNotUseMeThisWillBeDeletedPost15; - -// hari: make abstract -public class ComponentArchiveSaveAdapter extends AbstractArchiveSaveAdapter { - - protected IDataModel dataModel; - - protected IVirtualComponent vComponent; - - protected IOverwriteHandler overwriteHandler; - - protected IProgressMonitor progressMonitor; - - private String archiveComponentsDeployPath; - - private List archiveComponents; - - private Map archiveComponentURIMap; - - public ComponentArchiveSaveAdapter(IVirtualComponent vComponent) { - super(); - if (null == vComponent) { - throw new NullPointerException(); - } - this.vComponent = vComponent; - } - - public void setDataModel(IDataModel dataModel) { - this.dataModel = dataModel; - } - - public void setOverwriteHandler(IOverwriteHandler newOverwriteHandler) { - overwriteHandler = newOverwriteHandler; - } - - public void setProgressMonitor(IProgressMonitor newProgressMonitor) { - progressMonitor = newProgressMonitor; - } - - protected void validateEdit(IFile aFile) { - if (overwriteHandler == null) - return; - if (!(aFile.exists() && aFile.isReadOnly())) - return; - - overwriteHandler.validateEdit(aFile); - } - - protected boolean shouldOverwrite(String uri) { - if (overwriteHandler.isOverwriteNone()) - return false; - return (overwriteHandler.isOverwriteResources() || overwriteHandler.isOverwriteAll() || overwriteHandler.shouldOverwrite(uri)); - } - - protected OutputStream getOutputStreamForResource(Resource aResource) throws IOException { - // this method has no references in the hirarchy - return null; - } - - public void save(IProgressMonitor monitor) throws ArchiveSaveFailureException { - final int SUPER_TICKS = 1000; - final int LOCAL_TICKS = 10; - final int TOTAL_TICKS = SUPER_TICKS + LOCAL_TICKS; - try { - monitor.beginTask("Importing " + vComponent.getName(), TOTAL_TICKS); - super.save(new SubProgressMonitor(monitor, SUPER_TICKS)); - linkArchiveComponents(); - monitor.worked(LOCAL_TICKS); - } finally { - monitor.done(); - } - } - - public void save(IArchiveResource aFile) throws ArchiveSaveFailureException { - - try { - if (progressMonitor == null) - progressMonitor = new NullProgressMonitor(); - progressMonitor.subTask(aFile.getPath().toString()); - InputStream in = aFile.getInputStream(); - - IPath projectRelativePath = getProjectRelativePath(aFile); - if (aFile.getType() == IArchiveResource.ARCHIVE_TYPE) { - saveAsArchiveComponent((IArchive) aFile, projectRelativePath, in); - } else if (aFile.getType() != IArchiveResource.DIRECTORY_TYPE) { - saveToOutputPath(projectRelativePath, in); - } else { - createDirectory(projectRelativePath); - } - } catch (OverwriteHandlerException ohe) { - throw ohe; - } catch (Exception e) { - String errorString = EJBArchiveOpsResourceHandler.ARCHIVE_OPERATION_SaveFile + aFile.getPath(); - throw new ArchiveSaveFailureException(errorString); - } finally { - if(null != progressMonitor){ - progressMonitor.worked(1); - } - } - } - - /** - * Returns the project relative path for where the specified file should be - * saved. - * - * @param aFile - * @return - */ - protected IPath getProjectRelativePath(IArchiveResource aFile) { - IPath path = aFile.getPath(); - IFile iFile = null; - if (path.lastSegment() != null && path.lastSegment().startsWith(IModuleConstants.DOT_SETTINGS)) { - iFile = vComponent.getProject().getFile(path); - } else { - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualFile vFile = rootFolder.getFile(path); - iFile = vFile.getUnderlyingFile(); - } - return iFile.getProjectRelativePath(); - } - - /** - * Creates the IFolder specified by the project relative path. - * - * @param projectRelativePath - * @throws CoreException - */ - protected void createDirectory(IPath projectRelativePath) throws CoreException { - IFolder iFolder = vComponent.getProject().getFolder(projectRelativePath); - if (!iFolder.exists()) { - mkdirs(iFolder); - } - } - - /** - * Creates the specified IFolder - * - * @param folder - * @throws CoreException - */ - protected void mkdirs(IFolder folder) throws CoreException { - IContainer container = folder.getParent(); - if (!container.exists()) { - mkdirs((IFolder) container); - } - folder.create(true, true, null); - } - - /** - * Save the specified Archive to the specified project relative path using - * the passed input stream. - * - * @param archive - * @param projectRelativePath - * @param in - * @throws Exception - */ - protected void saveAsArchiveComponent(IArchive archive, IPath projectRelativePath, InputStream in) throws Exception { - IFile iFile = saveToOutputPathIFile(projectRelativePath, in); - // TODO investigate removing this block and related variables and - // linkArchiveComponents(); see bugzilla 159160 - if (shouldLinkAsComponentRef(archive)) { - IVirtualComponent archiveComponent = ComponentCore.createArchiveComponent(vComponent.getProject(), VirtualArchiveComponent.LIBARCHIVETYPE + iFile.getFullPath().toString()); - if (archiveComponents == null) { - archiveComponents = new ArrayList(); - archiveComponentURIMap = new HashMap(); - archiveComponentsDeployPath = IPath.SEPARATOR + projectRelativePath.removeLastSegments(1).toString(); - } - archiveComponents.add(archiveComponent); - archiveComponentURIMap.put(archiveComponent, iFile.getName()); - } - } - - protected boolean shouldLinkAsComponentRef(IArchive archive) { - return false; - } - - protected void linkArchiveComponents() { - if (archiveComponents != null && archiveComponents.size() > 0) { - IDataModel createReferencesDataModel = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider()); - createReferencesDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, vComponent); - createReferencesDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, archiveComponentsDeployPath); - createReferencesDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, archiveComponents); - createReferencesDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, archiveComponentURIMap); - try { - createReferencesDataModel.getDefaultOperation().execute(null, null); - } catch (ExecutionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - /** - * Saves to the specified project relative output path. Warning this method - * will be changed post 1.5 to return an IFile - * - * @param projectRelativePath - * @param in - * @throws Exception - */ - protected void saveToOutputPath(IPath projectRelativePath, InputStream in) throws Exception { - saveToOutputPathIFile(projectRelativePath, in); - } - - /** - * TODO refactor change the method above to return IFile - * {@link DoNotUseMeThisWillBeDeletedPost15} - */ - protected IFile saveToOutputPathIFile(IPath projectRelativePath, InputStream in) throws Exception { - IFile iFile = vComponent.getProject().getFile(projectRelativePath); - saveToIFile(iFile, in); - return iFile; - } - - protected void saveToIFile(IFile iFile, InputStream in) throws Exception { - validateEdit(iFile); - if (iFile.exists()) - iFile.setContents(in, true, true, null); - else { - mkdirs(iFile.getFullPath().removeLastSegments(1), ResourcesPlugin.getWorkspace().getRoot()); - iFile.create(in, true, null); - } - } - - protected void mkdirs(IPath path, IWorkspaceRoot root) throws CoreException { - if (path.segmentCount() <= 1) - return; - IFolder folder = root.getFolder(path); - if (!folder.exists()) { - mkdirs(path.removeLastSegments(1), root); - folder.create(true, true, null); - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveLoadAdapter.java deleted file mode 100644 index 6af2566a2..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveLoadAdapter.java +++ /dev/null @@ -1,287 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -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.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.jee.archive.ArchiveOpenFailureException; -import org.eclipse.jst.jee.archive.ArchiveOptions; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveFactory; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class ConnectorComponentArchiveLoadAdapter extends ComponentArchiveLoadAdapter { - - private int dotJavaLength = JavaEEArchiveUtilities.DOT_JAVA.length(); - - private List alreadyIndexed = new ArrayList(); - - private Map classesMap; - - private IFile knownDD; - - public static String[] knownLibExtensions = { ".jar", //$NON-NLS-1$ - ".zip", //$NON-NLS-1$ - ".so", //$NON-NLS-1$ - ".o", //$NON-NLS-1$ - ".sl", //$NON-NLS-1$ - ".dll", //$NON-NLS-1$ - }; - - public ConnectorComponentArchiveLoadAdapter(IVirtualComponent vComponent) { - this(vComponent, true); - } - - public ConnectorComponentArchiveLoadAdapter(IVirtualComponent vComponent, boolean includeClasspathComponents) { - super(vComponent, includeClasspathComponents); - knownDD = vComponent.getRootFolder().getFile(J2EEConstants.RAR_DD_URI).getUnderlyingFile(); - } - - public List<IArchiveResource> getArchiveResources() { - addNestedJARsFromSourceRoots(); - aggregateSourceFiles(); - return filesHolder.getFiles(); - } - - private void addNestedJARsFromSourceRoots() { - IPackageFragmentRoot[] sourceRoots = J2EEProjectUtilities.getSourceContainers(vComponent.getProject()); - for (int i = 0; i < sourceRoots.length; i++) { - IArchiveResource aFile; - try { - aFile = getNestedJar(sourceRoots[i]); - if (null != aFile) { - filesHolder.addFile(aFile); - } - } catch (JavaModelException e) { - Logger.getLogger().logError(e); - } catch (ArchiveOpenFailureException e) { - Logger.getLogger().logError(e); - } - } - } - - private IArchiveResource getNestedJar(IPackageFragmentRoot sourceRoot) throws JavaModelException, ArchiveOpenFailureException { - IPath outputPath = sourceRoot.getRawClasspathEntry().getOutputLocation(); - if (outputPath == null) { - IProject project = vComponent.getProject(); - try { - if (project.hasNature(JavaCore.NATURE_ID)) { - IJavaProject javaProject = JavaCore.create(project); - outputPath = javaProject.getOutputLocation(); - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - if (outputPath == null) { - return null; - } - } - - IFolder javaOutputFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(outputPath); - indexClassesForOutputFolder(javaOutputFolder); - IContainer sourceContainer = (IContainer) sourceRoot.getResource(); - - int sourceContainerSegmentCount = sourceContainer.getProjectRelativePath().segmentCount(); - boolean isModuleRoot = knownDD.getProjectRelativePath().toString().startsWith(sourceContainer.getProjectRelativePath().toString()); - Set iFilesSet = new HashSet(); - boolean foundJava = gatherFilesForJAR(iFilesSet, sourceContainer, isModuleRoot, false, sourceContainerSegmentCount); - if (!isModuleRoot || foundJava) { - List <IFile> iFilesList = Collections.list(Collections.enumeration(iFilesSet)); - for (int i = 0; i < iFilesList.size(); i++) { - filesHolder.removeIFile((IFile) iFilesList.get(i)); - } - IArchiveResource nestedArchive = createNestedArchive(iFilesList, sourceContainer, javaOutputFolder); - return nestedArchive; - } - return null; - } - - private boolean gatherFilesForJAR(Collection iFiles, IContainer current, boolean isModuleRoot, boolean foundJava, int sourceContainerSegmentCount) { - IResource[] members = null; - try { - members = current.members(); - } catch (CoreException core) { - // TODO - // throw new ArchiveRuntimeException(core); - } - for (int i = 0; i < members.length; i++) { - IResource res = members[i]; - if (res.getType() == IResource.FOLDER) { - foundJava = gatherFilesForJAR(iFiles, (IFolder) res, isModuleRoot, foundJava, sourceContainerSegmentCount) || foundJava; - } else {// it must be a file - IFile srcFile = (IFile) res; - if (belongsInNestedJAR(srcFile, isModuleRoot)) { - if (JavaEEArchiveUtilities.isJava(srcFile)) { - if (exportSource) { - iFiles.add(srcFile); // don't need to check - // duplicates here - } - String className = srcFile.getProjectRelativePath().removeFirstSegments(sourceContainerSegmentCount).toString(); - className = className.substring(0, className.length() - dotJavaLength); - List classes = retrieveClasses(className); - if (null != classes) { - Iterator iterator = classes.iterator(); - while (iterator.hasNext()) { - IFile clazz = (IFile) iterator.next(); - if (!iFiles.contains(clazz)) { - // .class need to check for duplicates - iFiles.add(clazz); - } - } - } - } else { - if (!iFiles.contains(srcFile)) { - // if it's not src, then it could be .class and need - // to check for duplicates - iFiles.add(srcFile); - } - } - if (isModuleRoot) - foundJava = foundJava || JavaEEArchiveUtilities.isJava(srcFile) || JavaEEArchiveUtilities.isClass(srcFile); - } - } - } - return foundJava; - } - - private IArchive createNestedArchive(List <IFile> files, IContainer sourceContainer, IFolder javaOutputFolder) throws ArchiveOpenFailureException { - ConnectorComponentNestedJARArchiveLoadAdapter nestedLoader = new ConnectorComponentNestedJARArchiveLoadAdapter(files, sourceContainer, javaOutputFolder); - ArchiveOptions nestedOptions = new ArchiveOptions(); - nestedOptions.setOption(ArchiveOptions.LOAD_ADAPTER, nestedLoader); - IArchive nestedArchive = IArchiveFactory.INSTANCE.openArchive(nestedOptions); - nestedArchive.setPath(new Path(computeUniqueArchiveURI(sourceContainer))); - nestedArchive.setArchive(archive); - return nestedArchive; - } - - private String computeUniqueArchiveURI(IResource resource) { - int increment = 0; - String name = resource.getName(); - StringBuffer sb = null; - do { - sb = new StringBuffer(name.length() + 5); - sb.append('_'); - sb.append(name); - if (increment > 0) - sb.append(increment); - sb.append(".jar"); //$NON-NLS-1$ - increment++; - } while (filesHolder.contains(new Path(sb.toString()))); - return sb.toString(); - } - - private boolean belongsInNestedJAR(IFile iFile, boolean isModuleRoot) { - if (isModuleRoot && isDeploymentDescriptor(iFile)) { - return false; - } - for (int i = 0; i < knownLibExtensions.length; i++) { - if (JavaEEArchiveUtilities.hasExtension(iFile, knownLibExtensions[i])) - return false; - } - return true; - } - - protected boolean shouldInclude(IPath path) { - String lastSegment = path.lastSegment(); - return null != lastSegment && !JavaEEArchiveUtilities.hasExtension(lastSegment, JavaEEArchiveUtilities.DOT_CLASS) && !JavaEEArchiveUtilities.hasExtension(lastSegment, JavaEEArchiveUtilities.DOT_JAVA); - } - - /** - * Find all the .class files and index them so inner classes can be located. - */ - private void indexClassesForOutputFolder(IFolder javaOutputFolder) { - if (null == javaOutputFolder || alreadyIndexed.contains(javaOutputFolder)) { - return; - } - alreadyIndexed.add(javaOutputFolder); - int segmentCount = javaOutputFolder.getProjectRelativePath().segmentCount(); - indexClasses(javaOutputFolder, segmentCount); - } - - private void indexClasses(IResource resource, int javaOutputSegmentCount) { - switch (resource.getType()) { - case IResource.FILE: - indexClass((IFile) resource, javaOutputSegmentCount); - break; - case IResource.FOLDER: - try { - IResource[] members = ((IFolder) resource).members(); - for (int i = 0; i < members.length; i++) { - indexClasses(members[i], javaOutputSegmentCount); - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - break; - } - } - - private void indexClass(IFile iFile, int javaOutputSegmentCount) { - if (!JavaEEArchiveUtilities.isClass(iFile)) - return; - if (classesMap == null) - classesMap = new HashMap(); - String name = iFile.getName(); - IPath relPath = iFile.getProjectRelativePath().removeFirstSegments(javaOutputSegmentCount); - String key = relPath.toString(); - if (name.indexOf('$') != -1) { - key = key.substring(0, key.indexOf('$')); - } else { - key = key.substring(0, key.indexOf('.')); - } - List inners = (List) classesMap.get(key); - if (inners == null) { - inners = new ArrayList(1); - classesMap.put(key, inners); - } - inners.add(iFile); - } - - public List retrieveClasses(String key) { - if (classesMap == null) - return null; - return (List) classesMap.get(key); - } - - private boolean isDeploymentDescriptor(IFile iFile) { - return knownDD.equals(iFile); - } - - @Override - protected IPath getDefaultModelObjectPath() { - return new Path(J2EEConstants.RAR_DD_URI); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveSaveAdapter.java deleted file mode 100644 index d1dd89c15..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class ConnectorComponentArchiveSaveAdapter extends J2EEComponentArchiveSaveAdapter { - - public ConnectorComponentArchiveSaveAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveTypeHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveTypeHandler.java deleted file mode 100644 index 0393c78f4..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentArchiveTypeHandler.java +++ /dev/null @@ -1,31 +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.j2ee.internal.archive; - -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveHandler; - -public class ConnectorComponentArchiveTypeHandler implements IArchiveHandler { - - public boolean handlesArchive(IArchive archive) { - if (archive.getLoadAdapter() instanceof ConnectorComponentArchiveLoadAdapter) { - return true; - } else if (archive.containsArchiveResource(new Path(J2EEConstants.RAR_DD_URI))) { - return true; - } else { - // TODO handle the no DD case - return false; - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentNestedJARArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentNestedJARArchiveLoadAdapter.java deleted file mode 100644 index 0812304d2..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/ConnectorComponentNestedJARArchiveLoadAdapter.java +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.jee.archive.AbstractArchiveLoadAdapter; -import org.eclipse.jst.jee.archive.ArchiveModelLoadException; -import org.eclipse.jst.jee.archive.IArchiveResource; - -public class ConnectorComponentNestedJARArchiveLoadAdapter extends AbstractArchiveLoadAdapter { - - private List<IFile> iFiles; - - private int sourceSegmentCount; - - private int outputSegmentCount; - - private Map<IPath, IFile> pathsToIFiles; - - private Map<IPath, IArchiveResource> pathsToIArchiveResources; - - private IContainer sourceContainer; - - /** - * Constructor for NestedJARLoadStrategyImpl. - */ - public ConnectorComponentNestedJARArchiveLoadAdapter(List<IFile> iFiles, IContainer sourceContainer, IFolder javaOutputFolder) { - super(); - this.iFiles = iFiles; - this.sourceContainer = sourceContainer; - sourceSegmentCount = sourceContainer.getProjectRelativePath().segmentCount(); - outputSegmentCount = javaOutputFolder.getProjectRelativePath().segmentCount(); - } - - public String toString() { - int packageLength = this.getClass().getPackage().getName().length() + 1; - StringBuffer buffer = new StringBuffer(this.getClass().getName().substring(packageLength)); - buffer.append(", Source Container: "); //$NON-NLS-1$ - buffer.append(sourceContainer.getName()); - return buffer.toString(); - } - - private boolean indexed = false; - - private List<IArchiveResource> fullIndex = null; - - public List<IArchiveResource> getArchiveResources() { - if (!indexed) { - indexed = true; - pathsToIFiles = new HashMap<IPath, IFile>(); - pathsToIArchiveResources = new HashMap<IPath, IArchiveResource>(); - for (IFile iFile : iFiles) { - IPath relPath; - if (JavaEEArchiveUtilities.isClass(iFile)) { - relPath = getRelativePath(iFile, outputSegmentCount); - } else { - relPath = getRelativePath(iFile, sourceSegmentCount); - } - addFile(iFile, relPath); - } - IPath manifestPath = new Path(J2EEConstants.MANIFEST_URI); - if (!pathsToIArchiveResources.containsKey(manifestPath)) { - IArchiveResource manifest = createManifest(manifestPath); - pathsToIArchiveResources.put(manifest.getPath(), manifest); - } - List<IArchiveResource> list = new ArrayList(); - list.addAll(pathsToIArchiveResources.values()); - fullIndex = Collections.unmodifiableList(list); - } - return fullIndex; - } - - protected void addFile(IFile iFile, IPath relPath) { - IArchiveResource aFile = createFile(iFile, relPath); - pathsToIArchiveResources.put(aFile.getPath(), aFile); - pathsToIFiles.put(aFile.getPath(), iFile); - } - - protected long getLastModified(IResource aResource) { - return aResource.getLocation().toFile().lastModified(); - } - - private IArchiveResource createFile(IFile iFile, IPath relPath) { - IArchiveResource cFile = createFile(relPath); - cFile.setLastModified(getLastModified(iFile)); - return cFile; - } - - private IPath getRelativePath(IFile file, int parentSegmentCount) { - return file.getProjectRelativePath().removeFirstSegments(parentSegmentCount); - } - - public boolean containsArchiveResource(IPath resourcePath) { - if (!indexed) { - getArchiveResources(); - } - return pathsToIArchiveResources.containsKey(resourcePath); - } - - public IArchiveResource getArchiveResource(IPath resourcePath) throws FileNotFoundException { - if (!indexed) { - getArchiveResources(); - } - return pathsToIArchiveResources.get(resourcePath); - } - - public InputStream getInputStream(IArchiveResource archiveResource) throws IOException, FileNotFoundException { - IFile file = pathsToIFiles.get(archiveResource.getPath()); - if (file != null) { - try { - return file.getContents(); - } catch (CoreException core) { - throw new IOException("Unable to get contents from " + file.getProjectRelativePath() + " message " + core.getLocalizedMessage()); - } - } - throw new FileNotFoundException(archiveResource.getPath().toString()); - } - - public boolean containsModelObject(IPath modelObjectPath) { - return false; - } - - public Object getModelObject(IPath modelObjectPath) throws ArchiveModelLoadException { - return null; // no model objects here - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveLoadAdapter.java deleted file mode 100644 index 88e6f58ff..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveLoadAdapter.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.jee.archive.ArchiveOpenFailureException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.jst.jee.archive.internal.ArchiveUtil; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - -public class EARComponentArchiveLoadAdapter extends ComponentArchiveLoadAdapter { - - // Optimization to directly copy binary files - private Map<IArchiveResource, File> binaryResourcesToDiskFiles = new HashMap<IArchiveResource, File>(); - - public EARComponentArchiveLoadAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - - public EARComponentArchiveLoadAdapter(IVirtualComponent vComponent, boolean includeClasspathComponents) { - super(vComponent, includeClasspathComponents); - } - - public List<IArchiveResource> getArchiveResources() { - aggregateSourceFiles(); - addModulesAndUtilities(); - List<IArchiveResource> files = filesHolder.getFiles(); - IPath manifestPath = new Path(J2EEConstants.MANIFEST_URI); - if (!filesHolder.contains(manifestPath)) { - IArchiveResource manifest = createManifest(manifestPath); - files.add(manifest); - } - return files; - } - - public InputStream getInputStream(IArchiveResource archiveResource) throws IOException, FileNotFoundException { - if (binaryResourcesToDiskFiles.containsKey(archiveResource)) { - java.io.File diskFile = binaryResourcesToDiskFiles.get(archiveResource); - return new FileInputStream(diskFile); - } - return super.getInputStream(archiveResource); - } - - public void addModulesAndUtilities() { - IVirtualReference[] components = J2EEProjectUtilities.getComponentReferences(vComponent); - for (int i = 0; i < components.length; i++) { - IVirtualReference reference = components[i]; - IVirtualComponent referencedComponent = reference.getReferencedComponent(); - - try { - IArchive nestedModuleArchive = JavaEEArchiveUtilities.INSTANCE.openArchive(referencedComponent); - nestedModuleArchive.setPath(new Path(reference.getArchiveName())); - nestedModuleArchive.setArchive(archive); - filesHolder.addFile(nestedModuleArchive); - - if (referencedComponent.isBinary()) { - java.io.File diskFile = null; - diskFile = ((VirtualArchiveComponent) referencedComponent).getUnderlyingDiskFile(); - if (!diskFile.exists()) { - IFile wbFile = ((VirtualArchiveComponent) referencedComponent).getUnderlyingWorkbenchFile(); - diskFile = new File(wbFile.getLocation().toOSString()); - } - binaryResourcesToDiskFiles.put(nestedModuleArchive, diskFile); - } else { - JavaEEQuickPeek quickPeek = JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(nestedModuleArchive); - switch (quickPeek.getType()) { - case JavaEEQuickPeek.CONNECTOR_TYPE: - case JavaEEQuickPeek.EJB_TYPE: - case JavaEEQuickPeek.WEB_TYPE: - ((ComponentArchiveLoadAdapter) nestedModuleArchive.getLoadAdapter()).setIncludeClasspathComponents(includeClasspathComponents); - addClasspathComponentDependencies(referencedComponent); - } - - } - } catch (ArchiveOpenFailureException e) { - ArchiveUtil.warn(e); - } - } - } - - private void addClasspathComponentDependencies(final IVirtualComponent referencedComponent) { - // retrieve all Java classpath component dependencies - if (includeClasspathComponents && referencedComponent instanceof J2EEModuleVirtualComponent) { - final IVirtualReference[] cpRefs = ((J2EEModuleVirtualComponent) referencedComponent).getJavaClasspathReferences(); - for (int j = 0; j < cpRefs.length; j++) { - final IVirtualReference ref = cpRefs[j]; - // only ../ runtime paths contribute to the EAR - if (ref.getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - if (ref.getReferencedComponent() instanceof VirtualArchiveComponent) { - final VirtualArchiveComponent comp = (VirtualArchiveComponent) ref.getReferencedComponent(); - File cpEntryFile = comp.getUnderlyingDiskFile(); - if (!cpEntryFile.exists()) { - final IFile wbFile = comp.getUnderlyingWorkbenchFile(); - cpEntryFile = new File(wbFile.getLocation().toOSString()); - } - addExternalFile(new Path(ref.getArchiveName()), cpEntryFile); - } - } - } - } - } - - @Override - protected IPath getDefaultModelObjectPath() { - return new Path(J2EEConstants.APPLICATION_DD_URI); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveSaveAdapter.java deleted file mode 100644 index c47c6f5e6..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import java.util.List; - -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.datamodel.properties.IEARComponentImportDataModelProperties; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class EARComponentArchiveSaveAdapter extends ComponentArchiveSaveAdapter { - - - public EARComponentArchiveSaveAdapter(IVirtualComponent component) { - super(component); - } - - public void setDataModel(IDataModel dataModel) { - super.setDataModel(dataModel); - } - - - protected SubProgressMonitor subMonitor() { - return new SubProgressMonitor(progressMonitor, 10); - } - - public void setMonitor(org.eclipse.core.runtime.IProgressMonitor newMonitor) { - progressMonitor = newMonitor; - } - - protected boolean shouldSave(IArchiveResource aRes) { - - // TODO: go back and revisit it in the future. - - /*if (aRes.getType() == IArchiveResource.ARCHIVE_TYPE) { - // return getFilter().shouldSave(aFile.getURI(), getArchive()); - }*/ - return super.shouldSave(aRes); - } - - protected boolean shouldLinkAsComponentRef(Archive archive) { - if (null != dataModel) { - List list = (List) dataModel.getProperty(IEARComponentImportDataModelProperties.HANDLED_PROJECT_MODELS_LIST); - for (int i = 0; i < list.size(); i++) { - if (archive == ((IDataModel) list.get(i)).getProperty(IEARComponentImportDataModelProperties.FILE)) { - return false; - } - } - } - return true; - } - - /*protected boolean shouldSave(String uri) { - if (overwriteHandler != null) { - if (overwriteHandler.isOverwriteNone()) - return false; - return ((super.shouldSave(uri)) && (overwriteHandler.isOverwriteAll() || overwriteHandler.isOverwriteResources() || overwriteHandler.shouldOverwrite(uri))); - } - return true; - }*/ - - - - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveTypeHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveTypeHandler.java deleted file mode 100644 index c1b81438e..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EARComponentArchiveTypeHandler.java +++ /dev/null @@ -1,31 +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.j2ee.internal.archive; - -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveHandler; - -public class EARComponentArchiveTypeHandler implements IArchiveHandler { - - public boolean handlesArchive(IArchive archive) { - if (archive.getLoadAdapter() instanceof EARComponentArchiveLoadAdapter) { - return true; - } else if (archive.containsArchiveResource(new Path(J2EEConstants.APPLICATION_DD_URI))) { - return true; - } else { - // TODO handle the no DD case - return false; - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveLoadAdapter.java deleted file mode 100644 index 9eef178d3..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveLoadAdapter.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class EJBComponentArchiveLoadAdapter extends J2EEComponentArchiveLoadAdapter { - - public EJBComponentArchiveLoadAdapter(IVirtualComponent vComponent) { - this(vComponent, true); - } - - public EJBComponentArchiveLoadAdapter(IVirtualComponent vComponent, boolean includeClasspathComponents) { - super(vComponent, includeClasspathComponents); - } - - protected IPath getDefaultModelObjectPath() { - return new Path(J2EEConstants.EJBJAR_DD_URI); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveSaveAdapter.java deleted file mode 100644 index 0c04bfe96..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class EJBComponentArchiveSaveAdapter extends J2EEComponentArchiveSaveAdapter { - - public EJBComponentArchiveSaveAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveTypeHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveTypeHandler.java deleted file mode 100644 index fd90d8d92..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/EJBComponentArchiveTypeHandler.java +++ /dev/null @@ -1,31 +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.j2ee.internal.archive; - -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveHandler; - -public class EJBComponentArchiveTypeHandler implements IArchiveHandler { - - public boolean handlesArchive(IArchive archive) { - if (archive.getLoadAdapter() instanceof EJBComponentArchiveLoadAdapter) { - return true; - } else if (archive.containsArchiveResource(new Path(J2EEConstants.EJBJAR_DD_URI))) { - return true; - } else { - // TODO handle the no DD case - return false; - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEComponentArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEComponentArchiveLoadAdapter.java deleted file mode 100644 index 3eda627f0..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEComponentArchiveLoadAdapter.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public abstract class J2EEComponentArchiveLoadAdapter extends ComponentArchiveLoadAdapter{ - - public J2EEComponentArchiveLoadAdapter(IVirtualComponent component) { - super(component); - } - - public J2EEComponentArchiveLoadAdapter(IVirtualComponent component, boolean includeClasspathComponents) { - super(component, includeClasspathComponents); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEComponentArchiveSaveAdapter.java deleted file mode 100644 index 95b12b547..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,175 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; -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.jee.archive.ArchiveSaveFailureException; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -import com.ibm.icu.util.StringTokenizer; - -public abstract class J2EEComponentArchiveSaveAdapter extends ComponentArchiveSaveAdapter { - - protected final String DOT_CLASS = ".class"; //$NON-NLS-1$ - - protected final String DOT_JAVA = ".java"; //$NON-NLS-1$ - - protected final String IMPORTED_CLASSES = "ImportedClasses"; //$NON-NLS-1$ - - public J2EEComponentArchiveSaveAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - - public void save(IProgressMonitor monitor) throws ArchiveSaveFailureException { - final int SUPER_TICKS = 1000; - final int LOCAL_TICKS = 10; - final int REFRESH_TICKS = 100; - final int TOTAL_TICKS = SUPER_TICKS + LOCAL_TICKS + REFRESH_TICKS; - - try { - monitor.beginTask("Importing " + vComponent.getName(), TOTAL_TICKS); - super.save(new SubProgressMonitor(monitor, SUPER_TICKS)); - linkImportedClassesFolderIfNecessary(); - monitor.worked(LOCAL_TICKS); - try { - vComponent.getProject().refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, REFRESH_TICKS)); - } catch (CoreException ex) { - Logger.getLogger().logError(ex); - } - } finally { - monitor.done(); - } - } - - public boolean endsWithClassType(String aFileName) { - - if (aFileName != null && aFileName.endsWith(DOT_CLASS)) - return true; - return false; - } - - protected boolean shouldSave(IArchiveResource aFile) { - if (endsWithClassType(aFile.getPath().lastSegment())) { - boolean shouldSave = isClassWithoutSource(aFile); - if (shouldSave && !importedClassesFolderCreated) { - createImportedClassesFolder(); - } - return shouldSave; - } - return super.shouldSave(aFile); - } - - /* - * public void save(ArchiveManifest aManifest) throws SaveFailureException { - * IVirtualFolder rootFolder = vComponent.getRootFolder(); IVirtualFile - * vFile = rootFolder.getFile(new Path(J2EEConstants.MANIFEST_URI)); IFile - * iFile = vFile.getUnderlyingFile(); validateEdit(iFile); OutputStream out = - * new WorkbenchByteArrayOutputStream(iFile); try { aManifest.write(out); } - * catch (IOException e) { Logger.getLogger().logError(e); } finally { try { - * out.close(); } catch (IOException e) { Logger.getLogger().logError(e); } } } - */ - protected boolean importedClassesFolderCreated = false; - - protected IFolder importedClassesFolder; - - protected void createImportedClassesFolder() { - importedClassesFolderCreated = true; - IContainer jarParent = vComponent.getRootFolder().getUnderlyingFolder().getParent(); - importedClassesFolder = jarParent.getFolder(new Path(IMPORTED_CLASSES)); - try { - importedClassesFolder.create(true, true, null); - } catch (CoreException e1) { - Logger.getLogger().logError(e1); - } - } - - protected void linkImportedClassesFolderIfNecessary() { - if (importedClassesFolder != null) { - try { - vComponent.getRootFolder().getFolder(getImportedClassesRuntimePath()).createLink(importedClassesFolder.getProjectRelativePath(), 0, null); - if (shouldAddImportedClassesToClasspath()) { - if (JemProjectUtilities.getJavaProject(vComponent.getProject()) != null) { - IJavaProject javaProject = JavaCore.create(vComponent.getProject()); - IClasspathEntry[] javaClasspath = javaProject.getRawClasspath(); - IClasspathEntry[] newJavaClasspath = new IClasspathEntry[javaClasspath.length + 1]; - System.arraycopy(javaClasspath, 0, newJavaClasspath, 0, javaClasspath.length); - newJavaClasspath[newJavaClasspath.length - 1] = JavaCore.newLibraryEntry(importedClassesFolder.getFullPath(), null, null, true); - javaProject.setRawClasspath(newJavaClasspath, new NullProgressMonitor()); - } - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } - } - - protected boolean shouldAddImportedClassesToClasspath() { - return true; - } - - protected IPath getImportedClassesRuntimePath() { - return new Path("/"); - } - - @Override - protected IPath getProjectRelativePath(IArchiveResource aFile) { - if (endsWithClassType(aFile.getPath().lastSegment())) { - return importedClassesFolder.getFile(getImportedClassesURI(aFile)).getProjectRelativePath(); - } - return super.getProjectRelativePath(aFile); - } - - protected IPath getImportedClassesURI(IArchiveResource aFile) { - return aFile.getPath(); - } - - protected boolean isClassWithoutSource(IArchiveResource aFile) { - String javaUri = classUriToJavaUri(aFile.getPath().toString()); - if (javaUri == null) - return false; - return !archive.containsArchiveResource(new Path(javaUri)); - } - - public String classUriToJavaUri(String classUri) { - if (classUri == null || !classUri.endsWith(DOT_CLASS)) - return null; - - String truncated = truncateIgnoreCase(classUri, DOT_CLASS); - StringTokenizer tok = new StringTokenizer(truncated, "$"); //$NON-NLS-1$ - return tok.nextToken().concat(DOT_JAVA); - } - - /** - * Return a substring of the first parameter, up to the last index of the - * second - */ - public static String truncateIgnoreCase(String aString, String trailingSubString) { - int index = aString.toLowerCase().lastIndexOf(trailingSubString.toLowerCase()); - if (index != -1) - return aString.substring(0, index); - return aString; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEJavaComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEJavaComponentArchiveSaveAdapter.java deleted file mode 100644 index d53454bea..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/J2EEJavaComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class J2EEJavaComponentArchiveSaveAdapter extends J2EEComponentArchiveSaveAdapter { - - public J2EEJavaComponentArchiveSaveAdapter(IVirtualComponent vComponent) { - super(vComponent); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaComponentArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaComponentArchiveLoadAdapter.java deleted file mode 100644 index 978a707ed..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaComponentArchiveLoadAdapter.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class JavaComponentArchiveLoadAdapter extends ComponentArchiveLoadAdapter { - - public JavaComponentArchiveLoadAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - - public JavaComponentArchiveLoadAdapter(IVirtualComponent vComponent, boolean includeClasspathComponents) { - super(vComponent, includeClasspathComponents); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaComponentArchiveSaveAdapter.java deleted file mode 100644 index 585d873d4..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class JavaComponentArchiveSaveAdapter extends ComponentArchiveSaveAdapter { - - public JavaComponentArchiveSaveAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java deleted file mode 100644 index 8fe9d8878..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java +++ /dev/null @@ -1,499 +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.j2ee.internal.archive; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; -import java.util.jar.Attributes; -import java.util.jar.Manifest; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.ToolFactory; -import org.eclipse.jdt.core.util.IAnnotation; -import org.eclipse.jdt.core.util.IClassFileAttribute; -import org.eclipse.jdt.core.util.IClassFileReader; -import org.eclipse.jdt.core.util.IRuntimeVisibleAnnotationsAttribute; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.jee.archive.ArchiveModelLoadException; -import org.eclipse.jst.jee.archive.ArchiveOpenFailureException; -import org.eclipse.jst.jee.archive.ArchiveOptions; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveFactory; -import org.eclipse.jst.jee.archive.IArchiveLoadAdapter; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.jst.jee.archive.internal.ArchiveFactoryImpl; -import org.eclipse.jst.jee.archive.internal.ArchiveImpl; -import org.eclipse.jst.jee.archive.internal.ArchiveUtil; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class JavaEEArchiveUtilities extends ArchiveFactoryImpl implements IArchiveFactory { - - /** - * Default value = Boolean.TRUE Valid values = Boolean.TRUE or Boolean.FALSE - * - * An ArchiveOption used to specify whether - * {@link #openArchive(ArchiveOptions)} should attempt to discriminate - * between different Java EE archive types. The default behavior is to - * always discriminate fully for all types except EJB 3.0 archives - * {@link #DISCRIMINATE_EJB_ANNOTATIONS}. In order to fully discriminate - * EJB 3.0 archives, it is necessary to set both this flag and - * {@link #DISCRIMINATE_EJB_ANNOTATIONS} to true. - */ - public static final String DISCRIMINATE_JAVA_EE = "DISCRIMINATE_EJB"; //$NON-NLS-1$ - - /** - * Default value = Boolean.TRUE Valid values = Boolean.TRUE or Boolean.FALSE - * - * An ArchiveOption used to specify whether - * {@link #openArchive(ArchiveOptions)} should attempt to fully discriminate - * a JAR file from an EJB JAR file. This option is only relevant if the - * {@link #DISCRIMINATE_JAVA_EE} option is also set to Boolean.TRUE. If both - * options are set to true then as a last resort all .class files byte codes - * will be analyzed for EJB annotations in order to discriminate whether the - * specified IArchive is an EJB 3.0 jar. - */ - public static final String DISCRIMINATE_EJB_ANNOTATIONS = "DISCRIMINATE_EJB_ANNOTATIONS"; //$NON-NLS-1$ - - - private JavaEEArchiveUtilities() { - } - - public static JavaEEArchiveUtilities INSTANCE = new JavaEEArchiveUtilities(); - - public static final String DOT_JAVA = ".java"; //$NON-NLS-1$ - - public static final String DOT_CLASS = ".class"; //$NON-NLS-1$ - - public static boolean isJava(IFile iFile) { - return hasExtension(iFile, DOT_JAVA); - } - - public static boolean isClass(IFile iFile) { - return hasExtension(iFile, DOT_CLASS); - } - - public static boolean hasExtension(IFile iFile, String ext) { - String name = iFile.getName(); - return hasExtension(name, ext); - } - - public static boolean hasExtension(String name, String ext) { - int offset = ext.length(); - return name.regionMatches(true, name.length() - offset, ext, 0, offset); - } - - public IArchive openArchive(IVirtualComponent virtualComponent) throws ArchiveOpenFailureException { - if (virtualComponent.isBinary()) { - VirtualArchiveComponent archiveComponent = (VirtualArchiveComponent) virtualComponent; - java.io.File diskFile = null; - diskFile = archiveComponent.getUnderlyingDiskFile(); - if (!diskFile.exists()) { - IFile wbFile = archiveComponent.getUnderlyingWorkbenchFile(); - diskFile = new File(wbFile.getLocation().toOSString()); - } - IPath path = new Path(diskFile.getAbsolutePath()); - return openArchive(path); - } - int type = J2EEVersionConstants.UNKNOWN; - IArchiveLoadAdapter archiveLoadAdapter = null; - if (J2EEProjectUtilities.isEARProject(virtualComponent.getProject())) { - archiveLoadAdapter = new EARComponentArchiveLoadAdapter(virtualComponent); - type = J2EEVersionConstants.APPLICATION_TYPE; - } else if (J2EEProjectUtilities.isEJBComponent(virtualComponent)) { - archiveLoadAdapter = new EJBComponentArchiveLoadAdapter(virtualComponent); - type = J2EEVersionConstants.EJB_TYPE; - } else if (J2EEProjectUtilities.isApplicationClientComponent(virtualComponent)) { - archiveLoadAdapter = new AppClientComponentArchiveLoadAdapter(virtualComponent); - type = J2EEVersionConstants.APPLICATION_CLIENT_TYPE; - } else if (J2EEProjectUtilities.isJCAComponent(virtualComponent)) { - archiveLoadAdapter = new ConnectorComponentArchiveLoadAdapter(virtualComponent); - type = J2EEVersionConstants.CONNECTOR_TYPE; - } else if (J2EEProjectUtilities.isDynamicWebComponent(virtualComponent)) { - archiveLoadAdapter = new WebComponentArchiveLoadAdapter(virtualComponent); - type = J2EEVersionConstants.WEB_TYPE; - } else if (J2EEProjectUtilities.isUtilityProject(virtualComponent.getProject())) { - archiveLoadAdapter = new JavaComponentArchiveLoadAdapter(virtualComponent); - } - - if (archiveLoadAdapter != null) { - ArchiveOptions options = new ArchiveOptions(); - options.setOption(ArchiveOptions.LOAD_ADAPTER, archiveLoadAdapter); - IArchive archive = super.openArchive(options); - if (type != J2EEVersionConstants.UNKNOWN) { - int version = J2EEVersionConstants.UNKNOWN; - String versionStr = J2EEProjectUtilities.getJ2EEProjectVersion(virtualComponent.getProject()); - switch (type) { - case J2EEVersionConstants.APPLICATION_CLIENT_TYPE: - case J2EEVersionConstants.APPLICATION_TYPE: - if (versionStr.equals(J2EEVersionConstants.VERSION_1_2_TEXT)) { - version = J2EEVersionConstants.J2EE_1_2_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_1_3_TEXT)) { - version = J2EEVersionConstants.J2EE_1_3_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_1_4_TEXT)) { - version = J2EEVersionConstants.J2EE_1_4_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) { - version = J2EEVersionConstants.JEE_5_0_ID; - } - break; - case J2EEVersionConstants.CONNECTOR_TYPE: - if (versionStr.equals(J2EEVersionConstants.VERSION_1_0_TEXT)) { - version = J2EEVersionConstants.JCA_1_0_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_1_5_TEXT)) { - version = J2EEVersionConstants.JCA_1_5_ID; - } - break; - case J2EEVersionConstants.EJB_TYPE: - if (versionStr.equals(J2EEVersionConstants.VERSION_1_1_TEXT)) { - version = J2EEVersionConstants.EJB_1_1_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_2_0_TEXT)) { - version = J2EEVersionConstants.EJB_2_0_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_2_1_TEXT)) { - version = J2EEVersionConstants.EJB_2_1_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) { - version = J2EEVersionConstants.EJB_3_0_ID; - } - break; - case J2EEVersionConstants.WEB_TYPE: - if (versionStr.equals(J2EEVersionConstants.VERSION_2_2_TEXT)) { - version = J2EEVersionConstants.WEB_2_2_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_2_3_TEXT)) { - version = J2EEVersionConstants.WEB_2_3_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_2_4_TEXT)) { - version = J2EEVersionConstants.WEB_2_4_ID; - } else if (versionStr.equals(J2EEVersionConstants.VERSION_2_5_TEXT)) { - version = J2EEVersionConstants.WEB_2_5_ID; - } - break; - } - if (version != J2EEVersionConstants.UNKNOWN) { - archiveToJavaEEQuickPeek.put(archive, new JavaEEQuickPeek(type, version)); - } - } - return archive; - } - return null; - } - - private Map<IArchive, JavaEEQuickPeek> archiveToJavaEEQuickPeek = new WeakHashMap<IArchive, JavaEEQuickPeek>(); - - /** - * Returns a utility for getting the type of Java EE archive, the Java EE version, and the - * Module version - * - * @param archive - * @return - */ - public JavaEEQuickPeek getJavaEEQuickPeek(IArchive archive) { - if (archiveToJavaEEQuickPeek.containsKey(archive)) { - return archiveToJavaEEQuickPeek.get(archive); - } else { - String[] deploymentDescriptorsToCheck = new String[] { J2EEConstants.APPLICATION_DD_URI, J2EEConstants.APP_CLIENT_DD_URI, J2EEConstants.EJBJAR_DD_URI, J2EEConstants.WEBAPP_DD_URI, - J2EEConstants.RAR_DD_URI }; - for (int i = 0; i < deploymentDescriptorsToCheck.length; i++) { - final IPath deploymentDescriptorPath = new Path(deploymentDescriptorsToCheck[i]); - if (archive.containsArchiveResource(deploymentDescriptorPath)) { - InputStream in = null; - IArchiveResource dd; - try { - dd = archive.getArchiveResource(deploymentDescriptorPath); - in = dd.getInputStream(); - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(in); - archiveToJavaEEQuickPeek.put(archive, quickPeek); - return quickPeek; - } catch (FileNotFoundException e) { - ArchiveUtil.warn(e); - } catch (IOException e) { - ArchiveUtil.warn(e); - } - } - } - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(null); - archiveToJavaEEQuickPeek.put(archive, quickPeek); - return quickPeek; - } - } - - /** - * Returns an IArchive. This method will attempt to discriminate the - * specific Java EE archive type based on the following simple rules. Please - * note that these rules do not adhere exactly to the Java EE specification - * because they are written for a tooling environment rather than a runtime - * environment. Thus these rules attempt to compensate for user error with - * the understanding that other areas of the tooling environment will help - * detect and correct these errors. - * - * <ol> - * <li> An archive containing a deployment descriptor is considered to be of - * that type </li> - * <li> An archive whose name ends with '.ear' is considered an EAR </li> - * <li> An archive whose name ends with '.war' is considered a WAR </li> - * <li> An archive whose name ends with '.jar' and which contains a - * META-INF/MANIFEST.MF file containing a Main-class attribute is considered - * an Application Client </li> - * <li> If the ArchiveOptions specify the - * {@link #DISCRIMINATE_EJB_ANNOTATIONS} as Boolean.TRUE then if the archive - * contains any .class file with EJB annotations it is considered an EJB - * JAR. Be warned that this full check does have performance implications - * and is not done by default.</li> - * An archive whose name ends with '.jar' is considered a Utility </li> - * </ol> - */ - public IArchive openArchive(ArchiveOptions archiveOptions) throws ArchiveOpenFailureException { - IArchive simpleArchive = super.openArchive(archiveOptions); - Object discriminateJavaEE = archiveOptions.getOption(DISCRIMINATE_JAVA_EE); - if(discriminateJavaEE != null && !((Boolean)discriminateJavaEE).booleanValue()){ - return simpleArchive; - } - return refineForJavaEE(simpleArchive); - } - - private static final String DOT_EAR = ".ear";//$NON-NLS-1$ - - private static final String DOT_WAR = ".war";//$NON-NLS-1$ - - private static final String DOT_JAR = ".jar";//$NON-NLS-1$ - - private IArchive refineForJavaEE(final IArchive simpleArchive) { - String[] deploymentDescriptorsToCheck = new String[] { J2EEConstants.APPLICATION_DD_URI, J2EEConstants.APP_CLIENT_DD_URI, J2EEConstants.EJBJAR_DD_URI, J2EEConstants.WEBAPP_DD_URI, - J2EEConstants.RAR_DD_URI }; - int[] typeToVerify = new int[] { J2EEVersionConstants.APPLICATION_TYPE, J2EEVersionConstants.APPLICATION_CLIENT_TYPE, J2EEVersionConstants.EJB_TYPE, J2EEVersionConstants.WEB_TYPE, - J2EEConstants.CONNECTOR_TYPE }; - for (int i = 0; i < deploymentDescriptorsToCheck.length; i++) { - final IPath deploymentDescriptorPath = new Path(deploymentDescriptorsToCheck[i]); - if (simpleArchive.containsArchiveResource(deploymentDescriptorPath)) { - InputStream in = null; - IArchiveResource dd; - try { - dd = simpleArchive.getArchiveResource(deploymentDescriptorPath); - in = dd.getInputStream(); - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(in); - if (quickPeek.getType() == typeToVerify[i] && quickPeek.getVersion() != JavaEEQuickPeek.UNKNOWN && !simpleArchive.containsModelObject(deploymentDescriptorPath)) { - archiveToJavaEEQuickPeek.put(simpleArchive, quickPeek); - wrapArchive(simpleArchive, deploymentDescriptorPath); - return simpleArchive; - } - } catch (FileNotFoundException e) { - ArchiveUtil.warn(e); - } catch (IOException e) { - ArchiveUtil.warn(e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - ArchiveUtil.warn(e); - } - } - } - } - } - IPath archivePath = simpleArchive.getPath(); - if(archivePath == null){ - Object obj = simpleArchive.getArchiveOptions().getOption(ArchiveOptions.ARCHIVE_PATH); - if(null != obj){ - archivePath = (IPath)obj; - } - } - - if(archivePath != null){ - String lastSegment = archivePath.lastSegment().toLowerCase(); - if(lastSegment.endsWith(DOT_EAR)){ - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(JavaEEQuickPeek.APPLICATION_TYPE, JavaEEQuickPeek.JEE_5_0_ID, JavaEEQuickPeek.JEE_5_0_ID); - archiveToJavaEEQuickPeek.put(simpleArchive, quickPeek); - wrapArchive(simpleArchive, new Path(J2EEConstants.APPLICATION_DD_URI)); - return simpleArchive; - } else if(lastSegment.endsWith(DOT_WAR)){ - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(JavaEEQuickPeek.WEB_TYPE, JavaEEQuickPeek.WEB_2_5_ID, JavaEEQuickPeek.JEE_5_0_ID); - archiveToJavaEEQuickPeek.put(simpleArchive, quickPeek); - wrapArchive(simpleArchive, new Path(J2EEConstants.WEBAPP_DD_URI)); - return simpleArchive; - } else if(lastSegment.endsWith(DOT_JAR)){ - IPath manifestPath = new Path(J2EEConstants.MANIFEST_URI); - if(simpleArchive.containsArchiveResource(manifestPath)){ - InputStream in = null; - try{ - IArchiveResource manifestResource = simpleArchive.getArchiveResource(manifestPath); - in = manifestResource.getInputStream(); - Manifest manifest = new Manifest(in); - Attributes attributes = manifest.getMainAttributes(); - String mainClassName = attributes.getValue("Main-Class"); - if(mainClassName != null){ - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(JavaEEQuickPeek.APPLICATION_CLIENT_TYPE, JavaEEQuickPeek.JEE_5_0_ID, JavaEEQuickPeek.JEE_5_0_ID); - archiveToJavaEEQuickPeek.put(simpleArchive, quickPeek); - wrapArchive(simpleArchive, new Path(J2EEConstants.APPLICATION_DD_URI)); - return simpleArchive; - } - } catch (FileNotFoundException e) { - ArchiveUtil.warn(e); - } catch (IOException e) { - ArchiveUtil.warn(e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - ArchiveUtil.warn(e); - } - } - } - } - Object discriminateEJB30 = simpleArchive.getArchiveOptions().getOption(DISCRIMINATE_EJB_ANNOTATIONS); - if(null == discriminateEJB30 || ((Boolean)discriminateEJB30).booleanValue()){ - if(isEJBArchive(simpleArchive)){ - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(JavaEEQuickPeek.EJB_TYPE, JavaEEQuickPeek.EJB_3_0_ID, JavaEEQuickPeek.JEE_5_0_ID); - archiveToJavaEEQuickPeek.put(simpleArchive, quickPeek); - wrapArchive(simpleArchive, new Path(J2EEConstants.EJBJAR_DD_URI)); - return simpleArchive; - } - } - - } - } - - return simpleArchive; - } - - private static void wrapArchive(final IArchive simpleArchive, final IPath deploymentDescriptorPath) { - final IArchiveLoadAdapter simpleLoadAdapter = simpleArchive.getLoadAdapter(); - - IArchiveLoadAdapter wrappingEMFLoadAdapter = new IArchiveLoadAdapter() { - private JavaEEEMFArchiveAdapterHelper emfHelper = new JavaEEEMFArchiveAdapterHelper(simpleArchive); - - public void close() { - simpleLoadAdapter.close(); - } - - public boolean containsArchiveResource(IPath resourcePath) { - return simpleLoadAdapter.containsArchiveResource(resourcePath); - } - - public boolean containsModelObject(IPath modelObjectPath) { - if (simpleLoadAdapter.containsArchiveResource(modelObjectPath)) { - return true; - } - if (IArchive.EMPTY_MODEL_PATH == modelObjectPath) { - modelObjectPath = deploymentDescriptorPath; - } - return emfHelper.containsModelObject(modelObjectPath); - } - - public IArchiveResource getArchiveResource(IPath resourcePath) throws FileNotFoundException { - return simpleLoadAdapter.getArchiveResource(resourcePath); - } - - public List<IArchiveResource> getArchiveResources() { - return simpleLoadAdapter.getArchiveResources(); - } - - public InputStream getInputStream(IArchiveResource archiveResource) throws IOException, FileNotFoundException { - return simpleLoadAdapter.getInputStream(archiveResource); - } - - public Object getModelObject(IPath modelObjectPath) throws ArchiveModelLoadException { - if (simpleLoadAdapter.containsModelObject(modelObjectPath)) { - return simpleLoadAdapter.getModelObject(modelObjectPath); - } - if (IArchive.EMPTY_MODEL_PATH == modelObjectPath) { - modelObjectPath = deploymentDescriptorPath; - } - return emfHelper.getModelObject(modelObjectPath); - } - - public IArchive getArchive() { - return simpleLoadAdapter.getArchive(); - } - - public void setArchive(IArchive archive) { - simpleLoadAdapter.setArchive(archive); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(JavaEEArchiveUtilities.class.getName()); - buffer.append(" wrapping: "); - buffer.append(simpleLoadAdapter.toString()); - return buffer.toString(); - } - }; - simpleArchive.getArchiveOptions().setOption(ArchiveOptions.LOAD_ADAPTER, wrappingEMFLoadAdapter); - ((ArchiveImpl) simpleArchive).setLoadAdapter(wrappingEMFLoadAdapter); - } - - private static final char[] RUNTIME_VISIBLE = "RuntimeVisibleAnnotations".toCharArray(); //$NON-NLS-1$ - - private static final char[] STATELESS = "Ljavax/ejb/Stateless;".toCharArray();//$NON-NLS-1$ - - private static final char[] STATEFUL = "Ljavax/ejb/Stateful;".toCharArray();//$NON-NLS-1$ - - private static final char[] MESSAGEDRIVEN = "Ljavax/ejb/MessageDriven;".toCharArray();//$NON-NLS-1$ - - public boolean isEJBArchive(IArchive archive) { - // first check for the deployment descriptor - if (archiveToJavaEEQuickPeek.containsKey(archive)) { - JavaEEQuickPeek qp = JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archive); - if (qp.getType() == JavaEEQuickPeek.EJB_TYPE) { - return true; - } - } - - List<IArchiveResource> archiveResources = archive.getArchiveResources(); - for (IArchiveResource archiveResource : archiveResources) { - if (archiveResource.getType() == IArchiveResource.FILE_TYPE) { - if (archiveResource.getPath().lastSegment().endsWith(DOT_CLASS)) { - InputStream ioStream = null; - try { - ioStream = archiveResource.getInputStream(); - IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(ioStream, IClassFileReader.CLASSFILE_ATTRIBUTES); - IClassFileAttribute[] attributes = classFileReader.getAttributes(); - for (IClassFileAttribute attribute : attributes) { - char[] attributeName = attribute.getAttributeName(); - if (Arrays.equals(attributeName, RUNTIME_VISIBLE)) { - IRuntimeVisibleAnnotationsAttribute annotationsAttribute = (IRuntimeVisibleAnnotationsAttribute) attribute; - IAnnotation[] annotations = annotationsAttribute.getAnnotations(); - for (IAnnotation annotation : annotations) { - char[] typedName = annotation.getTypeName(); - if (Arrays.equals(typedName, STATELESS) || Arrays.equals(typedName, STATEFUL) || Arrays.equals(typedName, MESSAGEDRIVEN)) { - return true; - } - } - } - } - } catch (FileNotFoundException e) { - ArchiveUtil.warn(e); - } catch (IOException e) { - ArchiveUtil.warn(e); - } finally { - if (null != ioStream) { - try { - ioStream.close(); - } catch (IOException e) { - ArchiveUtil.warn(e); - } - } - ioStream = null; - } - } - } - } - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEEMFArchiveAdapterHelper.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEEMFArchiveAdapterHelper.java deleted file mode 100644 index 5127cd70f..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEEMFArchiveAdapterHelper.java +++ /dev/null @@ -1,254 +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.j2ee.internal.archive; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.content.IContentDescription; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.ContentHandler; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.jst.jee.archive.ArchiveModelLoadException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.jst.jee.archive.internal.ArchiveURIConverter; -import org.eclipse.jst.jee.archive.internal.ArchiveUtil; -import org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry; -import org.eclipse.wst.common.internal.emf.resource.EMF2SAXRendererFactory; -import org.eclipse.wst.common.internal.emf.resource.IRootObjectResource; -import org.eclipse.wst.common.internal.emf.resource.RendererFactory; -import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceFactory; - -public class JavaEEEMFArchiveAdapterHelper { - - // TODO may not need this - private class EMFAddapter extends AdapterImpl { - }; - - protected ResourceSet resourceSet; - - private EMFAddapter adapter = null; - - private IArchive archive = null; - - public JavaEEEMFArchiveAdapterHelper() { - } - - public JavaEEEMFArchiveAdapterHelper(IArchive anArchive) { - setArchive(anArchive); - } - - public void setArchive(IArchive anArchive) { - this.archive = anArchive; - } - - public IArchive getArchive() { - return archive; - } - - public boolean containsModelObject(IPath modelObjectPath) { - IArchive archive = getArchive(); - if (archive.containsArchiveResource(modelObjectPath)) { - URI uri = getArchiveURIConverter().getURI(modelObjectPath); - return containsResource(uri); - } - return false; - } - - protected boolean containsResource(URI uri) { - // TODO figure out a way to figure this out without actually - // loading the resource - IRootObjectResource resource = (IRootObjectResource) getResourceSet().getResource(uri, true); - if (resource != null && resource.getRootObject() != null) { - return true; - } - return false; - } - - protected ArchiveURIConverter archiveURIConverter; - - public void setArchiveURIConverter(ArchiveURIConverter archiveURIConverter) { - this.archiveURIConverter = archiveURIConverter; - } - - public ArchiveURIConverter getArchiveURIConverter() { - if (archiveURIConverter == null) { - archiveURIConverter = new ArchiveURIConverter(getArchive()); - } - return archiveURIConverter; - } - - public Object getModelObject(IPath modelObjectPath) throws ArchiveModelLoadException { - URI uri = getArchiveURIConverter().getURI(modelObjectPath); - IRootObjectResource resource = (IRootObjectResource) getResourceSet().getResource(uri, true); - return resource.getRootObject(); - } - - // public Object getModelObject(IPath modelObjectPath) throws - // ArchiveModelLoadException { - // URI uri = getArchiveURIConverter().getURI(modelObjectPath); - // return getResourceSet().getResource(uri, true); - // } - - public ResourceSet getResourceSet() { - if (resourceSet == null) { - initializeResourceSet(); - if (null == adapter) { - adapter = new EMFAddapter(); - } - resourceSet.eAdapters().add(adapter); - } - return resourceSet; - } - - public void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet newResourceSet) { - if (resourceSet != newResourceSet) { - // remove adapter from old resource set - if (resourceSet != null && adapter != null) { - resourceSet.eAdapters().remove(adapter); - } - // add as adapter to new resource set if necessary - if (newResourceSet != null && !newResourceSet.eAdapters().contains(adapter)) { - if (adapter == null) { - adapter = new EMFAddapter(); - } - newResourceSet.eAdapters().add(adapter); - } - resourceSet = newResourceSet; - } // no need to update if old set equals new set (by reference) - } - - public void initializeResourceSet() { - ResourceSet rs = new ResourceSetImpl() { - private IContentDescription getContentDescription(URI uri) { - IArchiveResource archiveResource = null; - InputStream ioStream = null; - try { - IPath path = getArchiveURIConverter().getPath(uri); - archiveResource = getArchive().getArchiveResource(path); - ioStream = archiveResource.getInputStream(); - IContentDescription description = Platform.getContentTypeManager().getDescriptionFor(ioStream, path.lastSegment(), IContentDescription.ALL); - return description; - } catch (FileNotFoundException e) { - ArchiveUtil.warn(e); - return null; - } catch (IOException e) { - ArchiveUtil.warn(e); - return null; - } finally { - if (ioStream != null) { - try { - ioStream.close(); - } catch (IOException e) { - ArchiveUtil.warn(e); - } - } - } - } - - public Resource createResource(URI uri) { - return createResource(uri, ContentHandler.UNSPECIFIED_CONTENT_TYPE); - } - - public Resource createResource(URI uri, String contentType) { - IContentDescription description = getContentDescription(uri); - - Resource.Factory resourceFactory = null; - if (null != description) { - SAXFactoryKey key = new SAXFactoryKey(uri, description); - resourceFactory = getSAXResourceFactory(key); - if (null == resourceFactory) { - resourceFactory = ((WTPResourceFactoryRegistry) getResourceFactoryRegistry()).getFactory(uri, description); - Class clazz = resourceFactory.getClass(); - boolean isTranslator = false; - while (!isTranslator && clazz != null) { - if (clazz == TranslatorResourceFactory.class) { - isTranslator = true; - } else { - clazz = clazz.getSuperclass(); - } - } - if (isTranslator) { - try { - Constructor constructor = resourceFactory.getClass().getConstructor(RendererFactory.class); - EMF2SAXRendererFactory.INSTANCE.setValidating(false); - resourceFactory = (Resource.Factory) constructor.newInstance(EMF2SAXRendererFactory.INSTANCE); - } catch (SecurityException e) { - ArchiveUtil.warn(e); - } catch (NoSuchMethodException e) { - ArchiveUtil.warn(e); - } catch (IllegalArgumentException e) { - ArchiveUtil.warn(e); - } catch (InstantiationException e) { - ArchiveUtil.warn(e); - } catch (IllegalAccessException e) { - ArchiveUtil.warn(e); - } catch (InvocationTargetException e) { - ArchiveUtil.warn(e); - } - } - setSAXResourceFactory(key, resourceFactory); - } - } else { - resourceFactory = getResourceFactoryRegistry().getFactory(uri); - } - - if (resourceFactory != null) { - Resource result = resourceFactory.createResource(uri); - getResources().add(result); - return result; - } else { - return null; - } - } - }; - rs.setResourceFactoryRegistry(WTPResourceFactoryRegistry.INSTANCE); - rs.setURIConverter(getArchiveURIConverter()); - setResourceSet(rs); - } - - private class SAXFactoryKey { - private URI uri = null; - - private IContentDescription description = null; - - public SAXFactoryKey(URI uri, IContentDescription description) { - this.uri = uri; - this.description = description; - } - } - - private static Map<SAXFactoryKey, Resource.Factory> localFactoryMap = new HashMap<SAXFactoryKey, Resource.Factory>(); - - private static Resource.Factory getSAXResourceFactory(SAXFactoryKey key) { - synchronized (localFactoryMap) { - return localFactoryMap.get(localFactoryMap); - } - } - - private static void setSAXResourceFactory(SAXFactoryKey key, Resource.Factory resourceFactory) { - synchronized (localFactoryMap) { - localFactoryMap.put(key, resourceFactory); - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEEMFZipFileLoadAdapterImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEEMFZipFileLoadAdapterImpl.java deleted file mode 100644 index d406b5dff..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEEMFZipFileLoadAdapterImpl.java +++ /dev/null @@ -1,44 +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.j2ee.internal.archive; - -import java.util.zip.ZipFile; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.jee.archive.ArchiveModelLoadException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.internal.ZipFileArchiveLoadAdapterImpl; - -public class JavaEEEMFZipFileLoadAdapterImpl extends ZipFileArchiveLoadAdapterImpl { - - private JavaEEEMFArchiveAdapterHelper emfHelper = new JavaEEEMFArchiveAdapterHelper(); - - public JavaEEEMFZipFileLoadAdapterImpl() { - super(); - } - - public JavaEEEMFZipFileLoadAdapterImpl(ZipFile zipFile) { - super(zipFile); - } - - public void setArchive(IArchive archive) { - super.setArchive(archive); - emfHelper.setArchive(archive); - } - - public boolean containsModelObject(IPath modelObjectPath) { - return emfHelper.containsModelObject(modelObjectPath); - } - - public Object getModelObject(IPath modelObjectPath) throws ArchiveModelLoadException { - return emfHelper.getModelObject(modelObjectPath); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveLoadAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveLoadAdapter.java deleted file mode 100644 index 2e240d0e9..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveLoadAdapter.java +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.project.ProjectSupportResourceHandler; -import org.eclipse.jst.jee.archive.ArchiveOpenFailureException; -import org.eclipse.jst.jee.archive.ArchiveOptions; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - -public class WebComponentArchiveLoadAdapter extends ComponentArchiveLoadAdapter { - - public static IPath WEBLIB = new Path("/WEB-INF/lib"); //$NON-NLS-1$ - - public WebComponentArchiveLoadAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - - public WebComponentArchiveLoadAdapter(IVirtualComponent vComponent, boolean includeClasspathComponents) { - super(vComponent, includeClasspathComponents); - } - - public List <IArchiveResource> getArchiveResources() { - super.getArchiveResources(); - addLooseLibJARsToFiles(); - return filesHolder.getFiles(); - } - - public IVirtualReference[] getLibModules() { - List <IVirtualReference> result = new ArrayList<IVirtualReference>(); - IVirtualReference[] refComponents = null; - if (!vComponent.isBinary()) - refComponents = ((J2EEModuleVirtualComponent)vComponent).getNonManifestReferences(); - else - refComponents = vComponent.getReferences(); - // Check the deployed path to make sure it has a lib parent folder and matchs the web.xml - // base path - for (int i = 0; i < refComponents.length; i++) { - if (refComponents[i].getRuntimePath().equals(WEBLIB)) - result.add(refComponents[i]); - } - - return (IVirtualReference[]) result.toArray(new IVirtualReference[result.size()]); - - } - - public void addLooseLibJARsToFiles() { - IVirtualReference[] libModules = getLibModules(); - for (int i = 0; i < libModules.length; i++) { - IVirtualReference iLibModule = libModules[i]; - IVirtualComponent looseComponent = iLibModule.getReferencedComponent(); - if (looseComponent.isBinary()) { - VirtualArchiveComponent archiveComp = (VirtualArchiveComponent) looseComponent; - java.io.File diskFile = archiveComp.getUnderlyingDiskFile(); - if (!diskFile.exists()) { - IFile wbFile = archiveComp.getUnderlyingWorkbenchFile(); - diskFile = new File(wbFile.getLocation().toOSString()); - } - IPath uri = iLibModule.getRuntimePath().makeRelative().append("/" + diskFile.getName()); //$NON-NLS-1$ - addExternalFile(uri, diskFile); - } else { - String name = null; - String archiveName = iLibModule.getArchiveName(); - if (archiveName != null && archiveName.length() > 0) { - name = archiveName; - } else { - name = looseComponent.getName() + ".jar"; //$NON-NLS-1$ - } - String prefix = iLibModule.getRuntimePath().makeRelative().toString(); - if (prefix.length() > 0 && prefix.charAt(prefix.length() - 1)!= '/') { - prefix += "/"; //$NON-NLS-1$ - } - - addClasspathComponentDependencies(looseComponent); - String uri = prefix + name; - - try { - JavaComponentArchiveLoadAdapter archiveLoadAdapter = new JavaComponentArchiveLoadAdapter(looseComponent); - archiveLoadAdapter.setExportSource(isExportSource()); - ArchiveOptions webLibOptions = new ArchiveOptions(); - webLibOptions.setOption(ArchiveOptions.LOAD_ADAPTER, archiveLoadAdapter); - IArchive webLibArchive; - webLibArchive = JavaEEArchiveUtilities.INSTANCE.openArchive(webLibOptions); - webLibArchive.setPath(new Path(uri)); - webLibArchive.setArchive(archive); - filesHolder.addFile(webLibArchive); - } catch (ArchiveOpenFailureException e) { - String message = ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.UNABLE_TO_LOAD_MODULE_ERROR_, new Object[]{uri, getComponent().getProject().getName(), e.getMessage()}); - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logTrace(message); - } - } - } - } - - private void addClasspathComponentDependencies(final IVirtualComponent referencedComponent) { - // retrieve all Java classpath component dependencies - if (includeClasspathComponents && referencedComponent instanceof J2EEModuleVirtualComponent) { - final IVirtualReference[] cpRefs = ((J2EEModuleVirtualComponent) referencedComponent).getJavaClasspathReferences(); - for (int j = 0; j < cpRefs.length; j++) { - final IVirtualReference ref = cpRefs[j]; - final IPath runtimePath = ref.getRuntimePath(); - - // only process ../ mappings - if (ref.getReferencedComponent() instanceof VirtualArchiveComponent - && runtimePath.equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - final VirtualArchiveComponent comp = (VirtualArchiveComponent) ref.getReferencedComponent(); - File cpEntryFile = comp.getUnderlyingDiskFile(); - if (!cpEntryFile.exists()) { - final IFile wbFile = comp.getUnderlyingWorkbenchFile(); - cpEntryFile = new File(wbFile.getLocation().toOSString()); - } - addExternalFile(new Path("WEB-INF/lib/" + ref.getArchiveName()), cpEntryFile); - } - } - } - } - - @Override - protected IPath getDefaultModelObjectPath() { - return new Path(J2EEConstants.WEBAPP_DD_URI); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveSaveAdapter.java deleted file mode 100644 index c1531f57e..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveSaveAdapter.java +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive; - -import java.io.FileNotFoundException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.jee.archive.IArchiveResource; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; - -public class WebComponentArchiveSaveAdapter extends J2EEComponentArchiveSaveAdapter { - - private IPath IMPORTED_CLASSES_PATH = new Path("/" + ArchiveConstants.WEBAPP_CLASSES_URI); - - public WebComponentArchiveSaveAdapter(IVirtualComponent vComponent) { - super(vComponent); - } - - protected boolean shouldAddImportedClassesToClasspath() { - return false; // never add to classpath because the web app container will pick this up. - } - - protected IPath getImportedClassesURI(IArchiveResource aFile){ - return aFile.getPath().makeRelative().removeFirstSegments(IMPORTED_CLASSES_PATH.segmentCount()); - } - - protected IPath getImportedClassesRuntimePath() { - return IMPORTED_CLASSES_PATH; - } - - protected IPath getProjectRelativePath(IArchiveResource aFile) { - if (null != nonStandardSourceFiles && nonStandardSourceFiles.containsKey(aFile)) { - IPath path = nonStandardSourceFiles.get(aFile); - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualFile vFile = rootFolder.getFile(path); - IFile iFile = vFile.getUnderlyingFile(); - return iFile.getProjectRelativePath(); - } - return super.getProjectRelativePath(aFile); - } - - /** - * This map handles the case when a java source file is not in the same place as the .class - * file. For example if all the source files were contained in WEB-INF/source - */ - protected Map<IArchiveResource, IPath> nonStandardSourceFiles; - - protected boolean isClassWithoutSource(IArchiveResource aFile) { - String javaUri = ArchiveUtil.classUriToJavaUri(aFile.getPath().toString()); - if (javaUri == null) - return true; - IPath javaPath = new Path(javaUri); - if (archive.containsArchiveResource(javaPath)) { - return false; - } - // see if it is a JSP - String jspUri = javaUri.substring(0, javaUri.indexOf(ArchiveUtil.DOT_JAVA)); - int lastSlash = jspUri.lastIndexOf('/'); - int _index = lastSlash == -1 ? ArchiveConstants.WEBAPP_CLASSES_URI.length() : lastSlash + 1; - if (jspUri.charAt(_index) == '_') { - jspUri = jspUri.substring(ArchiveConstants.WEBAPP_CLASSES_URI.length(), _index) + jspUri.substring(_index + 1) + ArchiveUtil.DOT_JSP; - IPath jspPath = new Path(jspUri); - if (archive.containsArchiveResource(jspPath)) { - return false; - } - } - - //This is to handle archives created by an earlier version - //The format was to include the source files in a directory called source in WEB-INF - //Example: class is in WEB-INF/classes/test/Foo.class - // source is in WEB-INF/source/test/Foo.java - if(javaPath.segmentCount() > 2 && javaPath.segment(0).equals("WEB-INF") && javaPath.segment(1).equals("classes")){ - String alternateJavaUri = javaUri.replaceFirst("classes", "source"); - IPath alternateJavaPath = new Path(alternateJavaUri); - if (archive.containsArchiveResource(alternateJavaPath)){ - IArchiveResource sourceFile; - try { - sourceFile = archive.getArchiveResource(alternateJavaPath); - if(sourceFile != null){ - if (nonStandardSourceFiles == null) { - nonStandardSourceFiles = new HashMap<IArchiveResource, IPath>(); - } - if (!nonStandardSourceFiles.containsKey(sourceFile)) { - nonStandardSourceFiles.put(sourceFile, javaPath); - } - return false; - } - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - } - - return true; - } - - @Override - protected List<IArchiveResource> getArchiveResourcesForSave() { - List <IArchiveResource> sortedFiles = new ArrayList <IArchiveResource>(); - int classIndex = 0; - for(IArchiveResource resource : super.getArchiveResourcesForSave()){ - if(resource.getPath().lastSegment().endsWith(DOT_CLASS)){ - sortedFiles.add(classIndex++, resource); - } - else { - sortedFiles.add(resource); - } - } - return sortedFiles; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveTypeHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveTypeHandler.java deleted file mode 100644 index 5a239dc08..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveTypeHandler.java +++ /dev/null @@ -1,31 +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.j2ee.internal.archive; - -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveHandler; - -public class WebComponentArchiveTypeHandler implements IArchiveHandler { - - public boolean handlesArchive(IArchive archive) { - if (archive.getLoadAdapter() instanceof WebComponentArchiveLoadAdapter) { - return true; - } else if (archive.containsArchiveResource(new Path(J2EEConstants.WEBAPP_DD_URI))) { - return true; - } else { - // TODO handle the no DD case - return false; - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientArchiveOpsResourceHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientArchiveOpsResourceHandler.java deleted file mode 100644 index 8111e913d..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientArchiveOpsResourceHandler.java +++ /dev/null @@ -1,40 +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.internal.archive.operations; - -import org.eclipse.osgi.util.NLS; - -public final class AppClientArchiveOpsResourceHandler extends NLS { - - private static final String BUNDLE_NAME = "appclientarchiveops";//$NON-NLS-1$ - - private AppClientArchiveOpsResourceHandler() { - // Do not instantiate - } - - public static String ARCHIVE_OPERATION_SaveFile; - public static String ARCHIVE_OPERATION_ProjectNature; - public static String ARCHIVE_OPERATION_SaveManifest; - public static String ARCHIVE_OPERATION_FileNotFound; - public static String ARCHIVE_OPERATION_OpeningArchive; - public static String ARCHIVE_OPERATION_ImportOperation; - public static String IMPORT_MOFRESOURCE_STRING; - public static String APPCLIENT_IMPORT_OPERATION_STRING; - public static String APPCLIENT_IMPORT_FILE_STRING; - public static String APPCLIENT_IMPORT_ERROR; - public static String ARCHIVE_OPERATION_ErrorOccured; - public static String Application_Client_File_UI_; - public static String _c__Copyright_IBM_Corporation_2001_1; - - static { - NLS.initializeMessages(BUNDLE_NAME, AppClientArchiveOpsResourceHandler.class); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentExportOperation.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentExportOperation.java deleted file mode 100644 index 571c5f745..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentExportOperation.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class AppClientComponentExportOperation extends J2EEArtifactExportOperation { - - public AppClientComponentExportOperation(IDataModel model) { - super(model); - } - - public void export() throws SaveFailureException, CoreException, InvocationTargetException, InterruptedException { - IProgressMonitor subMonitor = new SubProgressMonitor(progressMonitor, EXPORT_WORK); - IArchive archiveFromComponent = null; - try { - archiveFromComponent = JavaEEArchiveUtilities.INSTANCE.openArchive(getComponent()); - JavaEEQuickPeek quickPeek = JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archiveFromComponent); - if (quickPeek.getJavaEEVersion() == J2EEConstants.JEE_5_0_ID) { - saveArchive(archiveFromComponent, getDestinationPath().toOSString(), subMonitor); - } else { - CommonarchiveFactory caf = ((CommonarchivePackage) EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI)).getCommonarchiveFactory(); - AppClientComponentLoadStrategyImpl ls = new AppClientComponentLoadStrategyImpl(getComponent()); - ls.setExportSource(isExportSource()); - setModuleFile(caf.openApplicationClientFile(ls, getDestinationPath().toOSString())); - ls.setProgressMonitor(subMonitor); - getModuleFile().saveAsNoReopen(getDestinationPath().toOSString()); - } - } catch (SaveFailureException ex) { - throw ex; - } catch (Exception e) { - throw new SaveFailureException(AppClientArchiveOpsResourceHandler.ARCHIVE_OPERATION_OpeningArchive, e); - } finally { - if (archiveFromComponent != null) - JavaEEArchiveUtilities.INSTANCE.closeArchive(archiveFromComponent); - subMonitor.done(); - } - } - - protected String archiveString() { - return AppClientArchiveOpsResourceHandler.Application_Client_File_UI_; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentImportOperation.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentImportOperation.java deleted file mode 100644 index 47c226fd7..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentImportOperation.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy; -import org.eclipse.jst.j2ee.internal.archive.AppClientComponentArchiveSaveAdapter; -import org.eclipse.jst.j2ee.internal.archive.ComponentArchiveSaveAdapter; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class AppClientComponentImportOperation extends J2EEArtifactImportOperation { - - public AppClientComponentImportOperation(IDataModel model) { - super(model); - } - - protected SaveStrategy createSaveStrategy(IVirtualComponent virtualComponent) { - AppClientComponentSaveStrategyImpl saveStrat = new AppClientComponentSaveStrategyImpl(virtualComponent); - return saveStrat; - } - - protected ComponentArchiveSaveAdapter getArchiveSaveAdapter(IVirtualComponent virtualComponent) { - return new AppClientComponentArchiveSaveAdapter(virtualComponent); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentLoadStrategyImpl.java deleted file mode 100644 index 1b3c78b0e..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentLoadStrategyImpl.java +++ /dev/null @@ -1,30 +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.internal.archive.operations; - -import org.eclipse.jst.j2ee.applicationclient.componentcore.util.AppClientArtifactEdit; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class AppClientComponentLoadStrategyImpl extends ComponentLoadStrategyImpl { - - public AppClientComponentLoadStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - - protected synchronized ArtifactEdit getArtifactEditForRead() { - if(artifactEdit == null){ - artifactEdit = AppClientArtifactEdit.getAppClientArtifactEditForRead(vComponent); - } - return artifactEdit; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentSaveStrategyImpl.java deleted file mode 100644 index 7c769bd1e..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/AppClientComponentSaveStrategyImpl.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.internal.archive.operations; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class AppClientComponentSaveStrategyImpl extends J2EEComponentSaveStrategyImpl { - - public AppClientComponentSaveStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ComponentLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ComponentLoadStrategyImpl.java deleted file mode 100644 index 69083f695..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ComponentLoadStrategyImpl.java +++ /dev/null @@ -1,664 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; - -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.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIteratorImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ContainerImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategyImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyManifestUtil; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.internal.project.ProjectSupportResourceHandler; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.UnresolveableURIException; -import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel; -import org.eclipse.wst.common.componentcore.internal.ComponentResource; -import org.eclipse.wst.common.componentcore.internal.DependencyType; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualContainer; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.componentcore.resources.IVirtualResource; - -public abstract class ComponentLoadStrategyImpl extends LoadStrategyImpl { - - protected static final String DOT_PROJECT = ".project"; //$NON-NLS-1$ - protected static final String DOT_CLASSPATH = ".classpath"; //$NON-NLS-1$ - protected static final String DOT_SETTINGS = ".settings"; //$NON-NLS-1$ - protected static final String DOT_CVS_IGORE = ".cvsignore"; //$NON-NLS-1$ - - protected IVirtualComponent vComponent; - protected boolean exportSource; - protected ArtifactEdit artifactEdit; - private List zipFiles = new ArrayList(); - private List javaClasspathURIs = new ArrayList(); - protected boolean includeClasspathComponents = true; - - protected class FilesHolder { - - private Map urisToFiles = new HashMap(); - private Map urisToResources = new HashMap(); - private Map resourcesToURI = new HashMap(); - private Map urisToDiskFiles; - private Map urisToZipEntry = new HashMap(); - - public void removeIFile(IFile file) { - String uri = (String) resourcesToURI.get(file); - remove(uri); - } - - public void remove(String uri) { - urisToFiles.remove(uri); - Object resource = urisToResources.remove(uri); - if (resource != null) { - resourcesToURI.remove(resource); - } - if (urisToDiskFiles != null) { - urisToDiskFiles.remove(uri); - } - } - - public void addDirectory(File directory) { - String uri = directory.getURI(); - urisToFiles.put(uri, directory); - } - - public void addFile(File file) { - String uri = file.getURI(); - urisToFiles.put(uri, file); - } - - public void addFile(File file, java.io.File externalDiskFile) { - String uri = file.getURI(); - urisToFiles.put(uri, file); - if (null == urisToDiskFiles) { - urisToDiskFiles = new HashMap(); - } - urisToDiskFiles.put(uri, externalDiskFile); - } - - public void addFile(File file, IResource resource) { - String uri = file.getURI(); - urisToFiles.put(uri, file); - urisToResources.put(uri, resource); - } - - public InputStream getInputStream(String uri) throws IOException, FileNotFoundException { - java.io.File diskFile = null; - - if (urisToDiskFiles != null && urisToDiskFiles.containsKey(uri)) { - diskFile = (java.io.File) urisToDiskFiles.get(uri); - } else if (urisToResources != null && urisToResources.containsKey(uri)) { - IResource resource = (IResource) urisToResources.get(uri); - diskFile = new java.io.File(resource.getLocation().toOSString()); - } else { - Map fileURIMap = (Map) urisToZipEntry.get(uri); - Iterator it = fileURIMap.keySet().iterator(); - - String sourceFileUri = ""; //$NON-NLS-1$ - ZipFile zipFile = null; - - // there is only one key, pair - while (it.hasNext()) { - sourceFileUri = (String) it.next(); - zipFile = (ZipFile) fileURIMap.get(sourceFileUri); - } - ZipEntry entry = zipFile.getEntry(sourceFileUri); - InputStream in = zipFile.getInputStream(entry); - return in; - } - return new FileInputStream(diskFile); - } - - public List getFiles() { - return new ArrayList(urisToFiles.values()); - } - - public boolean contains(String uri) { - return urisToFiles.containsKey(uri); - } - - public void addEntry(ZipEntry entry, ZipFile zipFile, IPath runtimePath) { - String uri = runtimePath == null ? null : runtimePath.toString(); - String fileURI = ""; //$NON-NLS-1$ - if (uri != null) { - if (!uri.equals("/")) //$NON-NLS-1$ - fileURI = uri + entry.getName(); - else - fileURI = entry.getName(); - } else { - fileURI = entry.getName(); - } - - File file = createFile(fileURI); - - Map fileURIMap = new HashMap(); - fileURIMap.put(entry.getName(), zipFile); - - urisToZipEntry.put(file.getURI(), fileURIMap); - urisToFiles.put(file.getURI(), file); - } - } - - protected FilesHolder filesHolder; - - private Exception exception; //TEMP TODO REMOVE - - private IVirtualFile manifestFile = null; - - public ComponentLoadStrategyImpl(IVirtualComponent vComponent) { - this(vComponent, true); - } - - public ComponentLoadStrategyImpl(IVirtualComponent vComponent, boolean includeClasspathComponents) { - this.vComponent = vComponent; - filesHolder = new FilesHolder(); - exception = new Exception(); - this.includeClasspathComponents = includeClasspathComponents; - if (includeClasspathComponents) { - this.manifestFile = vComponent.getRootFolder().getFile(new Path(J2EEConstants.MANIFEST_URI)); - saveJavaClasspathReferences(); - } - } - - public boolean contains(String uri) { - IVirtualFolder rootFolder = vComponent.getRootFolder(); - return rootFolder.getFile(new Path(uri)).exists(); - } - - protected void initializeResourceSet() { - resourceSet = WorkbenchResourceHelperBase.getResourceSet(vComponent.getProject()); - } - - protected boolean primContains(String uri) { - return false; - } - - public List getFiles() { - aggregateSourceFiles(); - aggregateClassFiles(); - addUtilities(); - return filesHolder.getFiles(); - } - - protected void saveJavaClasspathReferences() { - if (vComponent instanceof J2EEModuleVirtualComponent) { - final J2EEModuleVirtualComponent j2eeComp = (J2EEModuleVirtualComponent) vComponent; - final IVirtualReference[] refs = j2eeComp.getJavaClasspathReferences(); - if (refs == null) { - return; - } - for (int i = 0; i < refs.length; i++) { - if (refs[i].getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - javaClasspathURIs.add(refs[i].getArchiveName()); - } - } - } - } - - protected void addUtilities() { - IVirtualReference[] components = vComponent.getReferences(); - for (int i = 0; i < components.length; i++) { - IVirtualReference reference = components[i]; - IVirtualComponent referencedComponent = reference.getReferencedComponent(); - - if (referencedComponent.isBinary() && reference.getDependencyType() == DependencyType.CONSUMES) { - java.io.File diskFile = ((VirtualArchiveComponent) referencedComponent).getUnderlyingDiskFile(); - ZipFile zipFile; - IPath path = reference.getRuntimePath(); - try { - zipFile = new ZipFile(diskFile); - zipFiles.add(zipFile); - Enumeration enumeration = zipFile.entries(); - while (enumeration.hasMoreElements()) { - ZipEntry entry = (ZipEntry) enumeration.nextElement(); - filesHolder.addEntry(entry, zipFile, path); - } - } catch (ZipException e) { - Logger.getLogger().logError(e); - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - } - } - - /** - * This is a cache of the IResource roots for all java source folders and is used by - * {@link #inJavaSrc(IVirtualResource)}. - */ - private IResource[] sourceRoots = null; - - protected void aggregateSourceFiles() { - try { - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualResource[] members = rootFolder.members(); - IPackageFragmentRoot[] srcPkgs = J2EEProjectUtilities.getSourceContainers(vComponent.getProject()); - sourceRoots = new IResource[srcPkgs.length]; - for (int i = 0; i < srcPkgs.length; i++) { - sourceRoots[i] = srcPkgs[i].getCorrespondingResource(); - } - inJavaSrc = false; - aggregateFiles(members); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } - - protected void aggregateClassFiles() { - StructureEdit se = null; - try { - IPackageFragmentRoot[] sourceRoots = J2EEProjectUtilities.getSourceContainers(vComponent.getProject()); - se = StructureEdit.getStructureEditForRead(vComponent.getProject()); - for (int i = 0; i < sourceRoots.length; i++) { - IPath outputPath = sourceRoots[i].getRawClasspathEntry().getOutputLocation(); - if (outputPath == null) { - IProject project = vComponent.getProject(); - if (project.hasNature(JavaCore.NATURE_ID)) { - IJavaProject javaProject = JavaCore.create(project); - outputPath = javaProject.getOutputLocation(); - } - } - - if (outputPath != null) { - IContainer javaOutputContainer = outputPath.segmentCount() > 1 ? (IContainer) ResourcesPlugin.getWorkspace().getRoot().getFolder(outputPath) : (IContainer) ResourcesPlugin.getWorkspace().getRoot().getProject(outputPath.lastSegment()); - IPath runtimePath = null; - try { - ComponentResource[] componentResources = se.findResourcesBySourcePath(sourceRoots[i].getResource().getProjectRelativePath()); - if (componentResources.length > 0) { - IPath tmpRuntimePath = componentResources[0].getRuntimePath(); - IPath tmpSourcePath = componentResources[0].getSourcePath(); - if (!tmpRuntimePath.equals(tmpSourcePath)) { - while (tmpSourcePath.segmentCount() > 0 && tmpRuntimePath.segmentCount() > 0 && tmpRuntimePath.lastSegment().equals(tmpSourcePath.lastSegment())) { - tmpRuntimePath = tmpRuntimePath.removeLastSegments(1); - tmpSourcePath = tmpSourcePath.removeLastSegments(1); - } - if (tmpRuntimePath.segmentCount() != 0) { - runtimePath = tmpRuntimePath.makeRelative(); - } - } - } - } catch (UnresolveableURIException e) { - Logger.getLogger().logError(e); - } - if (null == runtimePath) { - runtimePath = new Path(""); //$NON-NLS-1$ - } - - aggregateOutputFiles(new IResource[]{javaOutputContainer}, runtimePath, javaOutputContainer.getProjectRelativePath().segmentCount()); - } - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } finally { - if (se != null) { - se.dispose(); - } - } - } - - protected boolean aggregateOutputFiles(IResource[] resources, final IPath runtimePathPrefix, int outputFolderSegmentCount) throws CoreException { - boolean fileAdded = false; - for (int i = 0; i < resources.length; i++) { - File cFile = null; - if (!resources[i].exists()) { - continue; - } - // We have to avoid duplicates between the source and output folders (non-java - // resources) - IPath runtimePath = runtimePathPrefix.append(resources[i].getProjectRelativePath().removeFirstSegments(outputFolderSegmentCount)); - String uri = runtimePath == null ? null : runtimePath.toString(); - if (uri == null) - continue; - if (resources[i].getType() == IResource.FILE) { - if (!shouldInclude(uri)) - continue; - cFile = createFile(uri); - cFile.setLastModified(getLastModified(resources[i])); - filesHolder.addFile(cFile, resources[i]); - fileAdded = true; - } else if (shouldInclude((IContainer) resources[i])) { - IResource[] nestedResources = ((IContainer) resources[i]).members(); - aggregateOutputFiles(nestedResources, runtimePathPrefix, outputFolderSegmentCount); - if(!filesHolder.contains(uri)){ - if (!shouldInclude(uri)) - continue; - cFile = createDirectory(uri); - cFile.setLastModified(getLastModified(resources[i])); - filesHolder.addDirectory(cFile); - fileAdded = true; - } - } - } - return fileAdded; - } - - /** - * This is used to track whether {@link #aggregateFiles(IVirtualResource[])} is currently within a Java Source folder. - */ - private boolean inJavaSrc = false; - - protected boolean aggregateFiles(IVirtualResource[] virtualResources) throws CoreException { - boolean fileAdded = false; - for (int i = 0; i < virtualResources.length; i++) { - File cFile = null; - if (!virtualResources[i].exists()) { - continue; - } - // We have to avoid duplicates between the source and output folders (non-java - // resources) - IPath runtimePath = virtualResources[i].getRuntimePath(); - String uri = runtimePath == null ? null : runtimePath.toString(); - if (uri == null) - continue; - if (uri.charAt(0) == IPath.SEPARATOR) { - uri = uri.substring(1); - } - if (filesHolder.contains(uri)) - continue; - - if (virtualResources[i].getType() == IVirtualResource.FILE) { - if (!shouldInclude(uri)) - continue; - IResource resource = virtualResources[i].getUnderlyingResource(); - // want to ignore derived resources nested within Java src directories; this covers the case where - // a user has nested a Java output directory within a Java src directory (note: should ideally be - // respecting Java src path exclusion filters) - if (inJavaSrc && resource.isDerived()) { - continue; - } - cFile = createFile(uri); - cFile.setLastModified(getLastModified(resource)); - filesHolder.addFile(cFile, resource); - fileAdded = true; - } else if (shouldInclude((IVirtualContainer) virtualResources[i])) { - boolean inJavaSrcAtThisLevel = inJavaSrc; - try { - if (!inJavaSrc) { - // if not already inside a Java src dir, check again - inJavaSrc = inJavaSrc(virtualResources[i]); - } - IVirtualResource[] nestedVirtualResources = ((IVirtualContainer) virtualResources[i]).members(); - aggregateFiles(nestedVirtualResources); - if(!filesHolder.contains(uri)){ - if (!shouldInclude(uri)) - continue; - IResource resource = virtualResources[i].getUnderlyingResource(); - if (inJavaSrc && resource.isDerived()) { - continue; - } - cFile = createDirectory(uri); - cFile.setLastModified(getLastModified(resource)); - filesHolder.addDirectory(cFile); - fileAdded = true; - } - } finally { - inJavaSrc = inJavaSrcAtThisLevel; - } - } - } - return fileAdded; - } - - /** - * Determines if the specified IVirtualResource maps to a IResource that is contained within a Java src root. - * @param virtualResource IVirtualResource to check. - * @param sourceRoots Current Java src roots. - * @return True if contained in a Java src root, false otherwise. - */ - private boolean inJavaSrc(final IVirtualResource virtualResource) { - if (sourceRoots.length == 0) { - return false; - } - // all mapped resources must be associated with Java src for the resource to be considered in Java src - final IResource[] resources = virtualResource.getUnderlyingResources(); - boolean inJavaSrc = false; - for (int i = 0; i < resources.length; i++) { - inJavaSrc = false; - for (int j = 0; j < sourceRoots.length; j++) { - if (sourceRoots[j].getFullPath().isPrefixOf(resources[i].getFullPath())) { - inJavaSrc = true; - break; - } - } - // if this one was not in Java src, can break - if (!inJavaSrc) { - break; - } - } - - return inJavaSrc; - } - - protected long getLastModified(IResource aResource) { - return aResource.getLocation().toFile().lastModified(); - } - - public void setExportSource(boolean newExportSource) { - exportSource = newExportSource; - } - - public boolean isExportSource() { - return exportSource; - } - - protected boolean shouldInclude(IContainer aContainer) { - return true; - } - - protected boolean shouldInclude(IVirtualContainer vContainer) { - IContainer iContainer = (IContainer) vContainer.getUnderlyingResource(); - return shouldInclude(iContainer); - } - - protected boolean shouldInclude(String uri) { - if (uri.length() == 0 || DOT_PROJECT.equals(uri) || DOT_CLASSPATH.equals(uri) || uri.endsWith(DOT_CVS_IGORE) || uri.startsWith(DOT_SETTINGS)){ - return false; - } - return isExportSource() || !isSource(uri); - } - - protected boolean isSource(String uri) { - if (uri == null) - return false; - return uri.endsWith(ArchiveUtil.DOT_JAVA) || uri.endsWith(ArchiveUtil.DOT_SQLJ); - } - - protected void addExternalFile(String uri, java.io.File externalDiskFile) { - File aFile = createFile(uri); - filesHolder.addFile(aFile, externalDiskFile); - } - - public InputStream getInputStream(String uri) throws IOException, FileNotFoundException { - // If the MANIFEST.MF of a module component is being requested and that module component references - // Java build path-based components, need to dynamically update the manifest classpath to reflect the resolved - // contributions from the build path - if (includeClasspathComponents && - uri.equals(J2EEConstants.MANIFEST_URI) && !javaClasspathURIs.isEmpty() && - manifestFile != null && manifestFile.getUnderlyingFile() != null && - manifestFile.getUnderlyingFile().exists()) { - //update the manifest classpath for the component - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ClasspathDependencyManifestUtil.updateManifestClasspath(manifestFile.getUnderlyingFile(), javaClasspathURIs, baos); - return new ByteArrayInputStream(baos.toByteArray()); - } - - if (filesHolder.contains(uri)) { - return filesHolder.getInputStream(uri); - } - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualResource vResource = rootFolder.findMember(uri); - String filePath = null; - if (null != vResource && vResource.exists()) { - filePath = vResource.getUnderlyingResource().getLocation().toOSString(); - java.io.File file = new java.io.File(filePath); - return new FileInputStream(file); - } - String eString = EARArchiveOpsResourceHandler.ARCHIVE_OPERATION_FileNotFound; - throw new FileNotFoundException(eString); - } - - public Collection getLoadedMofResources() { - Collection resources = super.getLoadedMofResources(); - Collection resourcesToRemove = new ArrayList(); - Iterator iterator = resources.iterator(); - while (iterator.hasNext()) { - Resource res = (Resource) iterator.next(); - //only remove component files that are in the settings directory - if (res.getURI().toString().endsWith(IModuleConstants.COMPONENT_FILE_NAME) && res.getURI().segmentsList().contains(IModuleConstants.DOT_SETTINGS)) - resourcesToRemove.add(res); - } - if (null != resourcesToRemove) { - resources.removeAll(resourcesToRemove); - } - - return resources; - } - - protected synchronized ArtifactEdit getArtifactEditForRead() { - if(artifactEdit == null){ - artifactEdit = ArtifactEdit.getArtifactEditForRead(vComponent); - } - return artifactEdit; - } - - public Resource getMofResource(String uri) throws FileNotFoundException, ResourceLoadException { - return getArtifactEditForRead().getResource(URI.createURI(uri)); - } - - public boolean isClassLoaderNeeded() { - return false; - } - - public IVirtualComponent getComponent() { - return vComponent; - } - - protected IProgressMonitor monitor = null; - - public void setProgressMonitor(IProgressMonitor monitor){ - this.monitor = monitor; - } - - protected final int FILE_SAVE_WORK = 100; - - public FileIterator getFileIterator() throws IOException { - return new FileIteratorImpl(getContainer().getFiles()){ - protected SubProgressMonitor lastSubMon = null; - boolean firstVisit = true; - - public File next() { - if(firstVisit){ - firstVisit = false; - if(monitor != null){ - monitor.beginTask(ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.Exporting_archive, new Object [] { getContainer().getURI() }), files.size() * FILE_SAVE_WORK); - } - } - if(lastSubMon != null){ - lastSubMon.done(); - lastSubMon = null; - } else if(monitor != null){ - monitor.worked(FILE_SAVE_WORK); - } - File file = super.next(); - if(monitor != null){ - if(file.isContainer() && ComponentLoadStrategyImpl.class.isInstance(((ContainerImpl)file).getLoadStrategy())){ - ComponentLoadStrategyImpl ls = (ComponentLoadStrategyImpl)((ContainerImpl)file).getLoadStrategy(); - lastSubMon = new SubProgressMonitor(monitor, FILE_SAVE_WORK, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); - ls.setProgressMonitor(lastSubMon); - } else { - monitor.subTask(file.getURI()); - } - } - return file; - } - }; - - } - - public void close() { - if(Thread.currentThread().toString().toLowerCase().indexOf("finalizer") != -1){ - System.err.println("Opener of Archive didn't close! "+this); - exception.printStackTrace(System.err); - } - - try{ - Iterator it = zipFiles.iterator(); - while (it.hasNext()) { - ZipFile file = (ZipFile) it.next(); - try { - file.close(); - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - } finally{ - try{ - synchronized(this) { - if(artifactEdit != null){ - ArtifactEditModel editModel = (ArtifactEditModel)artifactEdit.getAdapter(ArtifactEditModel.class); - if(editModel != null && !editModel.isDisposed()){ - artifactEdit.dispose(); - } - artifactEdit = null; - } - } - } finally { - super.close(); - } - } - - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ComponentSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ComponentSaveStrategyImpl.java deleted file mode 100644 index 2c87f6efe..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ComponentSaveStrategyImpl.java +++ /dev/null @@ -1,279 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.archive.operations; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -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.IWorkspaceRoot; -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.emf.ecore.resource.Resource; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -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.internal.DoNotUseMeThisWillBeDeletedPost15; - -public abstract class ComponentSaveStrategyImpl extends SaveStrategyImpl { - - protected IDataModel dataModel; - protected IVirtualComponent vComponent; - protected IOverwriteHandler overwriteHandler; - protected IProgressMonitor progressMonitor; - - private String archiveComponentsDeployPath; - private List archiveComponents; - private Map archiveComponentURIMap; - - public ComponentSaveStrategyImpl(IVirtualComponent vComponent) { - super(); - if (null == vComponent) { - throw new NullPointerException(); - } - this.vComponent = vComponent; - } - - public void setDataModel(IDataModel dataModel) { - this.dataModel = dataModel; - } - - public void setOverwriteHandler(IOverwriteHandler newOverwriteHandler) { - overwriteHandler = newOverwriteHandler; - } - - public void setProgressMonitor(IProgressMonitor newProgressMonitor) { - progressMonitor = newProgressMonitor; - } - - protected void validateEdit(IFile aFile) { - if (overwriteHandler == null) - return; - if (!(aFile.exists() && aFile.isReadOnly())) - return; - - overwriteHandler.validateEdit(aFile); - } - - protected boolean shouldOverwrite(String uri) { - if (overwriteHandler.isOverwriteNone()) - return false; - return (overwriteHandler.isOverwriteResources() || overwriteHandler.isOverwriteAll() || overwriteHandler.shouldOverwrite(uri)); - } - - protected SaveStrategy createNestedSaveStrategy(Archive anArchive) throws IOException { - return null; - } - - protected OutputStream getOutputStreamForResource(Resource aResource) throws IOException { - // this method has no references in the hirarchy - return null; - } - - protected void saveFiles() throws SaveFailureException { - super.saveFiles(); - linkArchiveComponents(); - } - - public void save(File aFile, InputStream in) throws SaveFailureException { - try { - progressMonitor.subTask(aFile.getURI()); - - IPath projectRelativePath = getOutputPathForFile(aFile); - if (aFile.isArchive()) { - saveAsArchiveComponent((Archive) aFile, projectRelativePath, in); - } else if (!aFile.isDirectoryEntry()) { - saveToOutputPath(projectRelativePath, in); - } else { - createDirectory(projectRelativePath); - } - } catch (OverwriteHandlerException ohe) { - throw ohe; - } catch (Exception e) { - String errorString = EJBArchiveOpsResourceHandler.ARCHIVE_OPERATION_SaveFile + aFile.getName(); - throw new SaveFailureException(errorString, e); - } finally { - progressMonitor.worked(1); - } - } - - //TODO this should be renamed to getProjectRelativePath - /** - * Returns the project relative path for where the specified file should be - * saved. - * - * @param aFile - * @return - */ - protected IPath getOutputPathForFile(File aFile) { - String uri = aFile.getURI(); - IFile iFile = null; - if(uri.startsWith(IModuleConstants.DOT_SETTINGS)){ - iFile = vComponent.getProject().getFile(new Path(uri)); - }else { - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualFile vFile = rootFolder.getFile(aFile.getURI()); - iFile = vFile.getUnderlyingFile(); - } - return iFile.getProjectRelativePath(); - } - - //TODO This isn't referenced in WTP it should be deleted. - /** - * @deprecated - */ - protected void saveToWorkbenchPath(IPath workbenchPath, InputStream in) throws Exception { - IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFile(workbenchPath); - saveToIFile(iFile, in); - } - - /** - * Creates the IFolder specified by the project relative path. - * - * @param projectRelativePath - * @throws CoreException - */ - protected void createDirectory(IPath projectRelativePath) throws CoreException { - IFolder iFolder = vComponent.getProject().getFolder(projectRelativePath); - if (!iFolder.exists()) { - mkdirs(iFolder); - } - } - - /** - * Creates the specified IFolder - * - * @param folder - * @throws CoreException - */ - protected void mkdirs(IFolder folder) throws CoreException { - IContainer container = folder.getParent(); - if (!container.exists()) { - mkdirs((IFolder) container); - } - folder.create(true, true, null); - } - - /** - * Save the specified Archive to the specified project relative path - * using the passed input stream. - * - * @param archive - * @param projectRelativePath - * @param in - * @throws Exception - */ - protected void saveAsArchiveComponent(Archive archive, IPath projectRelativePath, InputStream in) throws Exception { - IFile iFile = saveToOutputPathIFile(projectRelativePath, in); - //TODO investigate removing this block and related variables and linkArchiveComponents(); see bugzilla 159160 - if (shouldLinkAsComponentRef(archive)) { - IVirtualComponent archiveComponent = ComponentCore.createArchiveComponent(vComponent.getProject(), VirtualArchiveComponent.LIBARCHIVETYPE + iFile.getFullPath().toString()); - if (archiveComponents == null) { - archiveComponents = new ArrayList(); - archiveComponentURIMap = new HashMap(); - archiveComponentsDeployPath = IPath.SEPARATOR + projectRelativePath.removeLastSegments(1).toString(); - } - archiveComponents.add(archiveComponent); - archiveComponentURIMap.put(archiveComponent, iFile.getName()); - } - } - - protected boolean shouldLinkAsComponentRef(Archive archive) { - return false; - } - - protected void linkArchiveComponents() { - if (archiveComponents != null && archiveComponents.size() > 0) { - IDataModel createReferencesDataModel = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider()); - createReferencesDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, vComponent); - createReferencesDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, archiveComponentsDeployPath); - createReferencesDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, archiveComponents); - createReferencesDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, archiveComponentURIMap); - try { - createReferencesDataModel.getDefaultOperation().execute(null, null); - } catch (ExecutionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - /** - * Saves to the specified project relative output path. Warning this method - * will be changed post 1.5 to return an IFile - * - * @param projectRelativePath - * @param in - * @throws Exception - */ - protected void saveToOutputPath(IPath projectRelativePath, InputStream in) throws Exception { - saveToOutputPathIFile(projectRelativePath, in); - } - - /** - * TODO refactor change the method above to return IFile - * {@link DoNotUseMeThisWillBeDeletedPost15} - */ - protected IFile saveToOutputPathIFile(IPath projectRelativePath, InputStream in) throws Exception { - IFile iFile = vComponent.getProject().getFile(projectRelativePath); - saveToIFile(iFile, in); - return iFile; - } - - - protected void saveToIFile(IFile iFile, InputStream in) throws Exception { - validateEdit(iFile); - if (iFile.exists()) - iFile.setContents(in, true, true, null); - else { - mkdirs(iFile.getFullPath().removeLastSegments(1), ResourcesPlugin.getWorkspace().getRoot()); - iFile.create(in, true, null); - } - } - - - protected void mkdirs(IPath path, IWorkspaceRoot root) throws CoreException { - if (path.segmentCount() <= 1) - return; - IFolder folder = root.getFolder(path); - if (!folder.exists()) { - mkdirs(path.removeLastSegments(1), root); - folder.create(true, true, null); - } - } - - public void save(ArchiveManifest aManifest) throws SaveFailureException { - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ConnectorComponentSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ConnectorComponentSaveStrategyImpl.java deleted file mode 100644 index f0c4e7ae0..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ConnectorComponentSaveStrategyImpl.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.internal.archive.operations; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class ConnectorComponentSaveStrategyImpl extends J2EEComponentSaveStrategyImpl { - - public ConnectorComponentSaveStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/DependentJarExportMerger.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/DependentJarExportMerger.java deleted file mode 100644 index 6c5e888eb..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/DependentJarExportMerger.java +++ /dev/null @@ -1,129 +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.internal.archive.operations; - -import java.util.ArrayList; -import java.util.List; -import java.util.jar.Attributes; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; - -public class DependentJarExportMerger { - protected Archive outgoingArchive; - protected IProject project; - protected List dependentArchives; - protected boolean includeSource; - - /** - * DependentJarExportMerger constructor comment. - */ - public DependentJarExportMerger(Archive archive, IProject aProject, boolean includeSourceFiles) { - super(); - outgoingArchive = archive; - project = aProject; - includeSource = includeSourceFiles; - } - - protected void finalize() throws Throwable { - release(); - } - - public CommonarchiveFactory getArchiveFactory() { - return CommonarchivePackage.eINSTANCE.getCommonarchiveFactory(); - } - - public void merge() { - String[] cp = outgoingArchive.getManifest().getClassPathTokenized(); - dependentArchives = new ArrayList(cp.length); - List keepClassPaths = new ArrayList(); - for (int i = 0; i < cp.length; i++) { - Archive dependentJar = null; - IFile file = null; - try { - file = project.getFile(cp[i]); - } catch (IllegalArgumentException e) { - continue; - } - if (file.exists() && cp[i].endsWith(J2EEImportConstants.IMPORTED_JAR_SUFFIX)) { - try { - dependentJar = getArchiveFactory().primOpenArchive(file.getLocation().toOSString()); - } catch (OpenFailureException ex) { - // Need to write this to the log file - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); - continue; - } - dependentArchives.add(dependentJar); - mergeFiles(dependentJar); - } else - keepClassPaths.add(cp[i]); - } - resetClassPath(keepClassPaths); - } - - protected void mergeFiles(Archive dependentJar) { - List files = dependentJar.getFiles(); - List filesToAdd = new java.util.ArrayList(); - for (int i = 0; i < files.size(); i++) { - File aFile = (File) files.get(i); - if (shouldMerge(aFile)) - filesToAdd.add(aFile); - } - try { - outgoingArchive.addCopyFiles(filesToAdd); - } catch (DuplicateObjectException ignore) { - // Shouldn't happen because we just checked for dups - } - } - - /** - * Clients must call this when done to close the archives - */ - public void release() { - if (dependentArchives == null) - return; - for (int i = 0; i < dependentArchives.size(); i++) { - Archive anArchive = (Archive) dependentArchives.get(i); - if (anArchive.isOpen()) - anArchive.close(); - } - } - - protected void resetClassPath(List cp) { - ArchiveManifest mf = outgoingArchive.getManifest(); - if (cp.isEmpty()) - mf.getMainAttributes().remove(Attributes.Name.CLASS_PATH); - else { - mf.setClassPath("");//$NON-NLS-1$ - for (int i = 0; i < cp.size(); i++) { - mf.appendClassPath((String) cp.get(i)); - } - } - } - - protected boolean shouldMerge(File aFile) { - - String uri = aFile.getURI(); - if (!(uri.endsWith(".java") || uri.endsWith(".class")))//$NON-NLS-2$//$NON-NLS-1$ - return false; - if (!includeSource && uri.endsWith(".java"))//$NON-NLS-1$ - return false; - return !outgoingArchive.containsFile(uri) && !ArchiveConstants.MANIFEST_URI.equals(uri); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARArchiveOpsResourceHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARArchiveOpsResourceHandler.java deleted file mode 100644 index e7403e03a..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARArchiveOpsResourceHandler.java +++ /dev/null @@ -1,49 +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.internal.archive.operations; - -import org.eclipse.osgi.util.NLS; - -public final class EARArchiveOpsResourceHandler extends NLS { - - private static final String BUNDLE_NAME = "eararchiveops";//$NON-NLS-1$ - - private EARArchiveOpsResourceHandler() { - // Do not instantiate - } - - public static String ARCHIVE_OPERATION_SaveMofResources; - public static String ARCHIVE_OPERATION_SaveFile; - public static String ARCHIVE_OPERATION_ProjectNature; - public static String ARCHIVE_OPERATION_SaveManifest; - public static String ARCHIVE_OPERATION_FileNotFound; - public static String ARCHIVE_OPERATION_FileContents; - public static String ARCHIVE_OPERATION_ErroOccured; - public static String ARCHIVE_OPERATION_FilesFromProject; - public static String ARCHIVE_OPERATION_OpeningArchive; - public static String ARCHIVE_OPERATION_ImportOperation; - public static String IMPORT_MOFRESOURCE_STRING; - public static String EAR_IMPORT_FILE_STRING; - public static String ERROR_IMPORTING_EAR_FILE; - public static String ERROR_EXPORTING_EAR_FILE; - public static String IMPORTING_EAR_FILE_UI_; - public static String Updating_project_classpath_UI_; - public static String UNABLE_TO_LOAD_MODULE_ERROR_; - public static String _jar_UI_; - public static String Updating_manifest_Class_Path__attributes_UI_; - public static String _preDeploy_ERROR_; - public static String noRuntimeSelectedLabel; - public static String MISSING_CLIENT_JAR; - - static { - NLS.initializeMessages(BUNDLE_NAME, EARArchiveOpsResourceHandler.class); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentExportOperation.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentExportOperation.java deleted file mode 100644 index e3f94a1cf..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentExportOperation.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class EARComponentExportOperation extends J2EEArtifactExportOperation { - - public EARComponentExportOperation(IDataModel model) { - super(model); - } - - protected void export() throws SaveFailureException, CoreException, InvocationTargetException, InterruptedException { - IProgressMonitor subMonitor = new SubProgressMonitor(progressMonitor, EXPORT_WORK); - IArchive archiveFromComponent = null; - try { - archiveFromComponent = JavaEEArchiveUtilities.INSTANCE.openArchive(getComponent()); - JavaEEQuickPeek quickPeek = JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archiveFromComponent); - if (quickPeek.getJavaEEVersion() == J2EEConstants.JEE_5_0_ID) { - saveArchive(archiveFromComponent, getDestinationPath().toOSString(), subMonitor); - } else { - EnterpriseArtifactEdit artifactEdit = null; - try { - artifactEdit = (EnterpriseArtifactEdit) ComponentUtilities.getArtifactEditForRead(getComponent()); - EARFile archive = (EARFile) artifactEdit.asArchive(isExportSource()); - String destination = getDestinationPath().toOSString(); - archive.setURI(destination); - setModuleFile(archive); - ComponentLoadStrategyImpl ls = (ComponentLoadStrategyImpl) archive.getLoadStrategy(); - ls.setProgressMonitor(subMonitor); - archive.saveAsNoReopen(destination); - } catch (SaveFailureException ex) { - throw ex; - } catch (Exception e) { - throw new SaveFailureException(AppClientArchiveOpsResourceHandler.ARCHIVE_OPERATION_OpeningArchive, e); - } finally { - if (null != artifactEdit) { - artifactEdit.dispose(); - } - } - } - } catch (Exception e) { - throw new SaveFailureException(AppClientArchiveOpsResourceHandler.ARCHIVE_OPERATION_OpeningArchive, e); - } finally { - if (archiveFromComponent != null) - JavaEEArchiveUtilities.INSTANCE.closeArchive(archiveFromComponent); - subMonitor.done(); - } - } - - protected void runNecessaryBuilders(IVirtualComponent component, IProgressMonitor monitor) throws CoreException { - try { - IVirtualReference[] refs = component.getReferences(); - int work = (JAVA_BUILDER_WORK + LIB_BUILDER_WORK) / (refs.length + 1); - super.runNecessaryBuilders(component, new SubProgressMonitor(monitor, work)); - for (int i = 0; i < refs.length; i++) { - IVirtualComponent refComp = refs[i].getReferencedComponent(); - super.runNecessaryBuilders(refComp, new SubProgressMonitor(monitor, work)); - } - } finally { - monitor.done(); - } - } - - protected String archiveString() { - return "EAR"; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentImportOperation.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentImportOperation.java deleted file mode 100644 index a1e2a4e36..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentImportOperation.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy; -import org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit; -import org.eclipse.jst.j2ee.datamodel.properties.IEARComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper; -import org.eclipse.jst.j2ee.internal.archive.ComponentArchiveSaveAdapter; -import org.eclipse.jst.j2ee.internal.archive.EARComponentArchiveSaveAdapter; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetProjectCreationDataModelProperties; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class EARComponentImportOperation extends J2EEArtifactImportOperation { - - protected EnterpriseArtifactEdit artifactEdit = null; - - protected final int LINK_COMPONENTS_WORK = 10; - protected final int WEB_LIB_WORK = 10; - protected final int DISPOSE_WORK = 10; - - public EARComponentImportOperation(IDataModel model) { - super(model); - } - - - protected ComponentArchiveSaveAdapter getArchiveSaveAdapter(IVirtualComponent virtualComponent){ - return new EARComponentArchiveSaveAdapter(virtualComponent); - } - - protected int computeTotalWork() { - int baseWork = super.computeTotalWork() + WEB_LIB_WORK + DISPOSE_WORK; - List modelsToImport = (List) model.getProperty(IEARComponentImportDataModelProperties.HANDLED_PROJECT_MODELS_LIST); - IDataModel importModel = null; - for (int i = 0; i < modelsToImport.size(); i++) { - importModel = (IDataModel) modelsToImport.get(i); - ArchiveWrapper nestedArchive = (ArchiveWrapper) importModel.getProperty(IEARComponentImportDataModelProperties.ARCHIVE_WRAPPER); - baseWork += LINK_COMPONENTS_WORK + PROJECT_CREATION_WORK + nestedArchive.getSize(); - } - return baseWork; - } - - /** - * Subclasses must override to performs the workbench modification steps - * that are to be contained within a single logical workbench change. - * - * @param monitor - * the progress monitor to use to display progress - */ - protected void doExecute(IProgressMonitor monitor) throws ExecutionException { - super.doExecute(monitor); - ExecutionException firstNestedException = null; - List modelsToImport = (List) model.getProperty(IEARComponentImportDataModelProperties.HANDLED_PROJECT_MODELS_LIST); - try { - IDataModel importModel = null; - // make sure the wars handle importing their own web libs - for (int i = modelsToImport.size() - 1; i > 0; i--) { - importModel = (IDataModel) modelsToImport.get(i); - ArchiveWrapper nestedArchive = (ArchiveWrapper) importModel.getProperty(IEARComponentImportDataModelProperties.ARCHIVE_WRAPPER); - if (nestedArchive.getPath().toString().startsWith(ArchiveConstants.WEBAPP_LIB_URI)) { - ArchiveWrapper owningWar = (ArchiveWrapper) nestedArchive.getParent(); - modelsToImport.remove(importModel); - for (int j = 0; j < modelsToImport.size(); j++) { - IDataModel warModel = (IDataModel) modelsToImport.get(j); - if (((ArchiveWrapper) (warModel.getProperty(IEARComponentImportDataModelProperties.ARCHIVE_WRAPPER))).getUnderLyingArchive() == owningWar.getUnderLyingArchive()) { - // TODO this is bad, but don't have access to the - // plugin where these - // constants are defined. - String archivesSelected = "WARImportDataModel.WEB_LIB_ARCHIVES_SELECTED"; //$NON-NLS-1$ - String libModels = "WARImportDataModel.WEB_LIB_MODELS"; //$NON-NLS-1$ - List warHandledArchives = (List) warModel.getProperty(archivesSelected); - if (warHandledArchives == Collections.EMPTY_LIST) { - warHandledArchives = new ArrayList(); - warModel.setProperty(archivesSelected, warHandledArchives); - } - warHandledArchives.add(nestedArchive); - List warLibModels = (List) warModel.getProperty(libModels); - for (int k = 0; k < warLibModels.size(); k++) { - IDataModel libModel = (IDataModel) warLibModels.get(k); - if (libModel.getProperty(IJ2EEComponentImportDataModelProperties.ARCHIVE_WRAPPER) == nestedArchive) { - libModel.setProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME, importModel.getProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME)); - libModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, importModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME)); - } - } - } - } - } - } - monitor.worked(WEB_LIB_WORK); - - List <String> ddSpecifiedURIs = ((ArchiveWrapper) model.getProperty(IEARComponentImportDataModelProperties.ARCHIVE_WRAPPER)).getDDMappedModuleURIs(); - List componentToAddAsModules = new ArrayList(); - Map componentToURIMapAsModules = new HashMap(); - List componentToAddAsComponents = new ArrayList(); - Map componentToURIMapAsComponents = new HashMap(); - - for (int i = 0; i < modelsToImport.size(); i++) { - importModel = (IDataModel) modelsToImport.get(i); - ArchiveWrapper nestedArchive = (ArchiveWrapper) importModel.getProperty(IEARComponentImportDataModelProperties.ARCHIVE_WRAPPER); - importModel.setProperty(IJ2EEComponentImportDataModelProperties.CLOSE_ARCHIVE_ON_DISPOSE, Boolean.FALSE); - IDataModel compCreationModel = importModel.getNestedModel(IJ2EEComponentImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION); - if (compCreationModel.isProperty(IJ2EEFacetProjectCreationDataModelProperties.MODULE_URI)) - compCreationModel.setProperty(IJ2EEFacetProjectCreationDataModelProperties.MODULE_URI, nestedArchive.getPath().toString()); - try { - IStatus nestedImportStatus = importModel.getDefaultOperation().execute(new SubProgressMonitor(monitor, PROJECT_CREATION_WORK + nestedArchive.getSize()), info); - if (!nestedImportStatus.isOK() && nestedImportStatus.getSeverity() == IStatus.ERROR) { - throw new ExecutionException(nestedImportStatus.getMessage(), nestedImportStatus.getException()); - } - } catch (ExecutionException e) { - if (firstNestedException == null) { - firstNestedException = e; - } - Logger.getLogger().logError(e); - } - IVirtualComponent component = (IVirtualComponent) importModel.getProperty(IJ2EEComponentImportDataModelProperties.COMPONENT); - String uri = nestedArchive.getPath().toString(); - if(ddSpecifiedURIs.contains(uri)){ - componentToAddAsModules.add(component); - componentToURIMapAsModules.put(component, uri); - } else { - componentToAddAsComponents.add(component); - componentToURIMapAsComponents.put(component, uri); - } - } - - if (componentToAddAsModules.size() > 0) { - //this block adds the component references to the component file and the EAR DD - //this should only be called if the EAR DD already contains the module - //and is necessary to update the id attribute (for the dependency object) - IDataModel addComponentsDM = DataModelFactory.createDataModel(new AddComponentToEnterpriseApplicationDataModelProvider()); - addComponentsDM.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, virtualComponent); - addComponentsDM.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, componentToAddAsModules); - addComponentsDM.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, componentToURIMapAsModules); - addComponentsDM.getDefaultOperation().execute(new SubProgressMonitor(monitor, LINK_COMPONENTS_WORK/2), info); - } - if (componentToAddAsComponents.size() > 0){ - //this block only adds the component references to the component file - //this should only be called when they are not already linked into the EAR DD - IDataModel addComponentsDM = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider()); - addComponentsDM.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, virtualComponent); - addComponentsDM.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, componentToAddAsComponents); - addComponentsDM.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, componentToURIMapAsComponents); - addComponentsDM.getDefaultOperation().execute(new SubProgressMonitor(monitor, LINK_COMPONENTS_WORK/2), info); - } - - } finally { - if (null != artifactEdit) { - artifactEdit.dispose(); - artifactEdit = null; - } - resetDisposeImportModels(); - monitor.worked(DISPOSE_WORK); - } - if (firstNestedException != null) { - throw firstNestedException; - } - } - - /** - * @param modelsToImport - */ - private void resetDisposeImportModels() { - resetDisposeImportModels((List) model.getProperty(IEARComponentImportDataModelProperties.ALL_PROJECT_MODELS_LIST)); - } - - private void resetDisposeImportModels(List models) { - IDataModel model; - for (int i = 0; i < models.size(); i++) { - model = (IDataModel) models.get(i); - model.setProperty(IJ2EEComponentImportDataModelProperties.CLOSE_ARCHIVE_ON_DISPOSE, Boolean.TRUE); - } - } - - protected SaveStrategy createSaveStrategy(IProject project) { // NOOP - return null; - } - - protected SaveStrategy createSaveStrategy(IVirtualComponent virtualComponent) { - return new EARComponentSaveStrategyImpl(virtualComponent); - } - - protected EARFile getEarFile() { - return (EARFile) model.getProperty(IEARComponentImportDataModelProperties.FILE); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentLoadStrategyImpl.java deleted file mode 100644 index e5b31917b..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentLoadStrategyImpl.java +++ /dev/null @@ -1,203 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.applicationclient.componentcore.util.AppClientArtifactEdit; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipFileLoadStrategyImpl; -import org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.util.ArtifactEditRegistryReader; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - -public class EARComponentLoadStrategyImpl extends ComponentLoadStrategyImpl { - - private List artifactEditsToDispose = new ArrayList(); - private Map binaryComponentURIsToDiskFileMap = new HashMap(); - - public EARComponentLoadStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - - public EARComponentLoadStrategyImpl(IVirtualComponent vComponent, boolean includeClasspathComponents) { - super(vComponent, includeClasspathComponents); - } - - public List getFiles() { - aggregateSourceFiles(); - addModulesAndUtilities(); - return filesHolder.getFiles(); - } - protected synchronized ArtifactEdit getArtifactEditForRead() { - if(artifactEdit == null){ - artifactEdit = EARArtifactEdit.getEARArtifactEditForRead(vComponent); - } - return artifactEdit; - } - - public InputStream getInputStream(String uri) throws IOException, FileNotFoundException { - if (binaryComponentURIsToDiskFileMap.containsKey(uri)) { - java.io.File diskFile = (java.io.File) binaryComponentURIsToDiskFileMap.get(uri); - return new FileInputStream(diskFile); - } - return super.getInputStream(uri); - } - - public void addModulesAndUtilities() { - EARArtifactEdit earArtifactEdit = null; - try { - earArtifactEdit = EARArtifactEdit.getEARArtifactEditForRead(vComponent); - IVirtualReference[] components = earArtifactEdit.getComponentReferences(); - for (int i = 0; i < components.length; i++) { - IVirtualReference reference = components[i]; - IVirtualComponent referencedComponent = reference.getReferencedComponent(); - - java.io.File diskFile = null; - if (referencedComponent.isBinary()) { - diskFile = ((VirtualArchiveComponent) referencedComponent).getUnderlyingDiskFile(); - if (!diskFile.exists()) { - IFile wbFile = ((VirtualArchiveComponent) referencedComponent).getUnderlyingWorkbenchFile(); - diskFile = new File(wbFile.getLocation().toOSString()); - } - } - - boolean isModule = false; - boolean addClasspathComponentDependencies = false; - ArtifactEdit componentArtifactEdit = null; - try { - if (J2EEProjectUtilities.isApplicationClientComponent(referencedComponent)) { - componentArtifactEdit = AppClientArtifactEdit.getAppClientArtifactEditForRead(referencedComponent); - } else if (J2EEProjectUtilities.isEJBComponent(referencedComponent)) { - addClasspathComponentDependencies = true; - componentArtifactEdit = ArtifactEditRegistryReader.instance().getArtifactEdit(J2EEProjectUtilities.EJB).createArtifactEditForRead(referencedComponent); - } else if (J2EEProjectUtilities.isDynamicWebComponent(referencedComponent)) { - addClasspathComponentDependencies = true; - componentArtifactEdit = ArtifactEditRegistryReader.instance().getArtifactEdit(J2EEProjectUtilities.DYNAMIC_WEB).createArtifactEditForRead(referencedComponent); - } else if (J2EEProjectUtilities.isJCAComponent(referencedComponent)) { - addClasspathComponentDependencies = true; - componentArtifactEdit = ArtifactEditRegistryReader.instance().getArtifactEdit(J2EEProjectUtilities.JCA).createArtifactEditForRead(referencedComponent); - } - if (null != componentArtifactEdit) { - Archive archive = ((EnterpriseArtifactEdit) componentArtifactEdit).asArchive(exportSource, includeClasspathComponents); - if (referencedComponent.isBinary()) { - artifactEditsToDispose.add(componentArtifactEdit); - archive.setLoadingContainer(getContainer()); - binaryComponentURIsToDiskFileMap.put(archive.getOriginalURI(), diskFile); - } - archive.setURI(earArtifactEdit.getModuleURI(referencedComponent)); - filesHolder.addFile(archive); - isModule = true; - if (addClasspathComponentDependencies) { - addClasspathComponentDependencies(referencedComponent); - } - } - } catch (OpenFailureException oe) { - Logger.getLogger().logError(oe); - } finally { - if (!referencedComponent.isBinary() && componentArtifactEdit != null) { - componentArtifactEdit.dispose(); - } - } - if (!isModule) { - if (referencedComponent.isBinary()) { - String uri = reference.getArchiveName(); - addExternalFile(uri, diskFile); - } else if (J2EEProjectUtilities.isUtilityProject(referencedComponent.getProject())) { - try { - if (!referencedComponent.isBinary()) { - String uri = earArtifactEdit.getModuleURI(referencedComponent); - Archive archive = J2EEProjectUtilities.asArchive(uri, referencedComponent.getProject(), exportSource, includeClasspathComponents); - archive.setURI(uri); - filesHolder.addFile(archive); - addClasspathComponentDependencies(referencedComponent); - } else { - - - } - } catch (OpenFailureException e) { - Logger.getLogger().logError(e); - } - } - } - } - - } finally { - if (null != earArtifactEdit) { - earArtifactEdit.dispose(); - } - } - } - - private void addClasspathComponentDependencies(final IVirtualComponent referencedComponent) { - // retrieve all Java classpath component dependencies - if (includeClasspathComponents && referencedComponent instanceof J2EEModuleVirtualComponent) { - final IVirtualReference[] cpRefs = ((J2EEModuleVirtualComponent) referencedComponent).getJavaClasspathReferences(); - for (int j = 0; j < cpRefs.length; j++) { - final IVirtualReference ref = cpRefs[j]; - // only ../ runtime paths contribute to the EAR - if (ref.getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - if (ref.getReferencedComponent() instanceof VirtualArchiveComponent) { - final VirtualArchiveComponent comp = (VirtualArchiveComponent) ref.getReferencedComponent(); - File cpEntryFile = comp.getUnderlyingDiskFile(); - if (!cpEntryFile.exists()) { - final IFile wbFile = comp.getUnderlyingWorkbenchFile(); - cpEntryFile = new File(wbFile.getLocation().toOSString()); - } - addExternalFile(ref.getArchiveName(), cpEntryFile); - } - } - } - } - } - - public void close() { - super.close(); - Iterator it = artifactEditsToDispose.iterator(); - while (it.hasNext()) { - ArtifactEdit edit = (ArtifactEdit) it.next(); - edit.dispose(); - } - artifactEditsToDispose.clear(); - } - - public ZipFileLoadStrategyImpl createLoadStrategy(String uri) throws FileNotFoundException, IOException { - String filename = uri.replace('/', java.io.File.separatorChar); - java.io.File file = new java.io.File(filename); - if (!file.exists()) { - throw new FileNotFoundException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.file_not_found_EXC_, (new Object[]{uri, file.getAbsolutePath()}))); // = - } - if (file.isDirectory()) { - throw new FileNotFoundException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.file_not_found_EXC_, (new Object[]{uri, file.getAbsolutePath()}))); // = - } - return new org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipFileLoadStrategyImpl(file); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentSaveStrategyImpl.java deleted file mode 100644 index 786a5f71c..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentSaveStrategyImpl.java +++ /dev/null @@ -1,248 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jem.util.emf.workbench.WorkbenchByteArrayOutputStream; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.datamodel.properties.IEARComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -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.IDataModel; - -public class EARComponentSaveStrategyImpl extends ComponentSaveStrategyImpl { - -// protected Map createdComponentsMap; - - public EARComponentSaveStrategyImpl(IVirtualComponent component) { - super(component); - } - - public void setDataModel(IDataModel dataModel) { - super.setDataModel(dataModel); - - setArchive((Archive) dataModel.getProperty(IEARComponentImportDataModelProperties.FILE)); - overwriteHandler = (IOverwriteHandler) dataModel.getProperty(IEARComponentImportDataModelProperties.OVERWRITE_HANDLER); - if (null != overwriteHandler) { - overwriteHandler.setEarSaveStrategy(this); - } -// buildProjectsMap(); - } - - - -// /** -// * Creates a Map mapping archive uris to projects for all archives in the ear that imported as -// * projects. -// */ -// private void buildProjectsMap() { -// createdComponentsMap = new HashMap(); -// List createdProjectsList = (List) dataModel.getProperty(IEARComponentImportDataModelProperties.ALL_PROJECT_MODELS_LIST); -// IDataModel importDM = null; -// Archive anArchive = null; -// for (int i = 0; i < createdProjectsList.size(); i++) { -// importDM = (IDataModel) createdProjectsList.get(i); -// anArchive = (Archive) importDM.getProperty(IJ2EEComponentImportDataModelProperties.FILE); -// createdComponentsMap.put(anArchive.getURI(), importDM.getProperty(IJ2EEComponentImportDataModelProperties.COMPONENT)); -// } -// } - -// protected void addFileToClasspath(IProject p, IFile file, List cp) { -// if (!file.exists()) -// return; -// -// // Assume the file also contains the source -// IPath path = file.getFullPath(); -// IClasspathEntry entry = JavaCore.newLibraryEntry(path, path, null, true); -// if (!cp.contains(entry)) -// cp.add(entry); -// } - -// protected void addProjectToClasspath(IProject dependent, IProject prereq, List cp) { -// IClasspathEntry entry = JavaCore.newProjectEntry(prereq.getFullPath(), true); -// if (!cp.contains(entry)) -// cp.add(entry); -// } - - protected EARFile getEARFile() { - return (EARFile) getArchive(); - } - - - protected java.io.OutputStream getOutputStreamForResource(org.eclipse.emf.ecore.resource.Resource aResource) throws java.io.IOException { - return null; - } - - public void save() throws SaveFailureException { - - saveFiles(); - saveManifest(); - saveMofResources(); - progressMonitor.subTask(EARArchiveOpsResourceHandler.Updating_project_classpath_UI_); - //updateComponentClasspaths(); - - } - - public void save(Archive anArchive) throws SaveFailureException { - progressMonitor.subTask(anArchive.getURI()); - saveArchiveAsJARInEAR(anArchive); - } - - protected void saveArchiveAsJARInEAR(Archive anArchive) throws SaveFailureException { - try { - anArchive.save(createNestedSaveStrategy(anArchive)); - progressMonitor.worked(1); - } catch (IOException e) { - throw new SaveFailureException(anArchive.getURI(), e); - } - } - - protected SubProgressMonitor subMonitor() { - return new SubProgressMonitor(progressMonitor, 10); - } - - public void setMonitor(org.eclipse.core.runtime.IProgressMonitor newMonitor) { - progressMonitor = newMonitor; - } - - protected boolean shouldSave(File aFile) { - if (aFile.isArchive()) { - return getFilter().shouldSave(aFile.getURI(), getArchive()); - } - return super.shouldSave(aFile); - } - - protected boolean shouldLinkAsComponentRef(Archive archive) { - if (null != dataModel) { - List list = (List) dataModel.getProperty(IEARComponentImportDataModelProperties.HANDLED_PROJECT_MODELS_LIST); - for (int i = 0; i < list.size(); i++) { - if (archive == ((IDataModel) list.get(i)).getProperty(IEARComponentImportDataModelProperties.FILE)) { - return false; - } - } - } - return true; - } - - protected boolean shouldSave(String uri) { - if (overwriteHandler != null) { - if (overwriteHandler.isOverwriteNone()) - return false; - return ((super.shouldSave(uri)) && (overwriteHandler.isOverwriteAll() || overwriteHandler.isOverwriteResources() || overwriteHandler.shouldOverwrite(uri))); - } - return true; - } - - public void save(ArchiveManifest aManifest) throws SaveFailureException { - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualFile vFile = rootFolder.getFile(new Path(J2EEConstants.MANIFEST_URI)); - IFile iFile = vFile.getUnderlyingFile(); - validateEdit(iFile); - OutputStream out = new WorkbenchByteArrayOutputStream(iFile); - try { - aManifest.write(out); - } catch (IOException e) { - Logger.getLogger().logError(e); - } finally { - try { - out.close(); - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - } - - -// /* -// * Parse the manifest of the module file; for each cp entry 1) cananonicalize to a uri that -// * looks like the entry in the ear 2) If the ear contains a file with that uri (the entry is -// * valid) a) If the file is another was blown out to a project, add a cp entry for a referenced -// * project b) otherwise, add a cp entry that points to the file in the ear project, and cp -// * entries for all prereqs -// */ -// protected void updateProjectClasspath(Archive anArchive, IVirtualComponent component) { -// -// String message = EARArchiveOpsResourceHandler.Updating_project_classpath_UI_ + component.getName(); -// progressMonitor.subTask(message); -// List projectCpEntries = new ArrayList(); -// Set visited = new HashSet(); -// traverseClasspaths(component.getProject(), anArchive, projectCpEntries, visited); -// -// try { -// if (!projectCpEntries.isEmpty()) -// JemProjectUtilities.appendJavaClassPath(component.getProject(), projectCpEntries); -// JemProjectUtilities.forceClasspathReload(component.getProject()); -// } catch (JavaModelException ex) { -// org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); -// } -// -// } - -// /* -// * If you have a dependency to a JAR in the EAR project, and the JAR depends on another JAR in -// * the EAR; you want to compile cleanly after import, so you need both those JARs on your build -// * path -// */ -// protected void traverseClasspaths(IProject p, Archive anArchive, List projectCpEntries, Set visitedArchives) { -// visitedArchives.add(anArchive); -// String[] manifestCpEntries = anArchive.getManifest().getClassPathTokenized(); -// EARFile earFile = (EARFile) dataModel.getProperty(IJ2EEComponentImportDataModelProperties.FILE); -// for (int i = 0; i < manifestCpEntries.length; i++) { -// String uri = ArchiveUtil.deriveEARRelativeURI(manifestCpEntries[i], anArchive); -// // ensure the entry is valid or skip to the next -// if (uri == null) -// continue; -// File aFile = null; -// try { -// aFile = earFile.getFile(uri); -// } catch (FileNotFoundException notThere) { -// } -// if (aFile == null || !aFile.isArchive() || visitedArchives.contains(aFile)) -// continue; -// Archive depArchive = (Archive) aFile; -// IProject prereq = null; -// IVirtualComponent depComponent = (IVirtualComponent) createdComponentsMap.get(uri); -// if (depComponent != null) -// prereq = depComponent.getProject(); -// -// if (prereq != null) { -// addProjectToClasspath(p, prereq, projectCpEntries); -// } else { -// addFileToClasspath(p, vComponent.getRootFolder().getFile(uri).getUnderlyingFile(), projectCpEntries); -// traverseClasspaths(p, depArchive, projectCpEntries, visitedArchives); -// } -// } -// } - -// protected void updateComponentClasspaths() { -// List jarFiles = getEARFile().getArchiveFiles(); -// for (int i = 0; i < jarFiles.size(); i++) { -// Archive anArchive = (Archive) jarFiles.get(i); -// IVirtualComponent component = (IVirtualComponent) createdComponentsMap.get(anArchive.getURI()); -// if (component != null) -// updateProjectClasspath(anArchive, component); -// } -// } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EJBArchiveOpsResourceHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EJBArchiveOpsResourceHandler.java deleted file mode 100644 index 8f0f800a0..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EJBArchiveOpsResourceHandler.java +++ /dev/null @@ -1,52 +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.internal.archive.operations; - -import org.eclipse.osgi.util.NLS; - -public final class EJBArchiveOpsResourceHandler extends NLS { - - private static final String BUNDLE_NAME = "ejbarchiveops";//$NON-NLS-1$ - - private EJBArchiveOpsResourceHandler() { - // Do not instantiate - } - - public static String ARCHIVE_OPERATION_SaveMofResources; - public static String ARCHIVE_OPERATION_SaveFile; - public static String ARCHIVE_OPERATION_ProjectNature; - public static String ARCHIVE_OPERATION_SaveManifest; - public static String ARCHIVE_OPERATION_FileNotFound; - public static String ARCHIVE_OPERATION_FileContents; - public static String ARCHIVE_OPERATION_ErroOccured; - public static String ARCHIVE_OPERATION_FilesFromProject; - public static String ARCHIVE_OPERATION_OpeningArchive; - public static String ARCHIVE_OPERATION_InvalidEJBJar; - public static String ARCHIVE_OPERATION_InvalidImportEJBJar; - public static String ARCHIVE_OPERATION_ImportOperation; - public static String EJB_IMPORT_OPERATION_STRING; - public static String EJB_IMPORT_FILE_STRING; - public static String IMPORT_MOFRESOURCE_STRING; - public static String IMPORT_OPERATION_STRING; - public static String ERROR_COPYING_FILES_FROM_ORIGINAL_JAR; - public static String ERROR_IMPORTING_MODULE_FILE; - public static String Yes_UI; - public static String No_UI; - public static String Yes_To_All_UI; - public static String Cancel_UI_; - public static String Error_exporting__UI_; - public static String EJB_Jar_File_UI_; - public static String Copy_Dep_JARS_UI; - - static { - NLS.initializeMessages(BUNDLE_NAME, EJBArchiveOpsResourceHandler.class); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EJBComponentSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EJBComponentSaveStrategyImpl.java deleted file mode 100644 index 0b1b3a1fa..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EJBComponentSaveStrategyImpl.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.internal.archive.operations; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class EJBComponentSaveStrategyImpl extends J2EEComponentSaveStrategyImpl { - - public EJBComponentSaveStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/IOverwriteHandler.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/IOverwriteHandler.java deleted file mode 100644 index b47b26e16..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/IOverwriteHandler.java +++ /dev/null @@ -1,142 +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.internal.archive.operations; - - - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator; - - -/** - * Insert the type's description here. Creation date: (4/16/2001 3:12:41 PM) - * - * @author: Administrator - */ -public interface IOverwriteHandler { - public static final String NO = EJBArchiveOpsResourceHandler.No_UI; - public static final String YES = EJBArchiveOpsResourceHandler.Yes_UI; - public static final String ALL = EJBArchiveOpsResourceHandler.Yes_To_All_UI; - public static final String NONE = EJBArchiveOpsResourceHandler.Cancel_UI_; - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - org.eclipse.core.resources.IProject getProject(); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - boolean isOverwriteAll(); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - boolean isOverwriteNone(); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - boolean isOverwriteResources(); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - String queryOverwrite(String resourcePath); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - void setEarSaveStrategy(EARComponentSaveStrategyImpl newEarSaveStrategy); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - void setEjbSaveStrategy(J2EEComponentSaveStrategyImpl newEjbSaveStrategy); - - /** - * Sets the RAR SaveStrategy. - * - * @param RARProjectSaveStrategyImpl - * rarSaveStrategy - The rar save strategy to set. - */ - void setRARSaveStrategy(J2EEComponentSaveStrategyImpl newRARSaveStrategy); - - void setOverwriteAll(boolean newAllTrue); - - void setOverwriteNone(boolean newNoneTrue); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - void setOverwriteResources(boolean newOverwriteResources); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - void setProject(org.eclipse.core.resources.IProject newProject); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - void setWarSaveStrategy(J2EEComponentSaveStrategyImpl newWarSaveStrategy); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - boolean shouldOverwrite(String uri); - - /** - * Check to see if the file can be checked out. - * - * @throws OverwriteHandlerException - * if the validate fails - */ - void validateEdit(IFile aFile) throws OverwriteHandlerException; - - /** - * Check to see if the files can be checked out. - * - * @throws OverwriteHandlerException - * if the validate fails - */ - void validateState(ResourceStateValidator resourceStateValidator); - - /** - * Insert the method's description here. Creation date: (4/16/2001 3:13:38 PM) - * - * @return boolean - */ - boolean shouldOverwriteWLProject(IProject fProject, java.lang.String uri); -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ImportOption.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ImportOption.java deleted file mode 100644 index b41f7b8b2..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/ImportOption.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.archive.operations; - - -import org.eclipse.jst.j2ee.internal.project.IJ2EEProjectTypes; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - - -/** - * This class defines the rules for importing an individual nested JAR in an EAR project - */ -public class ImportOption implements IJ2EEProjectTypes { - /** - * Project info for the individual module/JAR, or null if the file should be placed in the - * application - */ - protected IDataModel model; - - /** - * Valid only if the project info is not null - * - * @see IJ2EEProjectTypes - */ - protected int projectType = IJ2EEProjectTypes.DEFAULT; - - /** - * @see IJ2EEProjectTypes#MODULE - * @see IJ2EEProjectTypes#UTIL - */ - protected int archiveType = IJ2EEProjectTypes.MODULE; - - /** - * Constructor for ImportOption. - */ - public ImportOption(IDataModel model) { - super(); - this.model = model; - } - - public ImportOption(IDataModel model, int type) { - this(model); - projectType = type; - } - - public IDataModel getModel() { - return model; - } - - public int getProjectType() { - return projectType; - } - - public String getProjectName() { - return model.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME); - } - - /** - * @return Returns the archiveType. - */ - public int getArchiveType() { - return archiveType; - } - - /** - * @param archiveType - * The archiveType to set. - */ - public void setArchiveType(int archiveType) { - this.archiveType = archiveType; - } - - /** - * @param projectType - * The projectType to set. - */ - public void setProjectType(int projectType) { - this.projectType = projectType; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEArtifactExportOperation.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEArtifactExportOperation.java deleted file mode 100644 index 8c0e3ac96..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEArtifactExportOperation.java +++ /dev/null @@ -1,295 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.ARCHIVE_DESTINATION; -import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.COMPONENT; -import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.EXPORT_SOURCE_FILES; -import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.OPTIMIZE_FOR_SPECIFIC_RUNTIME; -import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.RUNTIME_SPECIFIC_PARTICIPANTS; -import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.RUN_BUILD; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceRuleFactory; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.core.runtime.jobs.MultiRule; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.IArchiveExportParticipantData; -import org.eclipse.jst.j2ee.internal.archive.ComponentArchiveLoadAdapter; -import org.eclipse.jst.j2ee.internal.plugin.LibCopyBuilder; -import org.eclipse.jst.j2ee.internal.project.ProjectSupportResourceHandler; -import org.eclipse.jst.jee.archive.ArchiveSaveFailureException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveFactory; -import org.eclipse.jst.jee.archive.IArchiveLoadAdapter; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public abstract class J2EEArtifactExportOperation extends AbstractDataModelOperation { - - protected IProgressMonitor progressMonitor; - private IVirtualComponent component; - private IPath destinationPath; - private ModuleFile moduleFile; - private boolean exportSource = false; - - public J2EEArtifactExportOperation() { - super(); - } - - public J2EEArtifactExportOperation(IDataModel model) { - super(model); - } - - protected final int REFRESH_WORK = 100; - protected final int JAVA_BUILDER_WORK = 100; - protected final int LIB_BUILDER_WORK = 100; - protected final int EXPORT_WORK = 1000; - protected final int CLOSE_WORK = 10; - protected final int SINGLE_PARTICIPANT_WORK = 200; - - protected int computeTotalWork() { - int totalWork = REFRESH_WORK; - if (model.getBooleanProperty(RUN_BUILD)) { - totalWork += JAVA_BUILDER_WORK + LIB_BUILDER_WORK; - } - totalWork += EXPORT_WORK + CLOSE_WORK; - - final IDataModel dm = getDataModel(); - - if( dm.getProperty( OPTIMIZE_FOR_SPECIFIC_RUNTIME ) == Boolean.TRUE ) - { - final List<IArchiveExportParticipantData> extensions - = (List<IArchiveExportParticipantData>) dm.getProperty( RUNTIME_SPECIFIC_PARTICIPANTS ); - - totalWork += extensions.size() * SINGLE_PARTICIPANT_WORK; - } - - return totalWork; - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - setComponent((IVirtualComponent) model.getProperty(COMPONENT)); - setDestinationPath(new Path(model.getStringProperty(ARCHIVE_DESTINATION))); - setExportSource(model.getBooleanProperty(EXPORT_SOURCE_FILES)); - - try - { - monitor.beginTask(ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.Exporting_archive, new Object [] { getDestinationPath().lastSegment() }), computeTotalWork()); - setProgressMonitor(monitor); - - try { - // defect 240999 - component.getProject().refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, REFRESH_WORK)); - if (model.getBooleanProperty(RUN_BUILD)) { - runNecessaryBuilders(component, new SubProgressMonitor(monitor, JAVA_BUILDER_WORK + LIB_BUILDER_WORK)); - } - export(); - } catch (Exception e) { - if(moduleFile != null){ - //The module fil will be closed if the export succeeds - //Need to be careful not to close the archive twice because of ReferenceCounted Archives - moduleFile.close(); - monitor.worked(CLOSE_WORK); - } - throw new ExecutionException(EJBArchiveOpsResourceHandler.Error_exporting__UI_ + archiveString(), e); - } - - final IDataModel dm = getDataModel(); - - if( dm.getProperty( OPTIMIZE_FOR_SPECIFIC_RUNTIME ) == Boolean.TRUE ) - { - for( IArchiveExportParticipantData extData - : (List<IArchiveExportParticipantData>) dm.getProperty( RUNTIME_SPECIFIC_PARTICIPANTS ) ) - { - final IDataModelOperation op - = extData.getParticipant().createOperation( extData.getDataModel() ); - - op.execute( null, null ); - monitor.worked( SINGLE_PARTICIPANT_WORK ); - } - } - } - finally - { - monitor.done(); - } - - return OK_STATUS; - } - - protected abstract void export() throws SaveFailureException, CoreException, InvocationTargetException, InterruptedException; - - protected abstract String archiveString(); - - protected void setProgressMonitor(IProgressMonitor newProgressMonitor) { - progressMonitor = newProgressMonitor; - } - - protected IProgressMonitor getProgressMonitor() { - return progressMonitor; - } - - private void setComponent(IVirtualComponent newComponent) { - component = newComponent; - } - - protected IVirtualComponent getComponent() { - if (component == null) - component = (IVirtualComponent) model.getProperty(COMPONENT); - return component; - } - - protected IPath getDestinationPath() { - return destinationPath; - } - - protected void setDestinationPath(IPath newDestinationPath) { - destinationPath = newDestinationPath; - } - - protected boolean isExportSource() { - return exportSource; - } - - protected void setExportSource(boolean newExportSource) { - exportSource = newExportSource; - } - - protected ModuleFile getModuleFile() { - return moduleFile; - } - - protected void setModuleFile(ModuleFile newModuleFile) { - moduleFile = newModuleFile; - } - - protected void runNecessaryBuilders(IVirtualComponent component, IProgressMonitor monitor) throws CoreException { - try{ - monitor.beginTask(null, JAVA_BUILDER_WORK + LIB_BUILDER_WORK); - if(!component.isBinary()){ - IProject project = component.getProject(); - IProjectDescription description = project.getDescription(); - ICommand javaBuilder = getJavaCommand(description); - if (javaBuilder != null) { - project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, JavaCore.BUILDER_ID, javaBuilder.getArguments(), new SubProgressMonitor(monitor, JAVA_BUILDER_WORK)); - } - ICommand libCopyBuilder = getLibCopyBuilder(description); - if (null != libCopyBuilder) { - project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, LibCopyBuilder.BUILDER_ID, libCopyBuilder.getArguments(), new SubProgressMonitor(monitor, LIB_BUILDER_WORK)); - } - } - } finally { - monitor.done(); - } - } - - /** - * Find the specific Java command amongst the build spec of a given description - */ - protected ICommand getJavaCommand(IProjectDescription description) throws CoreException { - if (description == null) { - return null; - } - - ICommand[] commands = description.getBuildSpec(); - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) { - return commands[i]; - } - } - return null; - } - - protected ICommand getLibCopyBuilder(IProjectDescription description) throws CoreException { - if (description == null) { - return null; - } - - ICommand[] commands = description.getBuildSpec(); - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(LibCopyBuilder.BUILDER_ID)) { - return commands[i]; - } - } - return null; - - } - - public ISchedulingRule getSchedulingRule() { - Set projs = gatherDependentProjects(getComponent(), new HashSet()); - ISchedulingRule combinedRule = null; - IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory(); - for (Iterator iter = projs.iterator(); iter.hasNext();) { - IProject proj = (IProject) iter.next(); - ISchedulingRule rule = ruleFactory.createRule(proj); - combinedRule = MultiRule.combine(rule, combinedRule); - } - combinedRule = MultiRule.combine(ruleFactory.buildRule(), combinedRule); - - return combinedRule; - } - - private Set gatherDependentProjects(IVirtualComponent comp, Set projs) { - if (!projs.contains(comp.getProject())) { - projs.add(comp.getProject()); - IVirtualReference[] refs = comp.getReferences(); - for (int i = 0; i < refs.length; i++) { - IVirtualReference refComp = refs[i]; - projs.addAll(gatherDependentProjects(refComp.getReferencedComponent(), projs)); - } - } - return projs; - } - - protected void saveArchive(IArchive archiveToSave, String fileName, IProgressMonitor monitor) throws ArchiveSaveFailureException { - String writeFileName = fileName; - File writeFile = new File(writeFileName); - if (writeFile.exists()) { - writeFile.delete(); - } - IPath outputPath = new Path(writeFileName); - IArchiveLoadAdapter loadAdapter = archiveToSave.getLoadAdapter(); - if(loadAdapter instanceof ComponentArchiveLoadAdapter){ - ComponentArchiveLoadAdapter cLoadAdapter = (ComponentArchiveLoadAdapter)loadAdapter; - cLoadAdapter.setExportSource(getDataModel().getBooleanProperty(EXPORT_SOURCE_FILES)); - - } - IArchiveFactory.INSTANCE.saveArchive(archiveToSave, outputPath, monitor); - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEArtifactImportOperation.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEArtifactImportOperation.java deleted file mode 100644 index d4006aafb..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEArtifactImportOperation.java +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import java.lang.reflect.InvocationTargetException; - -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.core.runtime.SubProgressMonitor; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper; -import org.eclipse.jst.j2ee.internal.archive.ComponentArchiveSaveAdapter; -import org.eclipse.jst.j2ee.internal.archive.ConnectorComponentArchiveSaveAdapter; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; -import org.eclipse.jst.j2ee.internal.project.ProjectSupportResourceHandler; -import org.eclipse.jst.jee.archive.ArchiveOptions; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.archive.IArchiveFactory; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WFTWrappedException; - -public abstract class J2EEArtifactImportOperation extends AbstractDataModelOperation { - - /** - * @deprecated use {@link #archiveWrapper} - */ - protected Archive moduleFile; - protected ArchiveWrapper archiveWrapper; - protected IVirtualComponent virtualComponent; - protected IAdaptable info; - protected final int PROJECT_CREATION_WORK = 30; - - private static IArchiveFactory archiveFactory = IArchiveFactory.INSTANCE; - - public J2EEArtifactImportOperation(IDataModel model) { - super(model); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable anInfo) throws ExecutionException { - try { - J2EEComponentClasspathUpdater.getInstance().pauseUpdates(); - this.info = anInfo; - moduleFile = (Archive) model.getProperty(IJ2EEComponentImportDataModelProperties.FILE); - archiveWrapper = (ArchiveWrapper)model.getProperty(IJ2EEComponentImportDataModelProperties.ARCHIVE_WRAPPER); - monitor.beginTask(ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.Importing_archive, new Object [] { archiveWrapper.getPath() }), computeTotalWork()); - doExecute(monitor); - return OK_STATUS; - } finally { - try { - if (virtualComponent != null) { - J2EEComponentClasspathUpdater.getInstance().queueUpdate(virtualComponent.getProject()); - } - } finally { - J2EEComponentClasspathUpdater.getInstance().resumeUpdates(); - model.dispose(); - monitor.done(); - } - } - } - - protected int computeTotalWork() { - return PROJECT_CREATION_WORK + archiveWrapper.getSize(); - } - - /** - * Subclasses overriding this method should also override {@link #computeTotalWork()} - * @param monitor - * @throws ExecutionException - */ - protected void doExecute(IProgressMonitor monitor) throws ExecutionException { - IDataModel nestedModel = model.getNestedModel(IJ2EEComponentImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION); - IProgressMonitor subMonitor = new SubProgressMonitor(monitor, PROJECT_CREATION_WORK); - virtualComponent = createVirtualComponent(nestedModel, subMonitor); - - try { - importModuleFile(new SubProgressMonitor(monitor, archiveWrapper.getSize())); - } catch (InvocationTargetException e) { - throw new ExecutionException(e.getMessage(), e); - } catch (InterruptedException e) { - throw new ExecutionException(e.getMessage(), e); - } - } - - protected IVirtualComponent createVirtualComponent(IDataModel aModel, IProgressMonitor monitor) throws ExecutionException { - try { - aModel.getDefaultOperation().execute(monitor, info); - String projectName = aModel.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - IProject project = ProjectUtilities.getProject(projectName); - return ComponentCore.createComponent(project); - } finally { - monitor.done(); - } - } - - /** - * Creates the appropriate save strategy. Subclases should overwrite this method to create the - * appropriate save startegy for the kind of J2EE module project to import the archive - */ - protected abstract SaveStrategy createSaveStrategy(IVirtualComponent vc); - - protected void modifyStrategy(SaveStrategy saveStrat) { - } - - protected ComponentArchiveSaveAdapter getArchiveSaveAdapter(IVirtualComponent virtualComponent){ - return new ConnectorComponentArchiveSaveAdapter(virtualComponent); - } - - /** - * perform the archive import operation - * - * @throws java.lang.reflect.InvocationTargetException - * @throws java.lang.InterruptedException - */ - protected void importModuleFile(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - try { - monitor.beginTask(null, archiveWrapper.getSize()); - if(archiveWrapper.getIArchive() != null){ - IArchive archive = archiveWrapper.getIArchive(); - ComponentArchiveSaveAdapter adap = getArchiveSaveAdapter(virtualComponent); - ArchiveOptions saveOptions = new ArchiveOptions(); - saveOptions.setOption(ArchiveOptions.SAVE_ADAPTER, adap); - archiveFactory.saveArchive(archive, saveOptions,monitor); - }else{ - ComponentSaveStrategyImpl aStrategy = (ComponentSaveStrategyImpl) createSaveStrategy(virtualComponent); - aStrategy.setProgressMonitor(monitor); - aStrategy.setOverwriteHandler((IOverwriteHandler) model.getProperty(IJ2EEComponentImportDataModelProperties.OVERWRITE_HANDLER)); - aStrategy.setDataModel(model); - modifyStrategy(aStrategy); - archiveWrapper.getCommonArchive().save(aStrategy); - } - - } catch (OverwriteHandlerException oe) { - throw new InterruptedException(); - } catch (Exception ex) { - throw new WFTWrappedException(ex, EJBArchiveOpsResourceHandler.ERROR_IMPORTING_MODULE_FILE); - } finally { - monitor.done(); - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEComponentLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEComponentLoadStrategyImpl.java deleted file mode 100644 index d0569f20e..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEComponentLoadStrategyImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class J2EEComponentLoadStrategyImpl extends ComponentLoadStrategyImpl{ - - public J2EEComponentLoadStrategyImpl(IVirtualComponent component) { - super(component); - } - - public J2EEComponentLoadStrategyImpl(IVirtualComponent component, boolean includeClasspathComponents) { - super(component, includeClasspathComponents); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEComponentSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEComponentSaveStrategyImpl.java deleted file mode 100644 index eef7d5f55..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEComponentSaveStrategyImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.archive.operations; - -import java.io.IOException; -import java.io.OutputStream; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -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.emf.workbench.WorkbenchByteArrayOutputStream; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; - -public abstract class J2EEComponentSaveStrategyImpl extends ComponentSaveStrategyImpl { - - protected final String DOT_CLASS = ".class"; //$NON-NLS-1$ - protected final String IMPORTED_CLASSES = "ImportedClasses"; //$NON-NLS-1$ - - public J2EEComponentSaveStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - - protected void saveFiles() throws SaveFailureException { - super.saveFiles(); - linkImportedClassesFolderIfNecessary(); - try { - vComponent.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException ex) { - Logger.getLogger().logError(ex); - } - } - - public boolean endsWithClassType(String aFileName) { - if (aFileName.endsWith(DOT_CLASS)) - return true; - return false; - } - - protected boolean shouldSave(File aFile) { - if (endsWithClassType(aFile.getURI())){ - boolean shouldSave = isClassWithoutSource(aFile); - if(shouldSave && !importedClassesFolderCreated){ - createImportedClassesFolder(); - } - return shouldSave; - } - return super.shouldSave(aFile); - } - - public void save(ArchiveManifest aManifest) throws SaveFailureException { - IVirtualFolder rootFolder = vComponent.getRootFolder(); - IVirtualFile vFile = rootFolder.getFile(new Path(J2EEConstants.MANIFEST_URI)); - IFile iFile = vFile.getUnderlyingFile(); - validateEdit(iFile); - OutputStream out = new WorkbenchByteArrayOutputStream(iFile); - try { - aManifest.write(out); - } catch (IOException e) { - Logger.getLogger().logError(e); - } finally { - try { - out.close(); - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - } - - protected boolean importedClassesFolderCreated = false; - protected IFolder importedClassesFolder; - - protected void createImportedClassesFolder() { - importedClassesFolderCreated = true; - IContainer jarParent = vComponent.getRootFolder().getUnderlyingFolder().getParent(); - importedClassesFolder = jarParent.getFolder(new Path(IMPORTED_CLASSES)); - try { - importedClassesFolder.create(true, true, null); - } catch (CoreException e1) { - Logger.getLogger().logError(e1); - } - } - - protected void linkImportedClassesFolderIfNecessary() { - if (importedClassesFolder != null) { - try { - vComponent.getRootFolder().getFolder(getImportedClassesRuntimePath()).createLink(importedClassesFolder.getProjectRelativePath(), 0, null); - if (shouldAddImportedClassesToClasspath()) { - if (JemProjectUtilities.getJavaProject(vComponent.getProject()) != null) { - IJavaProject javaProject = JavaCore.create(vComponent.getProject()); - IClasspathEntry[] javaClasspath = javaProject.getRawClasspath(); - IClasspathEntry[] newJavaClasspath = new IClasspathEntry[javaClasspath.length + 1]; - System.arraycopy(javaClasspath, 0, newJavaClasspath, 0, javaClasspath.length); - newJavaClasspath[newJavaClasspath.length - 1] = JavaCore.newLibraryEntry(importedClassesFolder.getFullPath(), null, null, true); - javaProject.setRawClasspath(newJavaClasspath, new NullProgressMonitor()); - } - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } - } - - protected boolean shouldAddImportedClassesToClasspath() { - return true; - } - - protected IPath getImportedClassesRuntimePath() { - return new Path("/"); - } - - protected IPath getOutputPathForFile(File aFile) { - if(endsWithClassType(aFile.getURI())){ - return importedClassesFolder.getFile(getImportedClassesURI(aFile)).getProjectRelativePath(); - } - return super.getOutputPathForFile(aFile); - } - - protected String getImportedClassesURI(File aFile) { - return aFile.getURI(); - } - - protected boolean isClassWithoutSource(File aFile) { - String javaUri = ArchiveUtil.classUriToJavaUri(aFile.getURI()); - if (javaUri == null) - return false; - return !archive.containsFile(javaUri); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEImportConstants.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEImportConstants.java deleted file mode 100644 index 9bf8af510..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEImportConstants.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Dec 18, 2003 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.archive.operations; - -/** - * @author jsholl - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class J2EEImportConstants { - public static final String IMPORTED_JAR_SUFFIX = ".imported_classes.jar"; //$NON-NLS-1$ -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEJavaComponentSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEJavaComponentSaveStrategyImpl.java deleted file mode 100644 index 1c929b5d9..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/J2EEJavaComponentSaveStrategyImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.archive.operations; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class J2EEJavaComponentSaveStrategyImpl extends J2EEComponentSaveStrategyImpl { - - public J2EEJavaComponentSaveStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/JavaComponentLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/JavaComponentLoadStrategyImpl.java deleted file mode 100644 index 9400db82a..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/JavaComponentLoadStrategyImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.archive.operations; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class JavaComponentLoadStrategyImpl extends ComponentLoadStrategyImpl { - - public JavaComponentLoadStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - - public JavaComponentLoadStrategyImpl(IVirtualComponent vComponent, boolean includeClasspathComponents) { - super(vComponent, includeClasspathComponents); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/JavaComponentSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/JavaComponentSaveStrategyImpl.java deleted file mode 100644 index 2269718c4..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/JavaComponentSaveStrategyImpl.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.internal.archive.operations; - -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class JavaComponentSaveStrategyImpl extends ComponentSaveStrategyImpl { - - public JavaComponentSaveStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/OverwriteHandlerException.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/OverwriteHandlerException.java deleted file mode 100644 index 7caf4b114..000000000 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/OverwriteHandlerException.java +++ /dev/null @@ -1,42 +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.internal.archive.operations; - - - -/** - * Insert the type's description here. Creation date: (8/16/2001 6:07:35 PM) - * - * @author: Administrator - */ -public class OverwriteHandlerException extends RuntimeException { - /** - * Warning clean-up 12/05/2005 - */ - private static final long serialVersionUID = 1651836694391641930L; - - /** - * OverwriteHandlerException constructor comment. - */ - public OverwriteHandlerException() { - super(); - } - - /** - * OverwriteHandlerException constructor comment. - * - * @param s - * java.lang.String - */ - public OverwriteHandlerException(String s) { - super(s); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/build.properties b/plugins/org.eclipse.jst.j2ee/build.properties deleted file mode 100644 index 04f456998..000000000 --- a/plugins/org.eclipse.jst.j2ee/build.properties +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 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 -############################################################################### -bin.includes = schema/,\ - icons/,\ - plugin.properties,\ - prepareAllPII.xml,\ - plugin.xml,\ - .,\ - META-INF/,\ - about.html,\ - license/ -source.. = j2eeplugin/,\ - common/,\ - commonedit/,\ - earproject/,\ - j2eecreation/,\ - archiveops/,\ - applicationedit/,\ - appclientcreation/,\ - property_files/,\ - refactor/,\ - classpathdep/,\ - contenttype/ -jars.compile.order = . -src.includes = rose/,\ - schema/,\ - component.xml -output.. = bin/ diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/ClasspathDependencyUtil.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/ClasspathDependencyUtil.java deleted file mode 100644 index c82be223e..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/ClasspathDependencyUtil.java +++ /dev/null @@ -1,363 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 BEA Systems, Inc. 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: - * BEA Systems, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.classpathdep; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -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.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; -import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -/** - * Contains utility code for working manipulating the WTP classpath component - * dependency attribute. - */ -public class ClasspathDependencyUtil implements IClasspathDependencyConstants { - - private static final IPath WEB_INF_LIB = new Path("/WEB-INF/lib"); //$NON-NLS-1$ - private static final IPath PARENT_MAPPING = new Path ("../"); //$NON-NLS-1$ - - - /** - * Returns all unresolved classpath entries for the specified Java project that - * have the special WTP classpath component dependency attribute. - * - * @param javaProject Java project whose component classpath dependencies are being retrieved. - * @return Map from IClasspathEntry to IClasspathAttribute for classpath component dependency. - * @return IClasspathEntries with the special component dependency attribute. - * @throws CoreException Thrown if an error is encountered accessing the unresolved classpath. - */ - public static Map getRawComponentClasspathDependencies(final IJavaProject javaProject) throws CoreException { - if (javaProject == null) { - return Collections.EMPTY_MAP; - } - final Map referencedRawEntries = new HashMap(); - final IClasspathEntry[] entries = javaProject.getRawClasspath(); - for (int i = 0; i < entries.length; i++) { - final IClasspathEntry entry = entries[i]; - final IClasspathAttribute attrib = checkForComponentDependencyAttribute(entry); - if (attrib != null) { - referencedRawEntries.put(entry, attrib); - } - } - return referencedRawEntries; - } - - /** - * Retrieves the unresolved classpath entries for the specified Java project that - * could potentially be mapped into the virtual component tree for the project via - * the special WTP classpath component dependence attribute. Classpath entries that - * currently have the attribute are not returned by this method (@see {@link #getRawComponentClasspathDependencies(IJavaProject, boolean)}) - * - * @param javaProject Java project whose potential component classpath dependencies will be retrieved. - * @return List of raw IClasspathEntries for potential classpath component dependencies. - * @throws CoreException Thrown if an error is encountered. - */ - public static List getPotentialComponentClasspathDependencies(final IJavaProject javaProject) throws CoreException { - final List potentialRawEntries = new ArrayList(); - - if (javaProject == null || !javaProject.getProject().isAccessible()) { - return Collections.EMPTY_LIST; - } - final IProject project = javaProject.getProject(); - final IClasspathEntry[] entries = javaProject.getRawClasspath(); - for (int i = 0; i < entries.length; i++) { - final IClasspathEntry entry = entries[i]; - final IClasspathAttribute attrib = checkForComponentDependencyAttribute(entry); - if (attrib != null) { - continue; // already has the attribute - } else { - // check validation logic for entry - // always mark the "isWebApp" param as true so that we get both exported and non-exported entries; for non-web projects, - // want to let a user have the option to see and select the non-exported entries and then just generate a validation - // error if they happen to select one. - final IMessage[] msgs = ClasspathDependencyValidator.validateVirtualComponentEntry(entry, null, true, project); - boolean error = false; - for (int j = 0; j < msgs.length; j++) { - if (msgs[j].getSeverity() == IMessage.HIGH_SEVERITY) { - error = true; - break; - } - } - if (error) { - continue; - } - - // entry can potentially be tagged as a component dependency - potentialRawEntries.add(entry); - } - } - return potentialRawEntries; - } - - private static boolean isValid(final IClasspathEntry entry, final IClasspathAttribute attrib, final boolean isWebApp, final IProject project) { - final IMessage[] msgs = ClasspathDependencyValidator.validateVirtualComponentEntry(entry, attrib, isWebApp, project); - boolean valid = true; - for (int j = 0; j < msgs.length; j++) { - if (msgs[j].getSeverity() == IMessage.HIGH_SEVERITY) { - valid = false; - break; - } - } - return valid; - } - - /** - * Returns all resolved classpath entries for the specified Java project that - * have one of the special WTP classpath component dependency attributes and pass the set of rules - * that govern valid classpath dependencies. - * - * @param javaProject Java project whose component classpath dependencies are being retrieved. - * @param isWebApp True if the target project is associated with a web project. - * @return Map from IClasspathEntry to IClasspathAttribute for classpath component dependencies. - * @throws CoreException Thrown if an error is encountered accessing the unresolved classpath. - */ - public static Map getComponentClasspathDependencies(final IJavaProject javaProject, final boolean isWebApp) throws CoreException { - return getComponentClasspathDependencies(javaProject, isWebApp, true); - } - - /** - * Returns all resolved classpath entries for the specified Java project that - * have one of the special WTP classpath component dependency attributes. - * - * @param javaProject Java project whose component classpath dependencies are being retrieved. - * @param isWebApp True if the target project is associated with a web project. - * @param onlyValid If true, only valid dependencies will be returned. If false, the raw entry must be valid but the - * resolved can be invalid. - * @return Map from IClasspathEntry to IClasspathAttribute for classpath component dependencies. - * @throws CoreException Thrown if an error is encountered accessing the unresolved classpath. - */ - public static Map getComponentClasspathDependencies(final IJavaProject javaProject, final boolean isWebApp, final boolean onlyValid) throws CoreException { - - // get the raw entries - final Map referencedRawEntries = getRawComponentClasspathDependencies(javaProject); - final Map validRawEntries = new HashMap(); - - // filter out non-valid referenced raw entries - final Iterator i = referencedRawEntries.keySet().iterator(); - while (i.hasNext()) { - final IClasspathEntry entry = (IClasspathEntry) i.next(); - final IClasspathAttribute attrib = (IClasspathAttribute) referencedRawEntries.get(entry); - if (isValid(entry, attrib, isWebApp, javaProject.getProject())) { - validRawEntries.put(entry, attrib); - } - } - - // if we have no valid raw entries, return empty map - if (validRawEntries.isEmpty()) { - return Collections.EMPTY_MAP; - } - - // XXX Would like to replace the code below with use of a public JDT API that returns - // the raw IClasspathEntry for a given resolved IClasspathEntry (see see https://bugs.eclipse.org/bugs/show_bug.cgi?id=183995) - // The code must currently leverage IPackageFragmentRoot to determine this - // mapping and, because IPackageFragmentRoots do not maintain IClasspathEntry data, a prior - // call is needed to getResolvedClasspath() and the resolved IClasspathEntries have to be stored in a Map from IPath-to-IClasspathEntry to - // support retrieval using the resolved IPackageFragmentRoot - - // retrieve the resolved classpath - final IClasspathEntry[] entries = javaProject.getResolvedClasspath(true); - final Map pathToResolvedEntry = new HashMap(); - - // store in a map from path to entry - for (int j = 0; j < entries.length; j++) { - pathToResolvedEntry.put(entries[j].getPath(), entries[j]); - } - - final Map referencedEntries = new HashMap(); - - // grab all IPackageFragmentRoots - final IPackageFragmentRoot[] roots = javaProject.getPackageFragmentRoots(); - for (int j = 0; j < roots.length; j++) { - final IPackageFragmentRoot root = roots[j]; - final IClasspathEntry rawEntry = root.getRawClasspathEntry(); - - // is the raw entry valid? - IClasspathAttribute attrib = (IClasspathAttribute) validRawEntries.get(rawEntry); - if (attrib == null) { - continue; - } - - final IPath pkgFragPath = root.getPath(); - final IClasspathEntry resolvedEntry = (IClasspathEntry) pathToResolvedEntry.get(pkgFragPath); - final IClasspathAttribute resolvedAttrib = checkForComponentDependencyAttribute(resolvedEntry); - // attribute for the resolved entry must either be unspecified or it must be the - // dependency attribute for it to be included - if (resolvedAttrib == null || resolvedAttrib.getName().equals(CLASSPATH_COMPONENT_DEPENDENCY)) { - // filter out resolved entry if it doesn't pass the validation rules - if (!onlyValid || isValid(resolvedEntry, resolvedAttrib != null?resolvedAttrib:attrib,isWebApp, javaProject.getProject())) { - if (resolvedAttrib != null) { - // if there is an attribute on the sub-entry, use that - attrib = resolvedAttrib; - } - referencedEntries.put(resolvedEntry, attrib); - } - } - } - - return referencedEntries; - } - - /** - * Retrieves the location (as a absolute file system path) for the specified classpath entry. - * @param entry Classpath entry. If null, returns null. - * @return Absolute file system path. - */ - public static IPath getEntryLocation(final IClasspathEntry entry) { - if (entry == null) { - return null; - } - final IPath entryPath = entry.getPath(); - IPath entryLocation = entryPath; - final IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(entryPath); - if (resource != null) { - entryLocation = resource.getLocation(); - } - return entryLocation; - } - - /** - * Retrieves the location (as an absolute local file system path) for the classpath dependency represented - * by the specified IVirtualReference. - * @param ref The IVirtualReference - * @return Absolute path in the local file system or null if the specified reference is null or does not refer to - * a VirtualArchiveComponent with type VirtualArchiveComponent.CLASSPATHARCHIVETYPE. - */ - public static IPath getClasspathVirtualReferenceLocation(final IVirtualReference ref) { - if (ref == null) { - return null; - } - if (ref.getReferencedComponent() instanceof VirtualArchiveComponent) { - final VirtualArchiveComponent comp = (VirtualArchiveComponent) ref.getReferencedComponent(); - if (comp.getArchiveType().equals(VirtualArchiveComponent.CLASSPATHARCHIVETYPE)) { - java.io.File cpEntryFile = comp.getUnderlyingDiskFile(); - IPath cpEntryPath; - if (cpEntryFile.exists()) { - cpEntryPath = new Path(cpEntryFile.getAbsolutePath()); - } else { - final IFile iFile = comp.getUnderlyingWorkbenchFile(); - cpEntryPath = iFile.getLocation(); - } - return cpEntryPath; - } - } - return null; - } - - /** - * Retrieves the runtime path to which the resolved classpath entry components will be - * added within the deployed application. - * @param attrib The IClasspathAttribute with the WTP classpath component dependency value. If null, - * will return the default path. - * @param isWebApp True for web projects, false otherwise. - * @return Runtime path. Will be null if the attribute is not a WTP classpath component dependency - * attribute. - */ - public static IPath getRuntimePath(final IClasspathAttribute attrib, final boolean isWebApp) { - if (attrib != null && !attrib.getName().equals(CLASSPATH_COMPONENT_DEPENDENCY)) { - return null; - } - if (attrib == null || attrib.getValue()== null || attrib.getValue().length() == 0) { - return getDefaultRuntimePath(isWebApp); - } - return new Path(attrib.getValue()); - } - - /** - * Retrieves the default runtime path to which the resolved classpath entry components will be - * added within the deployed application. - * @param isWebApp True if the default runtime path for web apps should be returned, false otherwise. - * @return The default runtime path. - */ - public static IPath getDefaultRuntimePath(final boolean isWebApp) { - return isWebApp ? WEB_INF_LIB : PARENT_MAPPING; // $NON-NLS-1$ - } - - /** - * Retrieves the archive name for the specified classpath entry - * @param entry The entry. - * @return The archive name. - */ - public static String getArchiveName(final IClasspathEntry entry) { - final IPath entryLocation = getEntryLocation(entry); - return entryLocation.lastSegment(); - } - - /** - * Checks if the specified IClasspathEntry has one of the special WTP component dependency - * attributes that indicate it should be mapped into the virtual component for the associated project. - * - * @param entry The IClasspathEntry. - * @return The IClasspathAttribute that holds the special WTP attribute or null if one was not found. - */ - public static IClasspathAttribute checkForComponentDependencyAttribute(final IClasspathEntry entry) { - if (entry == null) { - return null; - } - final IClasspathAttribute[] attributes = entry.getExtraAttributes(); - for (int i = 0; i < attributes.length; i++) { - final IClasspathAttribute attribute = attributes[i]; - final String name = attribute.getName(); - if (name.equals(CLASSPATH_COMPONENT_DEPENDENCY) - || name.equals(CLASSPATH_COMPONENT_NON_DEPENDENCY)) { - return attribute; - } - } - return null; - } - - /** - * Determines if the specified virtual component represents a classpath component dependency. - * @param component Virtual component to test - * @return True if a classpath component dependency, false otherwise. - */ - public static boolean isClasspathComponentDependency(final IVirtualComponent component) { - if (component == null) { - return false; - } - if (component instanceof VirtualArchiveComponent) { - final VirtualArchiveComponent archiveComp = (VirtualArchiveComponent) component; - return archiveComp.getArchiveType().equals(VirtualArchiveComponent.CLASSPATHARCHIVETYPE); - } - return false; - } - - /** - * Retrieves the classpath component display string for the specified component. - * @param component Component that represents a classpath component. - * @return Display string. - */ - public static String getClasspathComponentDependencyDisplayString(final IVirtualComponent component) { - final URI archiveURI = URI.createURI(ModuleURIUtil.getHandleString(component)); - return archiveURI.lastSegment(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/IClasspathDependencyConstants.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/IClasspathDependencyConstants.java deleted file mode 100644 index d0d160169..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/IClasspathDependencyConstants.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 BEA Systems, Inc. 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: - * BEA Systems, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.classpathdep; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -/** - * Holds constants related to classpath component dependencies. - */ -public interface IClasspathDependencyConstants { - - /** - * Name of the custom Java classpath entry attribute that is used to flag - * entries which should be exposed as module dependencies via the virtual component API. - * The value of the attribute represents the runtime path to which resolved classpath entry components - * will be mapped in the deployed/exported module. By default, tagged classpath entries of dynamic web - * projects will be mapped to the /WEB-INF/lib folder of the web project. Tagged classpath entries of - * utility, ejb and connector projects will be mapped to either the root of the EAR (if the project is - * referenced by an EAR) or to the /WEB-INF/lib directory of the WAR (if the project is a - * web library reference of a web project); the runtime path of "../" is used to represent the mapping - * into the referencing module in both of these cases. - * Only container, library and variable entries are currently supported; for containers, only the resolved - * entries that are library entries are supported. All resolved entries are mapped unless they have the - * "org.eclipse.jst.component.nondependency" attribute (or are project or lib entries that map to class - * folders which are not currently supported and are therefore always skipped). - */ - public static final String CLASSPATH_COMPONENT_DEPENDENCY = "org.eclipse.jst.component.dependency"; //$NON-NLS-1 - - /** - * Name of the custom Java classpath entry attribute that is used to flag - * the resolved entries of classpath containers that should not be exposed - * via the virtual component API. - */ - public static final String CLASSPATH_COMPONENT_NON_DEPENDENCY = "org.eclipse.jst.component.nondependency"; //$NON-NLS-1 - - /** - * Runtime path used to indicate that the resolved contributions from a classpath entry should be - * mapped into the exported/deployed structure of the parent module at the same location that the target module - * is mapped (will be either the EAR root or /WEB-INF/lib). - */ - public static final String RUNTIME_MAPPING_INTO_CONTAINER = "../"; - - /** - * IPath value of RUNTIME_MAPPING_INTO_CONTAINER. - */ - public static final IPath RUNTIME_MAPPING_INTO_CONTAINER_PATH = new Path(RUNTIME_MAPPING_INTO_CONTAINER); -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/UpdateClasspathAttributeUtil.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/UpdateClasspathAttributeUtil.java deleted file mode 100644 index d295928cf..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/classpathdep/UpdateClasspathAttributeUtil.java +++ /dev/null @@ -1,166 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 BEA Systems, Inc. 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: - * BEA Systems, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.classpathdep; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.j2ee.internal.classpathdep.UpdateClasspathAttributesDataModelProperties; -import org.eclipse.jst.j2ee.internal.classpathdep.UpdateClasspathAttributesDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -/** - * Contains utility code for executing the UpdateClasspathAttributeOperation. - */ -public class UpdateClasspathAttributeUtil implements IClasspathDependencyConstants { - - /** - * Creates an IClasspathAttribute with the special WTP "org.eclipse.jst.component.dependency" name whose runtime path - * (represented by the value) is unspecified and will therefore take the default value for the project in which it is - * added. - * @return The created IClasspathAttribute. - * @throws CoreException Thrown if a problem is encountered. - */ - public static IClasspathAttribute createDependencyAttribute() throws CoreException { - return createDependencyAttribute(""); - } - - /** - * Creates an IClasspathAttribute with the special WTP "org.eclipse.jst.component.dependency" name whose runtime path - * (represented by the value) is set to the default for either a web project (/WEB-INF/lib) or non-web project (../). - * @param isWebApp True if this attribute is being created for a classpath entry on a dynamic web project. - * @return The created IClasspathAttribute. - * @throws CoreException Thrown if a problem is encountered. - */ - public static IClasspathAttribute createDependencyAttribute(final boolean isWebApp) throws CoreException { - return createDependencyAttribute(ClasspathDependencyUtil.getDefaultRuntimePath(isWebApp)); - } - - /** - * Creates an IClasspathAttribute with the special WTP "org.eclipse.jst.component.dependency" name with the - * specified runtime path (will be used to set the attribute value). - * @param runtimePath The runtime path in the deployed/exported module where resolved classpath components should - * be added. Must be non-null. - * @return The created IClasspathAttribute. - * @throws CoreException Thrown if a problem is encountered. - */ - public static IClasspathAttribute createDependencyAttribute(final IPath runtimePath) throws CoreException { - return createDependencyAttribute(runtimePath.toString()); - } - - private static IClasspathAttribute createDependencyAttribute(final String runtimePath) throws CoreException { - return JavaCore.newClasspathAttribute(IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY, runtimePath); - } - - /** - * Creates an IClasspathAttribute with the special WTP "org.eclipse.jst.component.nondependency" name. This attribute is - * used on the resolved entries of classpath containers to prevent them from being exported/published. - * @return The created IClasspathAttribute. - * @throws CoreException Thrown if a problem is encountered. - */ - public static IClasspathAttribute createNonDependencyAttribute() throws CoreException { - return JavaCore.newClasspathAttribute(IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY, ""); - } - - /** - * Updates the specified Java project so that only the specified classpath entries have - * the WTP component dependency attribute. - * @param projectName Name of the target Java project. - * @param entryToRuntimePath Map from IClasspathEntry to runtime path for all entries that should - * have the component dependency attribute. - * @return Status from the operation. - * @throws ExecutionException Thrown if an error is encountered. - */ - public static IStatus updateDependencyAttributes(final IProgressMonitor monitor, final String projectName, final Map entryToRuntimePath) - throws ExecutionException { - return createUpdateDependencyAttributesOperation(projectName, entryToRuntimePath).execute(monitor, null); - } - - /** - * Creates the IDataModelOperation that will update the classpath for the specified Java project so that - * only the specified list of classpath entries will have WTP component dependency attribute. - * @param projectName Name of the target Java project. - * @param entryToRuntimePath Map from IClasspathEntry to runtime path for all entries that should - * have the component dependency attribute. - * @return The operation. - */ - public static IDataModelOperation createUpdateDependencyAttributesOperation(final String projectName, final Map entryToRuntimePath) { - return createOperation(projectName, entryToRuntimePath, UpdateClasspathAttributesDataModelProperties.ENTRIES_WITH_ATTRIBUTE); - } - - /** - * Adds the WTP component dependency attribute to the specified classpath entry using the default runtime path for the project. Does NOT check that the - * specified entry is a valid entry for the dependency attribute. - * - * @param monitor Progress monitor. Can be null. - * @param projectName Name of the target Java project. - * @param entry Classpath entry to which the attribute should be added. - * @return Status from the operation. - * @throws ExecutionException Thrown if an error is encountered. - */ - public static IStatus addDependencyAttribute(final IProgressMonitor monitor, final String projectName, final IClasspathEntry entry) - throws ExecutionException { - return addDependencyAttribute(monitor, projectName, entry, null); - } - - /** - * Adds the WTP component dependency attribute to the specified classpath entry. Does NOT check that the - * specified entry is a valid entry for the dependency attribute. - * - * @param monitor Progress monitor. Can be null. - * @param projectName Name of the target Java project. - * @param entry Classpath entry to which the attribute should be added. - * @param runtimePath Runtime path to which entry elements should be deployed. Null if the default runtime path for the project should be used. - * @return Status from the operation. - * @throws ExecutionException Thrown if an error is encountered. - */ - public static IStatus addDependencyAttribute(final IProgressMonitor monitor, final String projectName, final IClasspathEntry entry, final IPath runtimePath) - throws ExecutionException { - final Map entryToRuntimePath = new HashMap(); - entryToRuntimePath.put(entry, runtimePath); - return createOperation(projectName, entryToRuntimePath, UpdateClasspathAttributesDataModelProperties.ENTRIES_TO_ADD_ATTRIBUTE).execute(monitor, null); - } - - /** - * Removes the WTP component dependency attribute from the specified classpath entry. Does NOT check that the - * specified entry is a valid entry for the dependency attribute. - * - * @param monitor Progress monitor. Can be null. - * @param projectName Name of the target Java project. - * @param entry Classpath entry from which the attribute should be removed. - * @return Status from the operation. - * @throws ExecutionException Thrown if an error is encountered. - */ - public static IStatus removeDependencyAttribute(final IProgressMonitor monitor, final String projectName, final IClasspathEntry entry) - throws ExecutionException { - final Map entryToRuntimePath = new HashMap(); - entryToRuntimePath.put(entry, null); - return createOperation(projectName, entryToRuntimePath, UpdateClasspathAttributesDataModelProperties.ENTRIES_TO_REMOVE_ATTRIBUTE).execute(monitor, null); - } - - private static IDataModelOperation createOperation(String projectName, final Map entryToRuntimePath, final String entryMapProperty) { - IDataModel dataModel = DataModelFactory.createDataModel(new UpdateClasspathAttributesDataModelProvider()); - dataModel.setProperty(UpdateClasspathAttributesDataModelProperties.PROJECT_NAME, projectName); - dataModel.setProperty(entryMapProperty, entryToRuntimePath); - return dataModel.getDefaultOperation(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyExtensions.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyExtensions.java deleted file mode 100644 index a3019546a..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyExtensions.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 BEA Systems, Inc. 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: - * BEA Systems, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.classpathdep; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - -/** - * Reads classpath dependency related extension point data. - */ -public class ClasspathDependencyExtensions { - - private static final String CLASSPATH_DEP_EXTENSION_ID = "classpathdep"; //$NON-NLS-1$ - private static final String FILTERED_CLASSPATH_CONTAINER = "filteredClasspathContainer"; //$NON-NLS-1$ - private static final String CLASSPATH_CONTAINER_ID = "containerID"; //$NON-NLS-1$ - private static ClasspathDependencyExtensions _instance = null; - - public static ClasspathDependencyExtensions get() { - if (_instance == null) { - _instance = new ClasspathDependencyExtensions(); - } - return _instance; - } - - private final List filteredClasspathContainerIDs; - - private ClasspathDependencyExtensions() { - filteredClasspathContainerIDs = new ArrayList(); - readExtensions(); - } - - /** - * Returns the Set of classpath container IDs that should - * be filtered from the container that can potentially be marked - * as dependencies. This set of defined using the extension point - * org.eclipse.jst.j2ee.FilteredClasspathContainersExtension. - * @return Set of classpath container IDs. - */ - public List getFilteredClasspathContainerIDs() { - return filteredClasspathContainerIDs; - } - - private void readExtensions() { - final IExtensionRegistry registry = Platform.getExtensionRegistry(); - final IExtensionPoint point = registry.getExtensionPoint(J2EEPlugin.PLUGIN_ID, - CLASSPATH_DEP_EXTENSION_ID); - - if(point == null) { - throw new RuntimeException("Extension point not found!"); //$NON-NLS-1$ - } - - final IExtension[] extensions = point.getExtensions(); - for (int i = 0; i < extensions.length; i++) { - final IConfigurationElement[] elements = extensions[i].getConfigurationElements(); - for (int j = 0; j < elements.length; j++) { - if (elements[j].getName().equals(FILTERED_CLASSPATH_CONTAINER)) { - String cpContainerID = elements[j].getAttribute(CLASSPATH_CONTAINER_ID); //$NON-NLS-1$ - if (cpContainerID != null) { - filteredClasspathContainerIDs.add(cpContainerID); - } - } - } - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyManifestUtil.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyManifestUtil.java deleted file mode 100644 index b2cc4260f..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyManifestUtil.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 BEA Systems, Inc. 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: - * BEA Systems, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.classpathdep; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl; - -/** - * Contains utility code for working manipulating the module MANIFEST.MF - * classpath to reflect classpath component dependencies. - */ -public class ClasspathDependencyManifestUtil { - - /** - * Generates new MANIFEST.MF with a dynamically updated classpath that is written to the specified - * output stream. - * @param manifestFile The current MANIFEST.MF file. - * @param dynamicURIs Is List of URIs to dynamically add to the manifest classpath. - * @param outputStream Stream to which the modified entry should be written. - * @throws IOException - * @throws FileNotFoundException - */ - public static void updateManifestClasspath(final IFile manifestFile, final List dynamicURIs, final OutputStream outputStream) throws IOException, FileNotFoundException { - - try { - InputStream in = null; - ArchiveManifest manifest = null; - try { - in = manifestFile.getContents(); - manifest = new ArchiveManifestImpl(in); - } catch (CoreException ce) { - throw new IOException(ce.getLocalizedMessage()); - } finally { - if (in != null) { - try { - in.close(); - in = null; - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - } - final String[] manifestClasspath = manifest.getClassPathTokenized(); - final List updatedCP = new ArrayList(); - for (int i = 0; i < manifestClasspath.length; i++) { - updatedCP.add(manifestClasspath[i]); - } - // update manifest classpath to include dynamic entries - for (int j = 0; j < dynamicURIs.size(); j++) { - final String containerURI = (String) dynamicURIs.get(j); - // need to check existing entries to ensure it doesn't are exist on the classpath - boolean exists = false; - for (int i = 0; i < manifestClasspath.length; i++) { - if (manifestClasspath[i].equals(containerURI)) { - exists = true; - break; - } - } - if (!exists) { - updatedCP.add(containerURI); - } - } - final StringBuffer cpBuffer = new StringBuffer(); - boolean first = true; - for (int j = 0; j < updatedCP.size(); j++) { - if (!first) { - cpBuffer.append(" "); - } else { - first = false; - } - cpBuffer.append((String) updatedCP.get(j)); - } - manifest.setClassPath(cpBuffer.toString()); - manifest.write(outputStream); - outputStream.flush(); - } finally { - if (outputStream != null) { - outputStream.close(); - } - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyValidator.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyValidator.java deleted file mode 100644 index 1727e7d34..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyValidator.java +++ /dev/null @@ -1,291 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 2007 BEA Systems, Inc. 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: - * BEA Systems, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.classpathdep; - - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.jdt.core.IClasspathAttribute; -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.jst.j2ee.classpathdep.ClasspathDependencyUtil; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.validation.internal.core.Message; -import org.eclipse.wst.validation.internal.core.ValidationException; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; -import org.eclipse.wst.validation.internal.provisional.core.IValidationContext; -import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob; - -/** - * Validates classpath entries that have been tagged as component dependencies. - */ -public class ClasspathDependencyValidator implements IValidatorJob { - - public static final String AppClientProject = "AppClientProject"; //$NON-NLS-1$ - public static final String RootMappingNonEARWARRef = "RootMappingNonEARWARRef"; //$NON-NLS-1$ - public static final String NonTaggedExportedClasses = "NonTaggedExportedClasses"; //$NON-NLS-1$ - public static final String DuplicateArchiveName = "DuplicateArchiveName"; //$NON-NLS-1$ - public static final String ProjectClasspathEntry = "ProjectClasspathEntry"; //$NON-NLS-1$ - public static final String SourceEntry = "SourceEntry"; //$NON-NLS-1$ - public static final String FilteredContainer = "FilteredContainer"; //$NON-NLS-1$ - public static final String ClassFolderEntry = "ClassFolderEntry"; //$NON-NLS-1$ - public static final String NonWebNonExported = "NonWebNonExported"; //$NON-NLS-1$ - public static final String InvalidNonWebRuntimePath = "InvalidNonWebRuntimePath"; //$NON-NLS-1$ - public static final String InvalidWebRuntimePath = "InvalidWebRuntimePath"; //$NON-NLS-1$ - - protected IReporter _reporter; - - public ClasspathDependencyValidator() { - super(); - } - - public IStatus validateInJob(IValidationContext helper, IReporter reporter) - throws ValidationException { - _reporter = reporter; - //Remove all markers related to this validator - _reporter.removeAllMessages(this); - //Using the helper class, load the module model - final Set archiveNames = new HashSet(); - final IProject proj = ((ClasspathDependencyValidatorHelper) helper).getProject(); - try { - if (proj.isAccessible() - && proj.hasNature(ModuleCoreNature.MODULE_NATURE_ID) - && proj.hasNature(JavaCore.NATURE_ID)) { - - final IJavaProject javaProject = JavaCore.create(proj); - final boolean isWebApp = J2EEProjectUtilities.isDynamicWebProject(proj); - final Map referencedRawEntries = ClasspathDependencyUtil.getRawComponentClasspathDependencies(javaProject); - final List potentialRawEntries = ClasspathDependencyUtil.getPotentialComponentClasspathDependencies(javaProject); - final IVirtualComponent component = ComponentCore.createComponent(proj); - - // validate the raw referenced container entries - Iterator i = referencedRawEntries.keySet().iterator(); - boolean hasRootMapping = false; - while (i.hasNext()) { - final IClasspathEntry entry = (IClasspathEntry) i.next(); - final IClasspathAttribute attrib = (IClasspathAttribute) referencedRawEntries.get(entry); - final IPath runtimePath = ClasspathDependencyUtil.getRuntimePath(attrib, isWebApp); - if (runtimePath.equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - hasRootMapping = true; - } - IMessage[] msgs = validateVirtualComponentEntry(entry, attrib, isWebApp, proj); - final String cpEntryPath = entry.getPath().toString(); - for (int j = 0; j < msgs.length; j++) { - msgs[j].setGroupName(cpEntryPath); - } - reportMessages(msgs); - // if not a web app, warn if associated cp entry is not exported - if (!isWebApp && !entry.isExported()) { - _reporter.addMessage(this, new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.NORMAL_SEVERITY, NonWebNonExported, new String[]{cpEntryPath}, proj)); - } - } - - if (!referencedRawEntries.isEmpty()) { - if (J2EEProjectUtilities.isApplicationClientProject(proj)) { - // classpath component dependencies are not supported for application client projects - final IMessage msg = new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.HIGH_SEVERITY, AppClientProject, null, proj); - _reporter.addMessage(this, msg); - } - - // are there any root mappings - if (hasRootMapping && component != null) { - boolean referencedFromEARorWAR = false; - final List earWarRefs = new ArrayList(); - final IVirtualComponent[] refComponents = component.getReferencingComponents(); - for (int j = 0; j < refComponents.length; j++) { - if (J2EEProjectUtilities.isEARProject(refComponents[j].getProject()) - || J2EEProjectUtilities.isDynamicWebProject(refComponents[j].getProject())) { - referencedFromEARorWAR = true; - earWarRefs.add(refComponents[j]); - } - } - if (!referencedFromEARorWAR) { - // warn if there are root mappings and the project is not referenced by an EAR or a WAR - final IMessage msg =new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.NORMAL_SEVERITY, RootMappingNonEARWARRef, null, proj); - _reporter.addMessage(this, msg); - } - } - } - - // generate warning messages for any potential entries; we warn for these since - // the classes are being exposed but will not be bundled into the exported/published module and - // therefore will not be available at runtime. - i = potentialRawEntries.iterator(); - while (i.hasNext()) { - final IClasspathEntry entry = (IClasspathEntry) i.next(); - final IMessage msg =new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.NORMAL_SEVERITY, NonTaggedExportedClasses, new String[]{entry.getPath().toString()}, proj); - msg.setGroupName(entry.getPath().toString()); - _reporter.addMessage(this, msg); - } - - // validate all resolved entries (only perform this if there are raw referenced entries) - if (!referencedRawEntries.isEmpty()) { - final Map referencedResolvedEntries = ClasspathDependencyUtil.getComponentClasspathDependencies(javaProject, isWebApp, false); - i = referencedResolvedEntries.keySet().iterator(); - while (i.hasNext()) { - final IClasspathEntry entry = (IClasspathEntry) i.next(); - final IClasspathAttribute attrib = (IClasspathAttribute) referencedResolvedEntries.get(entry); - // compute the archive name - final String archivePath = ClasspathDependencyUtil.getArchiveName(entry); - if (archiveNames.contains(archivePath)) { - // Project cp entry - final IMessage msg = new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.HIGH_SEVERITY, DuplicateArchiveName, new String[]{entry.getPath().toString()}, proj); - _reporter.addMessage(this, msg); - } else { - archiveNames.add(archivePath); - } - // validate the resolved entry if we didn't already validate as part of the raw entries - if (!referencedRawEntries.containsKey(entry)) { - IMessage[] msgs = validateVirtualComponentEntry(entry, attrib, isWebApp, proj); - reportMessages(msgs); - } - } - } - } - } catch (CoreException e) { - Logger.getLogger(J2EEPlugin.PLUGIN_ID).logError(e); - } - - return Status.OK_STATUS; - } - - private void reportMessages(final IMessage[] msgs) { - for (int i = 0; i < msgs.length; i++) { - _reporter.addMessage(this, msgs[i]); - } - } - - /** - * Checks if the specified Java classpath entry is a valid WTP virtual component reference. - * Does not check the runtime path. - * @param entry Raw or resolved classpath entry to validate. - * @param attrib The WTP classpath component dependency attribute. Null if it has not yet been set. - * @param isWebApp True if the target project is associated with a web project. - * @return IMessages representing validation results. - */ - public static IMessage[] validateVirtualComponentEntry(final IClasspathEntry entry, final IClasspathAttribute attrib, final boolean isWebApp, final IProject project) { - List results = new ArrayList(); - if (entry == null) { - return (IMessage[]) results.toArray(new IMessage[results.size()]); - } - - final int kind = entry.getEntryKind(); - if (kind == IClasspathEntry.CPE_PROJECT) { - - // Project cp entry - results.add(new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.HIGH_SEVERITY, ProjectClasspathEntry, new String[]{entry.getPath().toString()}, project)); - - return (IMessage[]) results.toArray(new IMessage[results.size()]); - } else if (kind == IClasspathEntry.CPE_SOURCE) { - - // Source cp entry - - results.add(new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.HIGH_SEVERITY, SourceEntry, new String[]{entry.getPath().toString()}, project)); - return (IMessage[]) results.toArray(new IMessage[results.size()]); - } else if (kind == IClasspathEntry.CPE_CONTAINER) { - - // get the set of classpath container IDs that should be filtered - List filteredIDs = ClasspathDependencyExtensions.get().getFilteredClasspathContainerIDs(); - final IPath path = entry.getPath(); - for (int i = 0; i < filteredIDs.size(); i++) { - final String id = (String) filteredIDs.get(i); - if (path.segment(0).equals(id)) { - // filtered classpath container - results.add(new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.HIGH_SEVERITY, FilteredContainer, new String[]{entry.getPath().toString()}, project)); - return (IMessage[]) results.toArray(new IMessage[results.size()]); - } - } - - } else if (kind == IClasspathEntry.CPE_LIBRARY) { - // does the path refer to a file or a folder? - final IPath entryPath = entry.getPath(); - IPath entryLocation = entryPath; - final IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(entryPath); - if (resource != null) { - entryLocation = resource.getLocation(); - } - boolean isFile = true; // by default, assume a jar file - if (entryLocation.toFile().isDirectory()) { - isFile = false; - } - - if (!isFile) { - // Class folder reference - results.add(new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.HIGH_SEVERITY, ClassFolderEntry, new String[]{entry.getPath().toString()}, project)); - } - } - - final IPath runtimePath = ClasspathDependencyUtil.getRuntimePath(attrib, isWebApp); - if (!isWebApp) { - // only a ../ mapping is currently legal in a non-web context - if (!runtimePath.equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - results.add(new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.HIGH_SEVERITY, InvalidNonWebRuntimePath, new String[]{entry.getPath().toString(), runtimePath.toString()}, project)); - } - } else { - String pathStr = runtimePath.toString(); - // can only be ../, /WEB-INF/lib or /WEB-INF/classes - if (!runtimePath.equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH) - && !pathStr.equals("/WEB-INF/lib") - && !pathStr.equals("/WEB-INF/classes")) { - results.add(new Message("classpathdependencyvalidator", // $NON-NLS-1$ - IMessage.HIGH_SEVERITY, InvalidWebRuntimePath, new String[]{entry.getPath().toString(), pathStr}, project)); - } - } - - return (IMessage[]) results.toArray(new IMessage[results.size()]); - } - - public ISchedulingRule getSchedulingRule(IValidationContext helper) { - return null; - } - - public void cleanup(IReporter reporter) { - _reporter = null; - - } - - public void validate(IValidationContext helper, IReporter reporter) - throws ValidationException { - // Forwarding to job method - validateInJob(helper, reporter); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyValidatorHelper.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyValidatorHelper.java deleted file mode 100644 index 4cc05e2d2..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/ClasspathDependencyValidatorHelper.java +++ /dev/null @@ -1,21 +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.j2ee.internal.classpathdep; - -import org.eclipse.wst.validation.internal.operations.WorkbenchContext; - - -public class ClasspathDependencyValidatorHelper extends WorkbenchContext { - - public ClasspathDependencyValidatorHelper() { - super(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesDataModelProperties.java deleted file mode 100644 index b45cfd3a3..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesDataModelProperties.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 BEA Systems, Inc. - * 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 - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.classpathdep; - -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; - -/** - * Properties for the UpdateClasspathAttributesOperation. - */ -public interface UpdateClasspathAttributesDataModelProperties extends IClasspathDependencyConstants { - - /** - * Project name. Required. - */ - public static final String PROJECT_NAME = "UpdateClasspathAttributesDataModel.PROJECT_NAME"; //$NON-NLS-1$ - - /** - * Classpath entries that should have the component dependency attribute. Map from IClasspathEntry to runtime IPath. Will be - * ignored if either ENTRIES_TO_ADD_ATTRIBUTE or ENTRIES_TO_REMOVE_ATTRIBUTE are specified. - */ - public static final String ENTRIES_WITH_ATTRIBUTE = "UpdateClasspathAttributesDataModel.ENTRIES_WITH_ATTRIBUTE"; //$NON-NLS-1$ - - /** - * Classpath entries to which the component dependency attribute should be added. Map from IClasspathEntry to runtime IPath. If this - * property is specified, ENTRIES_WITH_ATTRIBUTE and ENTRIES_TO_REMOVE_ATTRIBUTE will be ignored - */ - public static final String ENTRIES_TO_ADD_ATTRIBUTE = "UpdateClasspathAttributesDataModel.ENTRIES_TO_ADD_ATTRIBUTE"; //$NON-NLS-1$ - - /** - * Classpath entries to which the component dependency attribute should be added. - * Map from IClasspathEntry to runtime IPath. If this property is specified, ENTRIES_WITH_ATTRIBUTE will be ignored. This attribute will be ignored if ENTRIES_TO_ADD_ATTRIBUTE is specified. - */ - public static final String ENTRIES_TO_REMOVE_ATTRIBUTE = "UpdateClasspathAttributesDataModel.ENTRIES_TO_REMOVE_ATTRIBUTE"; //$NON-NLS-1$ - - - -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesDataModelProvider.java deleted file mode 100644 index 8ef94f897..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesDataModelProvider.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 BEA Systems, Inc. - * 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 - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.classpathdep; - -import java.util.ArrayList; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.internal.common.J2EECommonMessages; - -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; - -/** - * DataModelProvider for the UpdateClasspathAttributesOperation. - */ -public class UpdateClasspathAttributesDataModelProvider extends AbstractDataModelProvider implements UpdateClasspathAttributesDataModelProperties { - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#getPropertyNames() - */ - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PROJECT_NAME); - propertyNames.add(ENTRIES_WITH_ATTRIBUTE); - propertyNames.add(ENTRIES_TO_ADD_ATTRIBUTE); - propertyNames.add(ENTRIES_TO_REMOVE_ATTRIBUTE); - return propertyNames; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#getDefaultProperty(java.lang.String) - */ - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(ENTRIES_WITH_ATTRIBUTE)) { - return new ArrayList(); - } - return super.getDefaultProperty(propertyName); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#getDefaultOperation() - */ - public IDataModelOperation getDefaultOperation() { - return new UpdateClasspathAttributesOperation(model); - } - - public IProject getProject() { - return ProjectUtilities.getProject(getStringProperty(PROJECT_NAME)); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#validate(java.lang.String) - */ - public IStatus validate(String property) { - if (property.equals(PROJECT_NAME)) { - final String projectName = getStringProperty(PROJECT_NAME); - if (projectName == null) { - final String msg = J2EECommonMessages.ERR_EMPTY_PROJECT_NAME; - return WTPCommonPlugin.createErrorStatus(msg); - } - - if (!getProject().isAccessible()) { - final String msg = J2EECommonMessages.getResourceString(J2EECommonMessages.ERR_PROJECT_INACCESSIBLE, new String[]{projectName}); - return WTPCommonPlugin.createErrorStatus(msg); - } - } - - return Status.OK_STATUS; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesOperation.java b/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesOperation.java deleted file mode 100644 index f15d60f66..000000000 --- a/plugins/org.eclipse.jst.j2ee/classpathdep/org/eclipse/jst/j2ee/internal/classpathdep/UpdateClasspathAttributesOperation.java +++ /dev/null @@ -1,245 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 BEA Systems, Inc. - * 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 - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.classpathdep; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil; -import org.eclipse.jst.j2ee.classpathdep.UpdateClasspathAttributeUtil; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * DataModelOperation that updates the WTP component dependency attribute on the - * the classpath entries for the target Java project. - */ -public class UpdateClasspathAttributesOperation extends AbstractDataModelOperation implements UpdateClasspathAttributesDataModelProperties { - - public UpdateClasspathAttributesOperation(final IDataModel dataModel) { - super(dataModel); - } - - public IStatus execute(final IProgressMonitor monitor, final IAdaptable info) - throws ExecutionException { - final IProject project = ProjectUtilities.getProject(model.getStringProperty(PROJECT_NAME)); - - try { - if (project.hasNature(JavaCore.NATURE_ID)) { - final IJavaProject javaProject = JavaCore.create(project); - validateEdit(project); - final Map entriesToAdd = (Map) model.getProperty(ENTRIES_TO_ADD_ATTRIBUTE); - if (entriesToAdd == null) { - final Map entriesToRemove = (Map ) model.getProperty(ENTRIES_TO_REMOVE_ATTRIBUTE); - if (entriesToRemove == null) { - final Map entriesToRuntimePath = (Map) model.getProperty(ENTRIES_WITH_ATTRIBUTE); - final Map entriesToAttrib = new HashMap(); - final Iterator i = entriesToRuntimePath.keySet().iterator(); - while (i.hasNext()) { - IClasspathEntry entry = (IClasspathEntry) i.next(); - IPath runtimePath = (IPath) entriesToRuntimePath.get(entry); - IClasspathAttribute attrib = ClasspathDependencyUtil.checkForComponentDependencyAttribute(entry); - if (attrib == null) { - attrib = UpdateClasspathAttributeUtil.createDependencyAttribute(runtimePath); - } - entriesToAttrib.put(entry, attrib); - } - updateDependencyAttributes(javaProject, entriesToAttrib); - } else { - removeDependencyAttributes(javaProject, entriesToRemove); - } - } else { - addDependencyAttributes(javaProject, entriesToAdd); - } - } - } catch (CoreException ce) { - Logger.getLogger(J2EEPlugin.PLUGIN_ID).logError(ce); - return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, 0, ce.getLocalizedMessage(), ce); - } - return Status.OK_STATUS; - } - - /** - * Performs a validateEdit call on the files impacted by the operation. - */ - protected void validateEdit(final IProject project) throws CoreException { - final List affectedFiles = ProjectUtilities.getFilesAffectedByClasspathChange(project); - final IFile[] files = (IFile[]) affectedFiles.toArray(new IFile[affectedFiles.size()]); - final IStatus result = J2EEPlugin.getWorkspace().validateEdit(files, null); - if (!result.isOK()) { - throw new CoreException(result); - } - } - - /** - * Adds the WTP component dependency attribute to the specified classpath entries. - * @param javaProject Target Java project. - * @param entries Classpath entries to which the component dependency attribute should be added. - * @throws CoreException Thrown if an error is encountered. - */ - private void addDependencyAttributes(final IJavaProject javaProject, final Map entries) throws CoreException { - alterDependencyAttributes(javaProject, entries, true); - } - - /** - * Removes the WTP component dependency attribute from the specified classpath entries. - * @param javaProject Target Java project. - * @param entries Classpath entries from which the component dependency attribute should be removed. - * @throws CoreException Thrown if an error is encountered. - */ - private void removeDependencyAttributes(final IJavaProject javaProject, final Map entries) throws CoreException { - alterDependencyAttributes(javaProject, entries, false); - } - - private void alterDependencyAttributes(final IJavaProject javaProject, final Map entries, final boolean add) throws CoreException { - // initialize to the set of raw entries with the attrib - final Map entriesWithAttrib = ClasspathDependencyUtil.getRawComponentClasspathDependencies(javaProject); - - Iterator i = entries.keySet().iterator(); - while (i.hasNext()) { - final IClasspathEntry entry = (IClasspathEntry) i.next(); - if (add) { - if (getMatchingEntryIgnoreAttributes(entriesWithAttrib, entry) == null) { - IPath runtimePath = (IPath) entries.get(entry); - if (runtimePath == null) { - // compute the default runtime path - final boolean isWebApp = J2EEProjectUtilities.isDynamicWebProject(javaProject.getProject()); - runtimePath = ClasspathDependencyUtil.getDefaultRuntimePath(isWebApp); - } - final IClasspathAttribute attrib = UpdateClasspathAttributeUtil.createDependencyAttribute(runtimePath); - entriesWithAttrib.put(entry, attrib); - } - } else { - IClasspathEntry matching = getMatchingEntryIgnoreAttributes(entriesWithAttrib, entry); - if (matching != null) { - entriesWithAttrib.remove(matching); - } - } - } - updateDependencyAttributes(javaProject, entriesWithAttrib); - } - - private IClasspathEntry getMatchingEntryIgnoreAttributes(final Map entries, final IClasspathEntry entry) { - final Iterator i = entries.keySet().iterator(); - while (i.hasNext()) { - final IClasspathEntry e = (IClasspathEntry) i.next(); - if (e.getEntryKind() == entry.getEntryKind() - && e.getPath().equals(entry.getPath()) - && e.isExported() == entry.isExported()) { - return e; - } - } - return null; - - } - - /** - * Updates the specified Java project so that only the specified classpath entries have - * the WTP component dependency attribute. - * @param javaProject Target Java project. - * @param entries Classpath entries that should have the component dependency attribute. Map from IClasspathEntry - * to the IClasspathAttribute for the WTP classpath component dependency. - * @throws CoreException Thrown if an error is encountered. - */ - private void updateDependencyAttributes(final IJavaProject javaProject, final Map entriesWithAttrib) throws CoreException { - if (javaProject == null || !javaProject.getProject().isAccessible()) { - return; - } - - final List updatedClasspath = new ArrayList(); - final IClasspathEntry[] rawClasspath = javaProject.getRawClasspath(); - boolean needToUpdateClasspath = false; - IClasspathAttribute attrib = UpdateClasspathAttributeUtil.createDependencyAttribute(); - for (int i = 0; i < rawClasspath.length; i++) { - IClasspathEntry entry = rawClasspath[i]; - final int kind = entry.getEntryKind(); - boolean hasAttribute = ClasspathDependencyUtil.checkForComponentDependencyAttribute(entry) != null; - boolean shouldHaveAttribute = entriesWithAttrib.containsKey(entry); - boolean updateAttributes = false; - IClasspathAttribute[] updatedAttributes = null; - if (shouldHaveAttribute) { - if (!hasAttribute) { - // should have the attribute and currently missing it - attrib = (IClasspathAttribute) entriesWithAttrib.get(entry); - updatedAttributes = updateAttributes(entry.getExtraAttributes(), attrib, true); - needToUpdateClasspath = true; - updateAttributes = true; - } - } else if (hasAttribute) { - // should not have the attribute and currently has it - updatedAttributes = updateAttributes(entry.getExtraAttributes(), attrib, false); - needToUpdateClasspath = true; - updateAttributes = true; - } - - if (updateAttributes) { - switch(kind) { - case IClasspathEntry.CPE_CONTAINER: - entry = JavaCore.newContainerEntry(entry.getPath(), entry.getAccessRules(), updatedAttributes, entry.isExported()); - break; - case IClasspathEntry.CPE_LIBRARY: - entry = JavaCore.newLibraryEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), updatedAttributes, entry.isExported()); - break; - case IClasspathEntry.CPE_VARIABLE: - entry = JavaCore.newVariableEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), updatedAttributes, entry.isExported()); - break; - case IClasspathEntry.CPE_PROJECT: // although project entries are not yet supported, allow the attribute here and let the validator flag as an error - entry = JavaCore.newProjectEntry(entry.getPath(), entry.getAccessRules(), entry.combineAccessRules(), updatedAttributes, entry.isExported()); - break; - case IClasspathEntry.CPE_SOURCE: // although source entries are not supported, allow the attribute here and let the validator flag as an error - entry = JavaCore.newSourceEntry(entry.getPath(), entry.getInclusionPatterns(), entry.getExclusionPatterns(), entry.getOutputLocation(), updatedAttributes); - break; - } - } - - updatedClasspath.add(entry); - } - if (needToUpdateClasspath) { - final IClasspathEntry[] updatedCPArray = (IClasspathEntry[]) updatedClasspath.toArray(new IClasspathEntry[updatedClasspath.size()]); - javaProject.setRawClasspath(updatedCPArray, null); - } - } - - private IClasspathAttribute[] updateAttributes(final IClasspathAttribute[] currentAttribs, final IClasspathAttribute targetAttrib, final boolean add) { - final List updatedAttribs = new ArrayList(); - boolean hasAttrib = false; - for (int i = 0; i < currentAttribs.length; i++) { - if (currentAttribs[i].getName().equals(targetAttrib.getName())) { - hasAttrib = true; - if (!add) { - continue; - } - } - updatedAttribs.add(currentAttribs[i]); - } - if (add && !hasAttrib) { - updatedAttribs.add(targetAttrib); - } - return (IClasspathAttribute[]) updatedAttribs.toArray(new IClasspathAttribute[updatedAttribs.size()]); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/CMPJavaChangeSynchronizationAdapter.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/CMPJavaChangeSynchronizationAdapter.java deleted file mode 100644 index 1992762b4..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/CMPJavaChangeSynchronizationAdapter.java +++ /dev/null @@ -1,378 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.common; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.jem.internal.adapters.jdom.JavaJDOMAdapterFactory; -import org.eclipse.jem.internal.java.adapters.ReadAdaptor; -import org.eclipse.jem.internal.java.adapters.ReflectionAdaptor; -import org.eclipse.jem.java.Field; -import org.eclipse.jem.java.JavaClass; -import org.eclipse.jem.java.JavaVisibilityKind; -import org.eclipse.jem.java.util.NotificationUtil; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.emf.workbench.nature.EMFNature; -import org.eclipse.jst.j2ee.ejb.CMPAttribute; -import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl; - -/** - * This adapter is used to listen for changes to the ejb class or the primary key class in order to - * reflect the proper CMP field types and the proper key attributes. - */ -public class CMPJavaChangeSynchronizationAdapter extends AdapterImpl { - - private static final String J2EE_PROJ_MIGRATION_ADAPTER = "J2EEProjectMigration"; //$NON-NLS-1$ - - protected static EjbPackage EJB_PACK = EjbFactoryImpl.getPackage(); - - private static HashMap enablementMap = new HashMap(); - - public static void disable(ContainerManagedEntity cmp) { - enablementMap.put(cmp, Boolean.FALSE); - } - - public static void enable(ContainerManagedEntity cmp) { - enablementMap.put(cmp, Boolean.TRUE); - } - - public static boolean isEnabled(ContainerManagedEntity cmp) { - if (!enablementMap.containsKey(cmp)) - return true; - return ((Boolean) enablementMap.get(cmp)).booleanValue(); - } - - protected Resource cmpResource; - - private List foundKeys = new ArrayList(); - - /* - * This Set is used to avoid reacting to notifications for a notifier while - * updating that notifier. - */ - private Set updatingSet = new HashSet(); - - public CMPJavaChangeSynchronizationAdapter() { - super(); - } // EJBKeyShapeMaintenanceAdapter - - /** - * Notifies if there is change in the key shape. - * - * @param Notification - * msg - Message indicates what has changed. - */ - public void notifyChanged(Notification msg) { - if (!isEnabled(getCMP())) { - enable(getCMP()); - return; - } - Object notifier = msg.getNotifier(); - if (!updatingSet.contains(notifier)) { - try { - updatingSet.add(notifier); - switch (msg.getEventType()) { - case Notification.SET : - setNotification(msg); - break; - case Notification.UNSET : - unsetNotification(msg); - break; - case Notification.REMOVING_ADAPTER : - removeAdapterNotification(msg); - break; - case ReflectionAdaptor.EVENT : - jemFlushNotification(msg); - break; - } - } finally { - updatingSet.remove(notifier); - } - } - } - - /** - * Use if the there was an set notification. - * - * @param Notification - * msg - Message indicates what has changed. - */ - protected void setNotification(Notification msg) { - EStructuralFeature sf = (EStructuralFeature) msg.getFeature(); - if (sf == EJB_PACK.getEnterpriseBean_EjbClass() || sf == EJB_PACK.getEntity_PrimaryKey()) { - if (!isMigrating()) { - removeAttributeMaintenanceAdapter((Notifier) msg.getOldValue()); - addAttributeMaintenanceAdapter((Notifier) msg.getNewValue()); - touchKeyShapeAdapter(msg); - } - } else if (sf == EJB_PACK.getEntity_PrimaryKey()) { - removeAttributeMaintenanceAdapter((Notifier) msg.getOldValue()); - if (shouldAddToPrimaryKeyClass((ContainerManagedEntity) getTarget())) - addAttributeMaintenanceAdapter((Notifier) msg.getNewValue()); - } else { - jemFlushNotification(msg); //In EMF a TOUCH is a SET. - } - } // setNotification - - /** - * @return - */ - private boolean isMigrating() { - EJBJar jar = ((ContainerManagedEntity) getTarget()).getEjbJar(); - if (jar != null) - return EcoreUtil.getExistingAdapter(jar, J2EE_PROJ_MIGRATION_ADAPTER) != null; - return false; - } - - // setNotification - /** - * Use if the there was an unset notification. - * - * @param Notification - * msg - Message indicates what has changed. - */ - protected void unsetNotification(Notification msg) { - EStructuralFeature sf = (EStructuralFeature) msg.getFeature(); - if ((sf == EJB_PACK.getEnterpriseBean_EjbClass() || sf == EJB_PACK.getEntity_PrimaryKey()) && !isMigrating()) { - removeAttributeMaintenanceAdapter((Notifier) msg.getOldValue()); - } - } // unsetNotification - - /** - * Use if the there was an touch notification. - * - * @param Notification - * msg - Message indicates what has changed. - */ - protected void jemFlushNotification(Notification msg) { - if ((NotificationUtil.isFlushNewEvent(msg) || NotificationUtil.isFlushEvent(msg)) && !isMigrating()) { - if (msg.getNotifier() == ((ContainerManagedEntity) getTarget()).getEjbClass()) { - touchBeanAdapter(msg); - } else if (msg.getNotifier() == ((ContainerManagedEntity) getTarget()).getPrimaryKey()) { - touchKeyShapeAdapter(msg); - } // if - //if the notifier is eq the primary key - //else ejb bean class flush - } // if - } // touchNotification - - protected void removeAdapterNotification(Notification msg) { - if (msg.getOldValue() == this && msg.getNotifier() instanceof ContainerManagedEntity) { - ContainerManagedEntity cmp = (ContainerManagedEntity) msg.getNotifier(); - if (cmp.getEjbClass() != null) - cmp.getEjbClass().eAdapters().remove(this); - if (cmp.getPrimaryKey() != null) - cmp.getPrimaryKey().eAdapters().remove(this); - } - } - - /** - * Adds the key shape adapter - * - * @param Notifier - * notifier - The current notifier. - */ - protected void addAttributeMaintenanceAdapter(Notifier notifier) { - if (notifier != null && !notifier.eAdapters().contains(this)) - notifier.eAdapters().add(this); - } - - /** - * Remove the key shape adapter - */ - protected void removeAttributeMaintenanceAdapter(Notifier notifier) { - if (notifier != null) - notifier.eAdapters().remove(this); - } - - /** - * The key has been touched. - * - * @param Notification - * msg - The notification message. - */ - protected void touchKeyShapeAdapter(Notification msg) { - if (msg == null) - return; - ContainerManagedEntity cmp = (ContainerManagedEntity) getTarget(); - JavaClass primaryKeyClass = cmp.getPrimaryKey(); - //Synch the two lists. - synchCMPandKeyAttributes(cmp, primaryKeyClass); - } // touchKeyShapeAdapter - - /** - * The ejb class has been flushed. - * - * @param Notification - * msg - The notification message. - */ - protected void touchBeanAdapter(Notification msg) { - if (msg == null) - return; - ContainerManagedEntity cmp = (ContainerManagedEntity) getTarget(); - List cmpAttributes = cmp.getPersistentAttributes(); - if (cmpAttributes != null || !cmpAttributes.isEmpty()) { - boolean modFlag = getCurrentModificationFlag(); - try { - for (int i = 0; i < cmpAttributes.size(); i++) { - CMPAttribute cmpAttr = (CMPAttribute) cmpAttributes.get(i); - if (cmpAttr != null && !cmpAttr.isDerived()) { - cmpAttr.setEType(null); - } - } - } finally { - setModificationFlag(modFlag); - } - } - synchCMPandKeyAttributes(cmp, cmp.getPrimaryKey()); - } - - /** - * Synchronzies the cmp and primary key class attributes. - * - * @param ContainerManagedEntity - * cmp - The cmp. - * @param JavaClass - * primaryKeyClass - */ - protected void synchCMPandKeyAttributes(ContainerManagedEntity cmp, JavaClass primaryKeyClass) { - if (cmp == null || primaryKeyClass == null || cmp.getPrimKeyField() != null || primaryKeyClass.getQualifiedName().startsWith("java.lang")) //$NON-NLS-1$ - return; - - // make sure we flush the primary key to get latest updates if no save - // took place - flushPrimaryKeyClass(primaryKeyClass); - - List cmpAttributes = cmp.getPersistentAttributes(); - if (cmpAttributes != null || !cmpAttributes.isEmpty()) { - foundKeys.clear(); - List keyAttributesList = cmp.getKeyAttributes(); - foundKeys.addAll(keyAttributesList); - boolean modFlag = getCurrentModificationFlag(); - try { - List keyFields = primaryKeyClass.getFieldsExtended(); - for (int i = 0; i < keyFields.size(); i++) { - Field field = (Field) keyFields.get(i); - if (field.getJavaVisibility() != JavaVisibilityKind.PUBLIC_LITERAL) - continue; - String fieldName = field.getName(); - if (fieldName != null) { - CMPAttribute keyAttr = cmp.getKeyAttribute(fieldName); - if (keyAttr == null) - cmp.addKeyAttributeName(fieldName); - else - foundKeys.remove(keyAttr); - } - } - if (!foundKeys.isEmpty()) - keyAttributesList.removeAll(foundKeys); - } finally { - setModificationFlag(modFlag); - } - } - } - - public void setTarget(Notifier newTarget) { - boolean isChanged = getTarget() != newTarget; - if (newTarget == null) { - super.setTarget(newTarget); - cmpResource = null; - } else if (newTarget instanceof ContainerManagedEntity) { - //TODO - uncomment when compile errors are gone - if (false)/* (EJBCommandCopier.isCodegenCopy(newTarget)) */ - newTarget.eAdapters().remove(this); - else { - Resource res = ((ContainerManagedEntity) newTarget).eResource(); - if (res != null && res.getResourceSet() != null) { - super.setTarget(newTarget); - if (isChanged) - initializeTarget(); - } - } - } - } - - /** - * - */ - private void initializeTarget() { - ContainerManagedEntity cmp = (ContainerManagedEntity) getTarget(); - addAttributeMaintenanceAdapter(cmp.getEjbClass()); - if (shouldAddToPrimaryKeyClass(cmp)) - addAttributeMaintenanceAdapter(cmp.getPrimaryKey()); - } - - private boolean shouldAddToPrimaryKeyClass(ContainerManagedEntity cmp) { - return cmp.getPrimKeyField() == null && cmp.getPrimaryKey() != null && !cmp.getPrimaryKey().getQualifiedName().startsWith("java.lang"); //$NON-NLS-1$ - } - - protected Resource getCMPResource() { - if (cmpResource == null && getTarget() != null) - cmpResource = ((EObject) getTarget()).eResource(); - return cmpResource; - } - - protected boolean getCurrentModificationFlag() { - return getCMPResource() != null && cmpResource.getContents() != null ? cmpResource.isModified() : false; - } - - protected void setModificationFlag(boolean aBoolean) { - if (getCMPResource() != null) - getCMPResource().setModified(aBoolean); - } - - public ContainerManagedEntity getCMP() { - if (getTarget() instanceof ContainerManagedEntity) - return (ContainerManagedEntity) getTarget(); - return null; - } - - protected boolean flushPrimaryKeyClass(JavaClass primaryKeyClass) { - // ensure the primary key class is flushed and reloaded to get latest - // content - IProject p = ProjectUtilities.getProject(primaryKeyClass); - try { - List natures = EMFNature.getRegisteredRuntimes(p); - EMFNature nature = null; - for (int i = 0; i < natures.size(); i++) { - if (natures.get(i) instanceof EMFNature) - nature = (EMFNature) natures.get(i); - } - List adapterFactories = nature.getResourceSet().getAdapterFactories(); - AdapterFactory factory = EcoreUtil.getAdapterFactory(adapterFactories, ReadAdaptor.TYPE_KEY); - if (factory instanceof JavaJDOMAdapterFactory) { - JavaJDOMAdapterFactory javaFactory = (JavaJDOMAdapterFactory) factory; - javaFactory.flushReflectionNoNotification(primaryKeyClass.getQualifiedName()); - return true; - } - } catch (Exception e) { - // We don't really care what the exception was, we'll just bail out - // and return false; - } - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModel.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModel.java deleted file mode 100644 index 71c2b2285..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModel.java +++ /dev/null @@ -1,835 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.common; - - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.internal.operations.ClassPathSelection; -import org.eclipse.jst.j2ee.application.internal.operations.ClasspathElement; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ManifestException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.jst.jee.archive.ArchiveOpenFailureException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.UnresolveableURIException; -import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider; -import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator; -import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorImpl; -import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter; - -public class ClasspathModel implements ResourceStateInputProvider, ResourceStateValidator { - - protected IProject project; - protected IVirtualComponent selectedEARComponent; - protected IArchive earFile; - protected IVirtualComponent component; -// protected IArchive archive; - public EARArtifactEdit earArtifactEdit; - /** The EAR nature runtimes for all the open EAR projects in the workspace */ - protected IVirtualComponent[] availableEARComponents = null; - protected ClassPathSelection classPathSelection; - protected List listeners; - protected List nonResourceFiles; - protected ResourceStateValidator stateValidator; - protected ArchiveManifest manifest; - public static String NO_EAR_MESSAGE = CommonEditResourceHandler.getString("NO_EAR_JARDEP_FOR_MOD_UI_"); //$NON-NLS-1$ - protected List targetWLPRefComponentList; - protected boolean isWLPModel = false; - protected ClassPathSelection classPathWLPSelection; - - protected Comparator comparator = new Comparator() { - public int compare(Object o1, Object o2) { - IVirtualComponent e1 = (IVirtualComponent) o1; - IVirtualComponent e2 = (IVirtualComponent) o2; - return e1.getProject().getName().compareTo(e2.getProject().getName()); - } - }; - - - public ClasspathModel(ArchiveManifest initialManifest) { - super(); - manifest = initialManifest; - } - - public IProject getProject() { - return project; - } - - public void setProject(IProject project) { - this.project = project; - initializeComponent(); - getAvailableEARComponents(); - } - - private void initializeComponent() { - setComponent(ComponentCore.createComponent(getProject())); - } - - protected IVirtualComponent[] refreshAvailableEARs() { - if (component != null) { - IProject[] earProjects = J2EEProjectUtilities.getReferencingEARProjects(getComponent().getProject()); - availableEARComponents = ComponentUtilities.getComponents(earProjects); - if (availableEARComponents != null && availableEARComponents.length > 0) { - Arrays.sort(availableEARComponents, comparator); - if (selectedEARComponent == null || !Arrays.asList(availableEARComponents).contains(selectedEARComponent)) { - if (availableEARComponents.length > 0) - selectedEARComponent = availableEARComponents[0]; - else - selectedEARComponent = null; - } - } - } - return availableEARComponents; - } - - public IVirtualComponent[] getAvailableEARComponents() { - if (availableEARComponents == null) - refreshAvailableEARs(); - return availableEARComponents; - } - - /** - * Gets the selectedEARComponent. - * - * @return Returns a EARNatureRuntime - */ - public IVirtualComponent getSelectedEARComponent() { - return selectedEARComponent; - } - - public void setSelectedEARComponent(IVirtualComponent component) { - selectedEARComponent = component; - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.EAR_PROJECT_CHANGED)); - } - - public String getArchiveURI() { - if (selectedEARComponent != null) { - IVirtualReference [] refs = selectedEARComponent.getReferences(); - IVirtualComponent moduleComp = getComponent(); - for(int i=0; i<refs.length; i++){ - if(refs[i].getReferencedComponent().equals(moduleComp)){ - return refs[i].getArchiveName(); - } - } - } - return null; - } - - /** - * - * @deprecated - will be removed in WTP 3.0 - */ - public EARArtifactEdit getEARArtifactEdit() { - if (earArtifactEdit == null || selectedEARComponentChanged()) - earArtifactEdit = EARArtifactEdit.getEARArtifactEditForRead(selectedEARComponent); - return earArtifactEdit; - } - - private boolean selectedEARComponentChanged() { - if (earArtifactEdit != null && !earArtifactEdit.getComponent().getName().equals(selectedEARComponent.getName())) { - earArtifactEdit.dispose(); - earArtifactEdit = null; - return true; - } - return false; - } - - protected void initializeEARFile() { - if (selectedEARComponent == null || !isDDInEAR(selectedEARComponent)) { - earFile = null; - return; - } - try { - earFile = JavaEEArchiveUtilities.INSTANCE.openArchive(selectedEARComponent); - } catch (ArchiveOpenFailureException aofex) - { - handleOpenFailureException(aofex); - } - } - - /** - * initializeSelection method comment. - */ - protected void initializeSelection(ArchiveManifest existing) { - try { - initializeEARFile(); - initializeArchive(); - if (!J2EEProjectUtilities.isEARProject(getProject())) { - if (getProject() != null) { - if (existing == null) { - if (manifest != null) - { - J2EEProjectUtilities.writeManifest(getProject(), manifest); - } - else - // Load it now because we're going to close the EAR; - // this might be a binary project - manifest = J2EEProjectUtilities.readManifest(getProject()); - } else - { - J2EEProjectUtilities.writeManifest(getProject(), existing); - manifest = existing; - } - if (selectedEARComponent != null) { - IVirtualReference[] archiveFiles = selectedEARComponent.getReferences(); - IVirtualComponent anArchive = null; - for (int i = 0; i < archiveFiles.length; i++) { - anArchive = archiveFiles[i].getReferencedComponent(); - try { - if (J2EEProjectUtilities.isEJBComponent(anArchive)) { - IModelProvider modelProvider = ModelProviderManager.getModelProvider(anArchive.getProject()); - modelProvider.getModelObject(); - } - J2EEProjectUtilities.readManifest(anArchive.getProject()); - } catch (ManifestException mfEx) { - Logger.getLogger().logError(mfEx); - // anArchive.setManifest((ArchiveManifest) new ArchiveManifestImpl()); - } catch (DeploymentDescriptorLoadException ddException) { - Logger.getLogger().logError(ddException); - } - } - } - } - createClassPathSelection(); - } - } catch (IOException e) { - handleOpenFailureException(e); - } finally { - if (earFile != null) - JavaEEArchiveUtilities.INSTANCE.closeArchive(earFile); - } - } - - protected void initializeArchive() { - // do nothing now- just use the project - } - - protected void createClassPathSelection() { - if (getComponent() != null && selectedEARComponent != null ) - classPathSelection = new ClassPathSelection(getComponent(), selectedEARComponent); - else - classPathSelection = null; - } - - protected boolean isDDInEAR(IVirtualComponent aComponent) { - IContainer mofRoot = aComponent.getProject(); - if (mofRoot == null || !mofRoot.exists()) - return false; - - return mofRoot.exists(new Path(aComponent.getRootFolder().getProjectRelativePath().toString() + "//" + J2EEConstants.APPLICATION_DD_URI)); //$NON-NLS-1$ - } - - protected void handleOpenFailureException(Exception ex) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); - } - - public void dispose() { - if (earArtifactEdit != null) { - earArtifactEdit.dispose(); - earArtifactEdit = null; - } - } - - public ClassPathSelection getClassPathSelection() { - if (classPathSelection == null) - initializeSelection(null); - return classPathSelection; - } - - public void resetClassPathSelection(ArchiveManifest mf) { - initializeSelection(mf); - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.CLASS_PATH_RESET)); - } - - public void resetClassPathSelection() { - resetClassPathSelection(null); - } - - public void resetClassPathSelectionForWLPs() { - classPathWLPSelection = null; - } - - public void addListener(ClasspathModelListener listener) { - if (listeners == null) - listeners = new ArrayList(); - - listeners.add(listener); - } - - public void removeListener(ClasspathModelListener listener) { - if (listeners != null) - listeners.remove(listener); - } - - public void fireNotification(ClasspathModelEvent evt) { - if (listeners == null) - return; - - for (int i = 0; i < listeners.size(); i++) { - ClasspathModelListener listener = (ClasspathModelListener) listeners.get(i); - listener.modelChanged(evt); - } - } - - /** - * Sets the isSelected for the classpath element and sends out a notification of type - * {@link ClasspathModelEvent#CLASS_PATH_CHANGED} - */ - public void setSelection(ClasspathElement element, boolean selected) { - element.setSelected(selected); - if (!isWLPModel()) { - updateManifestClasspath(); - } else { - // at least fire the change event - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.CLASS_PATH_CHANGED)); - } - } - - /** - * Select or deselect all and notify - */ - public void setAllClasspathElementsSelected(boolean selected) { - ClassPathSelection s = getClassPathSelection(); - if (s != null) { - s.setAllSelected(selected); - updateManifestClasspath(); - } - } - - /** - * Select or deselect all and notify - */ - public void setAllClasspathElementsSelected(List elements, boolean selected) { - ClassPathSelection s = getClassPathSelection(); - if (s != null) { - s.setAllSelected(elements, selected); - updateManifestClasspath(); - } - } - - /** - * Gets the archive. - * - * @return Returns a Archive - * @deprecated - use the project - */ - public Archive getArchive() { - return null; - } - - /** - * Updates the manifest Class-Path:, and sends out a notification of type - * {@link ClasspathModelEvent#CLASS_PATH_CHANGED} - */ - public void updateManifestClasspath() { - if (classPathSelection != null && classPathSelection.isModified()) { - manifest.setClassPath(classPathSelection.toString()); - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.CLASS_PATH_CHANGED)); - } - } - - /** - * Updates the manifest Main-Class:, and sends out a notification of type - * {@link ClasspathModelEvent#MAIN_CLASS_CHANGED} - */ - public void updateMainClass(String mainClass) { - manifest.setMainClass(mainClass); - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.MAIN_CLASS_CHANGED)); - } - - /** - * Updates the manifest Main-Class:, and sends out a notification of type - * {@link ClasspathModelEvent#MAIN_CLASS_CHANGED} - */ - public void updateImplVersion(String implVersion) { - manifest.setImplemenationVersion(implVersion); - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.IMPL_VERSION_CHANGED)); - } - - public void fireSavedEvent() { - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.MODEL_SAVED)); - } - - /** - * Sets the manifest without touching the archive, or notifying - */ - public void primSetManifest(ArchiveManifest mf) { - manifest = mf; - } - - /** - * Sets the manfest on the archive, updates the classpath selection, and notifies - */ - public void setManifest(ArchiveManifest newManifest) { - try { - J2EEProjectUtilities.writeManifest(getProject(), newManifest); - } catch (IOException e) { - handleOpenFailureException(e); - } - getClassPathSelection(); // Ensure the selection is initialized. - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.MANIFEST_CHANGED)); - } - - public void selectEAR(int index) { - ArchiveManifest mf = new ArchiveManifestImpl((ArchiveManifestImpl) getArchive().getManifest()); - JavaEEArchiveUtilities.INSTANCE.closeArchive(earFile); - selectedEARComponent = availableEARComponents[index]; - initializeSelection(mf); - fireNotification(new ClasspathModelEvent(ClasspathModelEvent.EAR_PROJECT_CHANGED)); - } - - public void moveUp(List toMoveUp) { - getClassPathSelection().moveUp(toMoveUp); - updateManifestClasspath(); - } - - public void moveDown(List toMoveDown) { - getClassPathSelection().moveDown(toMoveDown); - updateManifestClasspath(); - } - - public void refresh() { - ArchiveManifest mf = null; - if (getComponent() != null) - mf = J2EEProjectUtilities.readManifest(getProject()); - refreshAvailableEARs(); - resetClassPathSelection(mf); - } - - - /** - * @see com.ibm.etools.emf.workbench.ResourceStateInputProvider#cacheNonResourceValidateState(List) - */ - public void cacheNonResourceValidateState(List roNonResourceFiles) { - } - - - /** - * @see com.ibm.etools.emf.workbench.ResourceStateInputProvider#getNonResourceFiles() - */ - public List getNonResourceFiles() { - if (nonResourceFiles == null) - initNonResourceFiles(); - return nonResourceFiles; - } - - protected void initNonResourceFiles() { - // Might be opened from a JAR - if (getComponent() == null) - return; - nonResourceFiles = new ArrayList(3); - nonResourceFiles.add(getComponent().getProject().getFile(ProjectUtilities.DOT_PROJECT)); - nonResourceFiles.add(getComponent().getProject().getFile(ProjectUtilities.DOT_CLASSPATH)); - IFile mf = J2EEProjectUtilities.getManifestFile(getComponent().getProject()); - if (mf != null) - nonResourceFiles.add(mf); - } - - - /** - * @see com.ibm.etools.emf.workbench.ResourceStateInputProvider#getNonResourceInconsistentFiles() - */ - public List getNonResourceInconsistentFiles() { - return null; - } - - /** - * @see com.ibm.etools.emf.workbench.ResourceStateInputProvider#isDirty() - */ - public boolean isDirty() { - ClassPathSelection selection = getClassPathSelection(); - if (selection == null) - return false; - return selection.isModified(); - } - - - /** - * Return a list of all the files that will get modified as a result of running this operation; - * used for validateEdit - */ - public Set getAffectedFiles() { - Set result = new HashSet(); - IFile aFile = J2EEProjectUtilities.getManifestFile(getComponent().getProject()); - if (aFile != null && aFile.exists()) - result.add(aFile); - result.addAll(ProjectUtilities.getFilesAffectedByClasspathChange(getComponent().getProject())); - return result; - } - - /** - * @see com.ibm.etools.emf.workbench.ResourceStateInputProvider#getResources() - */ - public List getResources() { - return Collections.EMPTY_LIST; - } - - public boolean selectDependencyIfNecessary(IProject referencedProject) { - getClassPathSelection(); - if (classPathSelection == null || classPathSelection.hasDirectOrIndirectDependencyTo(referencedProject)) - return false; - - ClasspathElement element = classPathSelection.getClasspathElement(referencedProject); - if (element != null) { - setSelection(element, true); - return true; - } - return false; - } - - public boolean selectDependencyIfNecessary(String jarName) { - getClassPathSelection(); - if (classPathSelection == null || classPathSelection.hasDirectOrIndirectDependencyTo(jarName)) - return false; - - ClasspathElement element = classPathSelection.getClasspathElement(jarName); - if (element != null) { - setSelection(element, true); - return true; - } - return false; - } - - public void removeDependency(String jarName) { - getClassPathSelection(); - if (classPathSelection == null) - return; - - ClasspathElement element = classPathSelection.getClasspathElement(jarName); - if (element != null && element.isValid()) - setSelection(element, false); - } - - public void removeDependency(IProject referencedProject) { - getClassPathSelection(); - if (classPathSelection == null) - return; - - ClasspathElement element = classPathSelection.getClasspathElement(referencedProject); - if (element != null && element.isValid()) - setSelection(element, false); - } - - public void selectFilterLevel(int filterLevel) { - getClassPathSelection(); - if (classPathSelection != null) - classPathSelection.selectFilterLevel(filterLevel); - updateManifestClasspath(); - } - - /** - * Gets the stateValidator. - * - * @return Returns a ResourceStateValidator - */ - public ResourceStateValidator getStateValidator() { - if (stateValidator == null) - stateValidator = createStateValidator(); - return stateValidator; - } - - /** - * Method createStateValidator. - * - * @return ResourceStateValidator - */ - private ResourceStateValidator createStateValidator() { - return new ResourceStateValidatorImpl(this); - } - - /** - * @see ResourceStateValidator#checkActivation(ResourceStateValidatorPresenter) - */ - public void checkActivation(ResourceStateValidatorPresenter presenter) throws CoreException { - getStateValidator().checkActivation(presenter); - } - - /** - * @see ResourceStateValidator#lostActivation(ResourceStateValidatorPresenter) - */ - public void lostActivation(ResourceStateValidatorPresenter presenter) throws CoreException { - getStateValidator().lostActivation(presenter); - } - - /** - * @see ResourceStateValidator#validateState(ResourceStateValidatorPresenter) - */ - public IStatus validateState(ResourceStateValidatorPresenter presenter) throws CoreException { - return getStateValidator().validateState(presenter); - } - - /** - * @see ResourceStateValidator#checkSave(ResourceStateValidatorPresenter) - */ - public boolean checkSave(ResourceStateValidatorPresenter presenter) throws CoreException { - return getStateValidator().checkSave(presenter); - } - - /** - * @see ResourceStateValidator#checkReadOnly() - */ - public boolean checkReadOnly() { - return getStateValidator().checkReadOnly(); - } - - public IVirtualComponent getComponent() { - return component; - } - - public void setComponent(IVirtualComponent component) { - this.component = component; - } - - public ClassPathSelection getClassPathSelectionForWLPs() { - if (classPathWLPSelection == null) - initializeSelectionForWLPs(); - return classPathWLPSelection; - } - - private void initializeSelectionForWLPs() { - classPathWLPSelection = new ClassPathSelection(); - try { - IClasspathContainer container = J2EEComponentClasspathUpdater.getInstance().getWebAppLibrariesContainer(component.getProject(), true); - IClasspathEntry[] containerEntries = null != container ? container.getClasspathEntries() : null; - IPath libPath = new Path("/WEB-INF/lib"); //$NON-NLS-1$ - - HashSet hs = new HashSet(); - hs.addAll(J2EEProjectUtilities.getAllJavaNonFlexProjects()); - IProject[] utilityProjects = J2EEProjectUtilities.getAllProjectsInWorkspaceOfType(J2EEProjectUtilities.UTILITY); - hs.addAll(Arrays.asList(utilityProjects)); - - IProject[] ejbProjects = J2EEProjectUtilities.getAllProjectsInWorkspaceOfType(J2EEProjectUtilities.EJB); - hs.addAll(Arrays.asList(ejbProjects)); - - Map pathToComp = new HashMap(); - - for (Iterator it = hs.iterator(); it.hasNext();) { - Object item = it.next(); - IProject utilProject = null; - IVirtualComponent comp = null; - if (item instanceof IProject) { - utilProject = (IProject) item; - comp = ComponentCore.createComponent(utilProject); - if (utilProject.getName().startsWith(".")) { //$NON-NLS-1$ - continue; - } - } else if (item instanceof IVirtualComponent) { - utilProject = ((IVirtualComponent) item).getProject(); - comp = (IVirtualComponent) item; - } - boolean existingEntry = false; - if (containerEntries != null) { - for (int j = 0; j < containerEntries.length; j++) { - IClasspathEntry eachEntry = containerEntries[j]; - if (eachEntry.getEntryKind() == IClasspathEntry.CPE_PROJECT && eachEntry.getPath().toString().equals("/" + utilProject.getName())) { //$NON-NLS-1$ - IVirtualReference ref = component.getReference(utilProject.getName()); - if (ref != null && ref.getRuntimePath().equals(libPath)) { - existingEntry = true; - } - break; - } - } - } - if( !existingEntry ){ - IJavaProject javaProject = JavaCore.create( component.getProject() ); - if( javaProject!= null ){ - IClasspathEntry[] entry = javaProject.getRawClasspath(); - for (int j = 0; j < entry.length; j++) { - IClasspathEntry eachEntry = entry[j]; - if (eachEntry.getEntryKind() == IClasspathEntry.CPE_PROJECT && - eachEntry.getPath().toString().equals("/" + utilProject.getName())) { //$NON-NLS-1$ - IVirtualReference ref = component.getReference(utilProject.getName()); - if( ref != null && ref.getRuntimePath().equals( libPath )){ - existingEntry = true; - } - break; - } - } - } - } - - if (existingEntry) { - // build of map of all unique classpath component contributions from dependent projects - classPathWLPSelection.buildClasspathComponentDependencyMap(comp, pathToComp); - } - - classPathWLPSelection.createProjectElement(utilProject, existingEntry); - classPathWLPSelection.setFilterLevel(ClassPathSelection.FILTER_NONE); - } - - // add ClasspathElements for all dependent project cp dependencies - final Iterator it = pathToComp.values().iterator(); - while (it.hasNext()) { - final IVirtualComponent c = (IVirtualComponent) it.next(); - final URI archiveURI = URI.createURI(ModuleURIUtil.getHandleString(c)); - String unresolvedURI = null; - try { - unresolvedURI = ModuleURIUtil.getArchiveName(archiveURI); - } catch (UnresolveableURIException e) { - e.printStackTrace(); - } - if (unresolvedURI != null) { - final ClasspathElement element = classPathWLPSelection.createClasspathArchiveElement(c.getProject(), archiveURI, unresolvedURI); - classPathWLPSelection.addClasspathElement(element, unresolvedURI); - } - } - - if (component != null && J2EEProjectUtilities.isDynamicWebProject( component.getProject()) && component instanceof J2EEModuleVirtualComponent) { - J2EEModuleVirtualComponent j2eeComp = (J2EEModuleVirtualComponent) component; - IVirtualReference[] newrefs = j2eeComp.getNonJavaReferences(); - for (int i = 0; i < newrefs.length; i++) { - IVirtualReference ref = newrefs[i]; - IVirtualComponent referencedComponent = ref.getReferencedComponent(); - if (referencedComponent == null) - continue; - boolean isBinary = referencedComponent.isBinary(); - if (isBinary) { - String unresolvedURI = ""; //$NON-NLS-1$ - try { - unresolvedURI = ModuleURIUtil.getArchiveName(URI.createURI(ModuleURIUtil.getHandleString(referencedComponent))); - } catch (UnresolveableURIException e) { - e.printStackTrace(); - } - - URI archiveURI = URI.createURI(unresolvedURI); - - boolean alreadyInList = false; - Iterator iter = classPathWLPSelection.getClasspathElements().iterator(); - while (iter.hasNext()) { - ClasspathElement tmpelement = (ClasspathElement) iter.next(); - if (tmpelement.getText().equals(archiveURI.lastSegment())) { - alreadyInList = true; - break; - } - } - ClasspathElement element = null; - if (!alreadyInList) { - boolean inContainer = false; - if (containerEntries != null) { - String lastSegment = archiveURI.lastSegment(); - for (int j = 0; !inContainer && j < containerEntries.length; j++) { - if (containerEntries[j].getPath().lastSegment().equals(lastSegment)) { - inContainer = true; - } - } - } - - if( !inContainer ){ - IJavaProject javaProject = JavaCore.create( component.getProject() ); - if( javaProject != null ){ - VirtualArchiveComponent vComp = (VirtualArchiveComponent) referencedComponent; - java.io.File diskFile = vComp.getUnderlyingDiskFile(); - IPath path = null; - if ( diskFile.exists() ) { - path = new Path( diskFile.getAbsolutePath() ); - } else { - IFile iFile = vComp.getUnderlyingWorkbenchFile(); - path = iFile.getFullPath(); - } - inContainer= inClassPath(javaProject, path ); - } - } - if (inContainer) { - element = classPathWLPSelection.createArchiveElement(URI.createURI(ModuleURIUtil.getHandleString(referencedComponent)), referencedComponent.getName(), archiveURI.lastSegment()); - classPathWLPSelection.addClasspathElement(element, unresolvedURI); - } else { - element = classPathWLPSelection.createArchiveElement(URI.createURI(ModuleURIUtil.getHandleString(referencedComponent)), archiveURI.lastSegment(), null); - classPathWLPSelection.addClasspathElement(element, unresolvedURI); - } - } - } - } // for - - // Add elements for raw classpath entries (either already tagged or potentially taggable) - try { - classPathWLPSelection.createClasspathEntryElements(component, libPath); - } catch (CoreException ce) { - Logger.getLogger(J2EEPlugin.PLUGIN_ID).logError(ce); - } - } - } catch (CoreException e) { - } catch (Exception e) { - Logger.getLogger().logError(e); - } - } - - public boolean isWLPModel() { - return isWLPModel; - } - - public void setWLPModel(boolean isWLPModel) { - this.isWLPModel = isWLPModel; - } - - private boolean inClassPath(IJavaProject javaProject, IPath path ){ - boolean existingEntry = false; - IClasspathEntry[] entry = null; - try { - entry = javaProject.getRawClasspath(); - } catch (JavaModelException e) { - Logger.getLogger().logError(e); - } - for (int j = 0; j < entry.length; j++) { - IClasspathEntry eachEntry = entry[j]; - if (eachEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY || eachEntry.getEntryKind() == IClasspathEntry.CPE_VARIABLE ) { - IClasspathEntry classPathEntry = JavaCore.getResolvedClasspathEntry( eachEntry ); - if( classPathEntry != null && classPathEntry.getPath().equals(path) ){ - existingEntry = true; - break; - } - } - } - return existingEntry; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModelEvent.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModelEvent.java deleted file mode 100644 index 388409f28..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModelEvent.java +++ /dev/null @@ -1,42 +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.internal.common; - - -public class ClasspathModelEvent extends Object { - protected int eventType; - public static final int CLASS_PATH_CHANGED = 1; - public static final int EAR_PROJECT_CHANGED = 2; - public static final int MANIFEST_CHANGED = 3; - public static final int CLASS_PATH_RESET = 4; - public static final int MAIN_CLASS_CHANGED = 5; - public static final int MODEL_SAVED = 6; - public static final int IMPL_VERSION_CHANGED = 7; - - /** - * Constructor for ClasspathModelEvent. - */ - public ClasspathModelEvent(int eventType) { - super(); - this.eventType = eventType; - } - - /** - * Gets the eventType. - * - * @return Returns a int - */ - public int getEventType() { - return eventType; - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModelListener.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModelListener.java deleted file mode 100644 index c3333f392..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/ClasspathModelListener.java +++ /dev/null @@ -1,14 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.internal.common; - - -public interface ClasspathModelListener { - void modelChanged(ClasspathModelEvent evt); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/CreationConstants.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/CreationConstants.java deleted file mode 100644 index a375bff8f..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/CreationConstants.java +++ /dev/null @@ -1,42 +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.j2ee.internal.common; - -import org.eclipse.jst.common.frameworks.CommonFrameworksPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPreferences; - -public interface CreationConstants { - - /** - * @deprecated, use the preferences directly - * @since 2.0 - */ - String DEFAULT_WEB_SOURCE_FOLDER = CommonFrameworksPlugin.getDefault().getPluginPreferences().getString(CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER); - /** - * @deprecated, use the preferences directly - * @since 2.0 - */ - String DEFAULT_EJB_SOURCE_FOLDER = J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.EJB_CONTENT_FOLDER); - - /** - * @deprecated, use the preferences directly - * @since 2.0 - */ - String DEFAULT_CONNECTOR_SOURCE_FOLDER = J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.JCA_CONTENT_FOLDER); - /** - * @deprecated, use the preferences directly - * @since 2.0 - */ - String DEFAULT_APPCLIENT_SOURCE_FOLDER = J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.APP_CLIENT_CONTENT_FOLDER); - String EJB_CLIENT_NAME ="ClientProject";//$NON-NLS-1$ - String CLIENT_JAR_URI="ClientJARURI";//$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/FacetedProjectPropertyTester.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/FacetedProjectPropertyTester.java deleted file mode 100644 index 69867cd41..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/FacetedProjectPropertyTester.java +++ /dev/null @@ -1,70 +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.j2ee.internal.common; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework; -import org.eclipse.wst.common.project.facet.core.internal.FacetCorePlugin; - -public final class FacetedProjectPropertyTester extends PropertyTester - -{ -public boolean test( final Object receiver, - final String property, - final Object[] args, - final Object value ) -{ - try - { - if( ! ( receiver instanceof ICompilationUnit ) ) - { - return false; - } - - final IProject pj = ( (ICompilationUnit ) receiver ).getJavaProject().getProject(); - - if( pj == null ) - { - return false; - } - - final String val = (String) value; - final int colon = val.indexOf( ':' ); - - final String fid; - final String vexpr; - - if( colon == -1 || colon == val.length() - 1 ) - { - fid = val; - vexpr = null; - } - else - { - fid = val.substring( 0, colon ); - vexpr = val.substring( colon + 1 ); - } - - return FacetedProjectFramework.hasProjectFacet( pj, fid, vexpr ); - } - catch( CoreException e ) - { - FacetCorePlugin.log( e.getStatus() ); - } - - return false; -} - -} - diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/J2EECommonMessages.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/J2EECommonMessages.java deleted file mode 100644 index c3fc35d22..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/J2EECommonMessages.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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 - *******************************************************************************/ -/* - * Created on Dec 3, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.common; - -import org.eclipse.osgi.util.NLS; - - -/** - * @author DABERG - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public class J2EECommonMessages extends NLS { - private static final String BUNDLE_NAME = "j2ee_common";//$NON-NLS-1$ - - private J2EECommonMessages() { - // Do not instantiate - } - - public static String ERR_SECURITY_ROLE_EMPTY; - public static String ERR_SECURITY_ROLE_EXIST; - public static String ERR_JAVA_CLASS_NAME_EMPTY; - public static String ERR_JAVA_CLASS_NAME_EXIST; - public static String ERR_JAVA_CLASS_FILE_NAME_EXIST; - public static String ERR_JAVA_CLASS_FOLDER_NAME_EMPTY; - public static String ERR_JAVA_CLASS_FOLDER_PROJECT_NOT_OPEN; - public static String ERR_JAVA_CLASS_NOT_JAVA_PROJECT; - public static String ERR_JAVA_CLASS_FOLDER_STATIC_PROJECT; - public static String ERR_JAVA_CLASS_FOLDER_NOT_SOURCE; - public static String ERR_JAVA_CLASS_NAME_QUALIFIED; - public static String ERR_JAVA_CLASS_NAME_INVALID; - public static String ERR_JAVA_CLASS_NAME_WARNING; - public static String ERR_JAVA_CLASS_SUPERCLASS_NOT_EXIST; - public static String ERR_JAVA_CLASS_SUPERCLASS_FINAL; - public static String ERR_JAVA_PACAKGE_NAME_INVALID; - public static String ERR_JAVA_PACKAGE_NAME_WARNING; - public static String ERR_BOTH_FINAL_AND_ABSTRACT; - public static String WebServiceClientGenerator_UI_0; - public static String ERR_SECURITY_ROLE_LIST_EMPTY; - - public static String ERR_JAVA_CLASS_FOLDER_NOT_EXIST; - - public static String ERR_EMPTY_MODULE_NAME; - public static String ERR_EMPTY_PROJECT_NAME; - public static String ERR_PROJECT_INACCESSIBLE; - public static String ERR_PROJECT_NAME_EXISTS; - public static String ERR_VERSION_NOT_SUPPORTED; - public static String ERR_NOT_SUPPORTED; - public static String ERR_JAVA_CLASS_FOLDER_NOT_ABSOLUTE; - public static String ERR_NO_MODEL_PROVIDER_FOR_PROJECT; - public static String ERR_NO_MODEL_PROVIDER_FOR_VIRTUAL_COMPONENT; - - public static String J2EE_MODULE_CLASSPATH_CONTAINER_NAME; - - public static String CLASSPATH_ENTRY_DEPENDENCY_PREFIX; - - static { - NLS.initializeMessages(BUNDLE_NAME, J2EECommonMessages.class); - } - - public static String getResourceString(String key, Object[] args) { - return NLS.bind(key, args); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/J2EEVersionUtil.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/J2EEVersionUtil.java deleted file mode 100644 index 36dde4c9b..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/J2EEVersionUtil.java +++ /dev/null @@ -1,303 +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 - *******************************************************************************/ -/* - * Created on Mar 21, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.common; - -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -/** - * @author nagrawal - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class J2EEVersionUtil { - - public static String getServletTextVersion(int aVersion) { - switch (aVersion) { - case J2EEVersionConstants.SERVLET_2_2: - return J2EEVersionConstants.VERSION_2_2_TEXT; - - case J2EEVersionConstants.SERVLET_2_3: - return J2EEVersionConstants.VERSION_2_3_TEXT; - - case J2EEVersionConstants.SERVLET_2_4: - return J2EEVersionConstants.VERSION_2_4_TEXT; - - case J2EEVersionConstants.SERVLET_2_5: - return J2EEVersionConstants.VERSION_2_5_TEXT; - } - return ""; //$NON-NLS-1$ - - } - - public static String getEJBTextVersion(int aVersion) { - - switch (aVersion) { - case J2EEVersionConstants.EJB_1_0_ID: - return J2EEVersionConstants.VERSION_1_0_TEXT; - - case J2EEVersionConstants.EJB_1_1_ID: - return J2EEVersionConstants.VERSION_1_1_TEXT; - - case J2EEVersionConstants.EJB_2_0_ID: - return J2EEVersionConstants.VERSION_2_0_TEXT; - - case J2EEVersionConstants.EJB_2_1_ID: - return J2EEVersionConstants.VERSION_2_1_TEXT; - - case J2EEVersionConstants.EJB_3_0_ID: - return J2EEVersionConstants.VERSION_3_0_TEXT; - } - return ""; //$NON-NLS-1$ - } - - public static String getJCATextVersion(int aVersion) { - switch (aVersion) { - case J2EEVersionConstants.JCA_1_0_ID: - return J2EEVersionConstants.VERSION_1_0_TEXT; - - case J2EEVersionConstants.JCA_1_5_ID: - return J2EEVersionConstants.VERSION_1_5_TEXT; - - } - return ""; //$NON-NLS-1$ - } - - public static String getJ2EETextVersion(int aVersion) { - switch (aVersion) { - case J2EEVersionConstants.J2EE_1_2_ID: - return J2EEVersionConstants.VERSION_1_2_TEXT; - - case J2EEVersionConstants.J2EE_1_3_ID: - return J2EEVersionConstants.VERSION_1_3_TEXT; - - case J2EEVersionConstants.J2EE_1_4_ID: - return J2EEVersionConstants.VERSION_1_4_TEXT; - - case J2EEVersionConstants.JEE_5_0_ID: - return J2EEVersionConstants.VERSION_5_0_TEXT; - - } - return "";//$NON-NLS-1$ - } - - public static int convertAppClientVersionStringToJ2EEVersionID(String version) { - if (version.equals(J2EEVersionConstants.VERSION_1_2_TEXT)) - return J2EEVersionConstants.J2EE_1_2_ID; - if (version.equals(J2EEVersionConstants.VERSION_1_3_TEXT)) - return J2EEVersionConstants.J2EE_1_3_ID; - if (version.equals(J2EEVersionConstants.VERSION_1_4_TEXT)) - return J2EEVersionConstants.J2EE_1_4_ID; - if (version.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) - return J2EEVersionConstants.JEE_5_0_ID; - // default - return J2EEVersionConstants.JEE_5_0_ID; - } - - public static int convertEJBVersionStringToJ2EEVersionID(String version) { - if (version.equals(J2EEVersionConstants.VERSION_1_1_TEXT)) - return J2EEVersionConstants.J2EE_1_2_ID; - if (version.equals(J2EEVersionConstants.VERSION_2_0_TEXT)) - return J2EEVersionConstants.J2EE_1_3_ID; - if (version.equals(J2EEVersionConstants.VERSION_2_1_TEXT)) - return J2EEVersionConstants.J2EE_1_4_ID; - if (version.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) - return J2EEVersionConstants.JEE_5_0_ID; - // default - return J2EEVersionConstants.JEE_5_0_ID; - } - - public static int convertWebVersionStringToJ2EEVersionID(String version) { - if (version.equals(J2EEVersionConstants.VERSION_2_2_TEXT)) - return J2EEVersionConstants.J2EE_1_2_ID; - if (version.equals(J2EEVersionConstants.VERSION_2_3_TEXT)) - return J2EEVersionConstants.J2EE_1_3_ID; - if (version.equals(J2EEVersionConstants.VERSION_2_4_TEXT)) - return J2EEVersionConstants.J2EE_1_4_ID; - if (version.equals(J2EEVersionConstants.VERSION_2_5_TEXT)) - return J2EEVersionConstants.JEE_5_0_ID; - // default - return J2EEVersionConstants.J2EE_1_4_ID; - } - - public static int convertConnectorVersionStringToJ2EEVersionID(String version) { - if (version.equals(J2EEVersionConstants.VERSION_1_0_TEXT)) - return J2EEVersionConstants.J2EE_1_3_ID; - if (version.equals(J2EEVersionConstants.VERSION_1_5_TEXT)) - return J2EEVersionConstants.J2EE_1_4_ID; - // default - return J2EEVersionConstants.J2EE_1_4_ID; - } - - public static int convertJ2EEVersionIDToEJBVersionID(int j2eeVersionId) { - switch (j2eeVersionId) { - case J2EEVersionConstants.J2EE_1_2_ID: - return J2EEVersionConstants.EJB_1_1_ID; - case J2EEVersionConstants.J2EE_1_3_ID: - return J2EEVersionConstants.EJB_2_0_ID; - case J2EEVersionConstants.J2EE_1_4_ID: - return J2EEVersionConstants.EJB_2_1_ID; - case J2EEVersionConstants.JEE_5_0_ID: - return J2EEVersionConstants.EJB_3_0_ID; - } - // default - return J2EEVersionConstants.EJB_3_0_ID; - } - - public static int convertJ2EEVersionIDToWebVersionID(int j2eeVersionId) { - switch (j2eeVersionId) { - case J2EEVersionConstants.J2EE_1_2_ID: - return J2EEVersionConstants.WEB_2_2_ID; - case J2EEVersionConstants.J2EE_1_3_ID: - return J2EEVersionConstants.WEB_2_3_ID; - case J2EEVersionConstants.J2EE_1_4_ID: - return J2EEVersionConstants.WEB_2_4_ID; - case J2EEVersionConstants.JEE_5_0_ID: - return J2EEVersionConstants.WEB_2_5_ID; - } - // default - return J2EEVersionConstants.WEB_2_5_ID; - } - - public static int convertJ2EEVersionIDToConnectorVersionID(int j2eeVersionId) { - switch (j2eeVersionId) { - case J2EEVersionConstants.J2EE_1_3_ID: - return J2EEVersionConstants.JCA_1_0_ID; - case J2EEVersionConstants.J2EE_1_4_ID: - return J2EEVersionConstants.JCA_1_5_ID; - } - // default - return J2EEVersionConstants.JCA_1_5_ID; - } - - public static int convertVersionStringToInt(IVirtualComponent comp) { - String version = J2EEProjectUtilities.getJ2EEProjectVersion(comp.getProject()); - if (J2EEProjectUtilities.isDynamicWebProject(comp.getProject())) - return convertWebVersionStringToJ2EEVersionID(version); - if (J2EEProjectUtilities.isEJBProject(comp.getProject())) - return convertEJBVersionStringToJ2EEVersionID(version); - if (J2EEProjectUtilities.isEARProject(comp.getProject())) - return convertVersionStringToInt(version); - if (J2EEProjectUtilities.isJCAProject(comp.getProject())) - return convertConnectorVersionStringToJ2EEVersionID(version); - if (J2EEProjectUtilities.isApplicationClientProject(comp.getProject())) - return convertAppClientVersionStringToJ2EEVersionID(version); - return 0; - } - - public static int convertVersionStringToInt(String version) { - int nVersion = 0; - - if( version.endsWith("")){ //$NON-NLS-1$ - nVersion = 0; - } - - if (version.equals(J2EEVersionConstants.VERSION_1_0_TEXT)) - nVersion = J2EEVersionConstants.VERSION_1_0; - - else if (version.equals(J2EEVersionConstants.VERSION_1_1_TEXT)) - nVersion = J2EEVersionConstants.VERSION_1_1; - - else if (version.equals(J2EEVersionConstants.VERSION_1_2_TEXT)) - nVersion = J2EEVersionConstants.VERSION_1_2; - - else if (version.equals(J2EEVersionConstants.VERSION_1_3_TEXT)) - nVersion = J2EEVersionConstants.VERSION_1_3; - - else if (version.equals(J2EEVersionConstants.VERSION_1_4_TEXT)) - nVersion = J2EEVersionConstants.VERSION_1_4; - - else if (version.equals(J2EEVersionConstants.VERSION_1_5_TEXT)) - nVersion = J2EEVersionConstants.VERSION_1_5; - - else if (version.equals(J2EEVersionConstants.VERSION_2_0_TEXT)) - nVersion = J2EEVersionConstants.VERSION_2_0; - - else if (version.equals(J2EEVersionConstants.VERSION_2_1_TEXT)) - nVersion = J2EEVersionConstants.VERSION_2_1; - - else if (version.equals(J2EEVersionConstants.VERSION_2_2_TEXT)) - nVersion = J2EEVersionConstants.VERSION_2_2; - - else if (version.equals(J2EEVersionConstants.VERSION_2_3_TEXT)) - nVersion = J2EEVersionConstants.VERSION_2_3; - - else if (version.equals(J2EEVersionConstants.VERSION_2_4_TEXT)) - nVersion = J2EEVersionConstants.VERSION_2_4; - - else if (version.equals(J2EEVersionConstants.VERSION_2_5_TEXT)) - nVersion = J2EEVersionConstants.VERSION_2_5; - - else if (version.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) - nVersion = J2EEVersionConstants.VERSION_5_0; - - else if (version.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) - nVersion = J2EEVersionConstants.VERSION_3_0; - - return nVersion; - } - public static String convertVersionIntToString(int version) { - String nVersion = null; - - if (version == J2EEVersionConstants.VERSION_1_0) - nVersion = J2EEVersionConstants.VERSION_1_0_TEXT; - - else if (version == J2EEVersionConstants.VERSION_1_1) - nVersion = J2EEVersionConstants.VERSION_1_1_TEXT; - - else if (version == J2EEVersionConstants.VERSION_1_2) - nVersion = J2EEVersionConstants.VERSION_1_2_TEXT; - - else if (version == J2EEVersionConstants.VERSION_1_3) - nVersion = J2EEVersionConstants.VERSION_1_3_TEXT; - - else if (version == J2EEVersionConstants.VERSION_1_4) - nVersion = J2EEVersionConstants.VERSION_1_4_TEXT; - - else if (version == J2EEVersionConstants.VERSION_1_5) - nVersion = J2EEVersionConstants.VERSION_1_5_TEXT; - - else if (version == J2EEVersionConstants.VERSION_2_0) - nVersion = J2EEVersionConstants.VERSION_2_0_TEXT; - - else if (version == J2EEVersionConstants.VERSION_2_1) - nVersion = J2EEVersionConstants.VERSION_2_1_TEXT; - - else if (version == J2EEVersionConstants.VERSION_2_2) - nVersion = J2EEVersionConstants.VERSION_2_2_TEXT; - - else if (version == J2EEVersionConstants.VERSION_2_3) - nVersion = J2EEVersionConstants.VERSION_2_3_TEXT; - - else if (version == J2EEVersionConstants.VERSION_2_4) - nVersion = J2EEVersionConstants.VERSION_2_4_TEXT; - - else if (version == J2EEVersionConstants.VERSION_2_5) - nVersion = J2EEVersionConstants.VERSION_2_5_TEXT; - - else if (version == J2EEVersionConstants.VERSION_3_0) - nVersion = J2EEVersionConstants.VERSION_3_0_TEXT; - - else if (version == J2EEVersionConstants.VERSION_5_0) - nVersion = J2EEVersionConstants.VERSION_5_0_TEXT; - - return nVersion; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/UpdateProjectClasspath.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/UpdateProjectClasspath.java deleted file mode 100644 index 8751cb771..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/UpdateProjectClasspath.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.common; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -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.jdt.core.JavaModelException; -import org.eclipse.jdt.internal.core.ClasspathEntry; -import org.eclipse.jem.util.logger.proxy.Logger; - - -/** - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class UpdateProjectClasspath { - - - public UpdateProjectClasspath(String sourceFolder, String componentName, IProject jProject){ - addSrcFolderToProject(sourceFolder, componentName, jProject); - } - - private IClasspathEntry[] getClasspathEntries(String sourceFolder, String componentName, - IProject jProject) { - - ArrayList list = new ArrayList(); - list.add(JavaCore.newSourceEntry(jProject.getFullPath().append(sourceFolder))); - - IClasspathEntry[] classpath = new IClasspathEntry[list.size()]; - - - IPath newOutputPath = null; - for (int i = 0; i < classpath.length; i++) { - classpath[i] = (IClasspathEntry) list.get(i); - newOutputPath = Path.fromOSString(Path.SEPARATOR +jProject.getName() + "/bin/"); - ((ClasspathEntry)classpath[i]).specificOutputLocation = newOutputPath; - } - return classpath; - } - - private void addSrcFolderToProject(String sourceFolder,String componentName, - IProject jProject) { - - IJavaProject javaProject = JavaCore.create( jProject ); - try { - - IClasspathEntry[] oldEntries = javaProject.getRawClasspath(); - List oldEntriesList,classpathList; - IClasspathEntry[] newEntries = getClasspathEntries(sourceFolder, componentName, - jProject); - /** - * Warning clean-up 12/05/2005 - */ - //int oldSize = oldEntries.length; - //int newSize = newEntries.length; - - classpathList = new ArrayList(); - oldEntriesList = Arrays.asList(oldEntries); - classpathList.addAll(oldEntriesList); - for( int j=0; j< newEntries.length; j++){ - if(!oldEntriesList.contains(newEntries[j])) { - classpathList.add(newEntries[j]); - } - } - IClasspathEntry[] classpathEntries = (IClasspathEntry[]) classpathList.toArray(new IClasspathEntry[classpathList.size()]); - javaProject.setRawClasspath(classpathEntries, null); - } - catch (JavaModelException e) { - Logger.getLogger().logError(e); - } - } - - private static IClasspathEntry[] getProjectDependency(IProject clientProj){ - IClasspathEntry projectEntry = JavaCore.newProjectEntry(clientProj.getFullPath(), true); - return new IClasspathEntry[]{projectEntry}; - } - - private static boolean entryToChange(final IClasspathEntry entry, final IClasspathEntry[] entriesToChange) { - for (int i = 0; i < entriesToChange.length; i++) { - if (entriesToChange[i].equals(entry)) { - return true; - } - } - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/VirtualArchiveComponentAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/VirtualArchiveComponentAdapterFactory.java deleted file mode 100644 index a7b6a331e..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/VirtualArchiveComponentAdapterFactory.java +++ /dev/null @@ -1,34 +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.internal.common; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; - -public class VirtualArchiveComponentAdapterFactory implements IAdapterFactory { - - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (adapterType == VirtualArchiveComponent.ADAPTER_TYPE ) { - VirtualArchiveComponent component = (VirtualArchiveComponent) adaptableObject; - IPath path = J2EEProjectUtilities.getResolvedPathForArchiveComponent(component.getName()); - return path; - } - return null; - } - - - public Class[] getAdapterList() { - return new Class[]{VirtualArchiveComponent.class}; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java deleted file mode 100644 index 49e5a1ea8..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java +++ /dev/null @@ -1,360 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.common.classpath; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IAccessRule; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.internal.core.ClasspathEntry; -import org.eclipse.jdt.internal.core.JavaProject; -import org.eclipse.jdt.internal.core.util.Util; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.jdt.internal.classpath.ClasspathDecorations; -import org.eclipse.jst.common.jdt.internal.classpath.ClasspathDecorationsManager; -import org.eclipse.jst.j2ee.internal.common.J2EECommonMessages; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - -/** - * This classpath container is based on the Component references; not the manifest entries. Other - * mechanisms are in place to ensure that the component references are updated when the manifest is - * updated, and also to make sure the manifest is updated when the component references are updated. - * - */ -public class J2EEComponentClasspathContainer implements IClasspathContainer { - - public static final String CONTAINER_ID = "org.eclipse.jst.j2ee.internal.module.container"; //$NON-NLS-1$ - public static final IPath CONTAINER_PATH = new Path(CONTAINER_ID); - - private static IPath WEBLIB = new Path("/WEB-INF/lib"); //$NON-NLS-1$ - - private static ClasspathDecorationsManager decorationsManager = new ClasspathDecorationsManager(J2EEPlugin.PLUGIN_ID); - - public static ClasspathDecorationsManager getDecorationsManager() { - return decorationsManager; - } - - private IPath containerPath; - private IJavaProject javaProject; - private IClasspathEntry[] entries = new IClasspathEntry[0]; - private static Map keys = new Hashtable(); - private static Map previousSelves = new Hashtable(); - - private class LastUpdate { - private long dotClasspathModificationStamp = -1; - private int refCount = 0; - private boolean[] isBinary = new boolean[refCount]; - private IPath[] paths = new IPath[refCount]; - } - - private LastUpdate lastUpdate = new LastUpdate(); - - public J2EEComponentClasspathContainer(IPath path, IJavaProject javaProject) { - this.containerPath = path; - this.javaProject = javaProject; - } - - private boolean requiresUpdate() { - IVirtualComponent component = ComponentCore.createComponent(javaProject.getProject()); - if (component == null) { - return false; - } - - IFile dotClasspath = javaProject.getProject().getFile(ProjectUtilities.DOT_CLASSPATH); - long dotClasspathModificationStamp = dotClasspath.exists() ? dotClasspath.getModificationStamp() : 0; - if(dotClasspathModificationStamp != lastUpdate.dotClasspathModificationStamp){ - return true; - } - - IVirtualReference[] refs = component.getReferences(); - IVirtualComponent comp = null; - - // avoid updating the container if references haven't changed - if (refs.length == lastUpdate.refCount) { - for (int i = 0; i < lastUpdate.refCount; i++) { - comp = refs[i].getReferencedComponent(); - if (comp.isBinary() != lastUpdate.isBinary[i]) { - return true; - } else { - IPath path = null; - if (comp.isBinary()) { - VirtualArchiveComponent archiveComp = (VirtualArchiveComponent) comp; - java.io.File diskFile = archiveComp.getUnderlyingDiskFile(); - if (diskFile.exists()) - path = new Path(diskFile.getAbsolutePath()); - else { - IFile iFile = archiveComp.getUnderlyingWorkbenchFile(); - path = iFile.getFullPath(); - } - } else { - path = comp.getProject().getFullPath(); - } - if (!path.equals(lastUpdate.paths[i])) { - return true; - } - } - } - return false; - } - return true; - } - - private void update() { - if(!javaProject.isOpen()){ - try { - if(javaProject.getProject().exists() && javaProject.getProject().hasNature(JavaCore.NATURE_ID)){ - javaProject.open(null); - } else { - return; - } - } catch (JavaModelException e) { - Logger.getLogger().logError(e); - } catch (CoreException e) { - //ignore - return; - } - } - - IVirtualComponent component = ComponentCore.createComponent(javaProject.getProject()); - Object key = keys.get(new Integer(javaProject.getProject().hashCode())); - J2EEComponentClasspathContainer firstPreviousSelf = (J2EEComponentClasspathContainer)previousSelves.get(key); - if (component == null) { - return; - } - - IFile dotClasspath = javaProject.getProject().getFile(ProjectUtilities.DOT_CLASSPATH); - lastUpdate.dotClasspathModificationStamp = dotClasspath.exists() ? dotClasspath.getModificationStamp() : 0; - - IVirtualComponent comp = null; - IVirtualReference ref = null; - - IVirtualReference[] refs = component.getReferences(); - List refsList = new ArrayList(); - Set refedComps = new HashSet(); - refedComps.add(component); - for(int i = 0; i<refs.length;i++){ - refsList.add(refs[i]); - refedComps.add(refs[i].getReferencedComponent()); - } - for(int i=0; i< refsList.size(); i++){ - comp = ((IVirtualReference)refsList.get(i)).getReferencedComponent(); - if(comp.isBinary()){ - IVirtualReference [] binaryRefs = comp.getReferences(); - for(int j = 0; j<binaryRefs.length; j++){ - if(!refedComps.contains(binaryRefs[j].getReferencedComponent())){ - refsList.add(binaryRefs[j]); - refedComps.add(binaryRefs[j].getReferencedComponent()); - } - } - } - } - - lastUpdate.refCount = refsList.size(); - lastUpdate.isBinary = new boolean[lastUpdate.refCount]; - lastUpdate.paths = new IPath[lastUpdate.refCount]; - - boolean isWeb = J2EEProjectUtilities.isDynamicWebProject(component.getProject()); - boolean shouldAdd = true; - - List entriesList = new ArrayList(); - - try { - IJavaProject javaProject = JavaCore.create(component.getProject()); - Set existingEntries = new HashSet(); - try { - IClasspathContainer container = JavaCore.getClasspathContainer(CONTAINER_PATH, javaProject); - List previousEntries = null; - if(null != container){ - final IClasspathEntry[] containerEntries = container.getClasspathEntries(); - previousEntries = Arrays.asList(containerEntries); - } - existingEntries.addAll(Arrays.asList(javaProject.getResolvedClasspath(true))); - if(null != previousEntries){ - existingEntries.removeAll(previousEntries); - } - if(firstPreviousSelf != null){ - existingEntries.removeAll(Arrays.asList(firstPreviousSelf.entries)); - } - J2EEComponentClasspathContainer secondPreviousSelf = (J2EEComponentClasspathContainer)previousSelves.get(key); - if(firstPreviousSelf != secondPreviousSelf && secondPreviousSelf != null){ - existingEntries.removeAll(Arrays.asList(secondPreviousSelf.entries)); - } - - existingEntries.removeAll(Arrays.asList(entries)); - - } catch (JavaModelException e) { - Logger.getLogger().logError(e); - } - for (int i = 0; i < refsList.size(); i++) { - ref = (IVirtualReference)refsList.get(i); - comp = ref.getReferencedComponent(); - lastUpdate.isBinary[i] = comp.isBinary(); - shouldAdd = !(isWeb && ref.getRuntimePath().equals(WEBLIB)); - if (!shouldAdd) { - continue; - } - if (comp.isBinary()) { - VirtualArchiveComponent archiveComp = (VirtualArchiveComponent) comp; - java.io.File diskFile = archiveComp.getUnderlyingDiskFile(); - if (diskFile.exists()) { - lastUpdate.paths[i] = new Path(diskFile.getAbsolutePath()); - } else { - IFile iFile = archiveComp.getUnderlyingWorkbenchFile(); - lastUpdate.paths[i] = iFile.getFullPath(); - } - if (!isAlreadyOnClasspath(existingEntries, lastUpdate.paths[i])) { - ClasspathDecorations dec = decorationsManager.getDecorations( getPath().toString(), lastUpdate.paths[i].toString() ); - - IPath srcpath = null; - IPath srcrootpath = null; - IClasspathAttribute[] attrs = {}; - IAccessRule[] access = {}; - - if( dec != null ) { - srcpath = dec.getSourceAttachmentPath(); - srcrootpath = dec.getSourceAttachmentRootPath(); - attrs = dec.getExtraAttributes(); - } - - entriesList.add(JavaCore.newLibraryEntry( lastUpdate.paths[i], srcpath, srcrootpath, access, attrs, true )); - } - } else { - IProject project = comp.getProject(); - lastUpdate.paths[i] = project.getFullPath(); - if (!isAlreadyOnClasspath(existingEntries, lastUpdate.paths[i])) { - entriesList.add(JavaCore.newProjectEntry(lastUpdate.paths[i], true)); - } - } - } - } finally { - entries = new IClasspathEntry[entriesList.size()]; - for (int i = 0; i < entries.length; i++) { - entries[i] = (IClasspathEntry) entriesList.get(i); - } - } - previousSelves.put(key, this); - } - - public static void install(IPath containerPath, IJavaProject javaProject) { - try{ - J2EEComponentClasspathUpdater.getInstance().pauseUpdates(); - Integer hashCode = new Integer(javaProject.getProject().hashCode()); - Object key = keys.get(hashCode); - if(key == null){ - keys.put(hashCode, hashCode); - key = hashCode; - } - final IJavaProject[] projects = new IJavaProject[]{javaProject}; - final J2EEComponentClasspathContainer container = new J2EEComponentClasspathContainer(containerPath, javaProject); - container.update(); - final IClasspathContainer[] conts = new IClasspathContainer[]{container}; - try { - JavaCore.setClasspathContainer(containerPath, projects, conts, null); - previousSelves.put(key, container); - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - } finally { - J2EEComponentClasspathUpdater.getInstance().resumeUpdates(); - } - } - - public void refresh(boolean force){ - if(force || requiresUpdate()){ - install(containerPath, javaProject); - if (J2EEComponentClasspathUpdater.shouldUpdateDependencyGraph()) - { - // Update dependency graph - DependencyGraphManager.getInstance().forceRefresh(); - // [202820] - J2EEComponentClasspathUpdater.setUpdateDependencyGraph(false); - } - } - } - - public void refresh() { - refresh(false); - } - - private boolean isUpdating = false; - - public IClasspathEntry[] getClasspathEntries() { - if(!isUpdating){ - if(this != J2EEComponentClasspathContainerUtils.getInstalledEARLibrariesContainer(javaProject.getProject())){ - try { - isUpdating = true; - update(); - } finally{ - isUpdating = false; - } - } - } - return entries; - } - - public String getDescription() { - return J2EECommonMessages.J2EE_MODULE_CLASSPATH_CONTAINER_NAME; - } - - public int getKind() { - return K_APPLICATION; - } - - public IPath getPath() { - return containerPath; - } - - /** - * Taken from {@link JavaProject#isOnClasspath(org.eclipse.core.resources.IResource)} - * - * @param classpath - * @param newPath - * @return - */ - private static boolean isAlreadyOnClasspath(Set classpath, IPath newPath) { - for (Iterator itr = classpath.iterator(); itr.hasNext();) { - IClasspathEntry entry = (IClasspathEntry) itr.next(); - IPath entryPath = entry.getPath(); - if (entryPath.equals(newPath)) { // package fragment roots must match exactly entry - // pathes (no exclusion there) - return true; - } - if (entryPath.isPrefixOf(newPath) && !Util.isExcluded(newPath, ((ClasspathEntry) entry).fullInclusionPatternChars(), ((ClasspathEntry) entry).fullExclusionPatternChars(), false)) { - return true; - } - } - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainerUtils.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainerUtils.java deleted file mode 100644 index b71410942..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainerUtils.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.eclipse.jst.j2ee.internal.common.classpath; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.common.jdt.internal.classpath.FlexibleProjectContainer; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - -public class J2EEComponentClasspathContainerUtils { - - public static boolean getDefaultUseEARLibraries() { - return J2EEPlugin.getDefault().getJ2EEPreferences().getUseEARLibraries(); - } - - public static boolean getDefaultUseWebAppLibraries() { - return J2EEPlugin.getDefault().getJ2EEPreferences().getUseWebLibaries(); - } - - public static IClasspathContainer getInstalledContainer(IProject project, IPath containerPath) { - IJavaProject jproj = JavaCore.create(project); - IClasspathEntry entry = getInstalledContainerEntry(jproj, containerPath); - IClasspathContainer container = null; - if (entry != null) { - try { - container = JavaCore.getClasspathContainer(containerPath, jproj); - } catch (JavaModelException e) { - J2EEPlugin.getDefault().getLogger().logError(e); - } - } - return container; - } - - public static J2EEComponentClasspathContainer getInstalledEARLibrariesContainer(IProject project) { - IClasspathContainer container = getInstalledContainer(project, J2EEComponentClasspathContainer.CONTAINER_PATH); - J2EEComponentClasspathContainer earLibrariesContainer = null; - if (null != container && container instanceof J2EEComponentClasspathContainer) { - earLibrariesContainer = (J2EEComponentClasspathContainer) container; - } - return earLibrariesContainer; - } - - public static FlexibleProjectContainer getInstalledWebAppLibrariesContainer(IProject project){ - IClasspathContainer container = getInstalledContainer(project, J2EEComponentClasspathUpdater.WEB_APP_LIBS_PATH); - FlexibleProjectContainer webAppLibrariesContainer = null; - if (null != container && container instanceof FlexibleProjectContainer) { - webAppLibrariesContainer = (FlexibleProjectContainer) container; - } - return webAppLibrariesContainer; - } - - public static IClasspathEntry getInstalledContainerEntry(IJavaProject jproj, IPath classpathContainerPath) { - try { - IClasspathEntry[] cpes; - cpes = jproj.getRawClasspath(); - for (int j = 0; j < cpes.length; j++) { - final IClasspathEntry cpe = cpes[j]; - if (cpe.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { - if (cpe.getPath().equals(classpathContainerPath)) { - return cpe; // entry found - } - } - } - } catch (JavaModelException e) { - J2EEPlugin.getDefault().getLogger().logError(e); - } - // entry not found - return null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathInitializer.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathInitializer.java deleted file mode 100644 index becfb2ef4..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathInitializer.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.common.classpath; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jdt.core.ClasspathContainerInitializer; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.common.jdt.internal.classpath.ClasspathDecorations; -import org.eclipse.jst.common.jdt.internal.classpath.ClasspathDecorationsManager; - -public class J2EEComponentClasspathInitializer extends ClasspathContainerInitializer { - - private static final ClasspathDecorationsManager decorations = J2EEComponentClasspathContainer.getDecorationsManager(); - - public void initialize(IPath containerPath, IJavaProject javaProject) throws CoreException { - J2EEComponentClasspathContainer.install(containerPath, javaProject); - } - - public boolean canUpdateClasspathContainer(final IPath containerPath, final IJavaProject project) { - return true; - } - - public void requestClasspathContainerUpdate(final IPath containerPath, final IJavaProject javaProject, final IClasspathContainer sg) throws CoreException { - final String key = containerPath.toString(); - final IClasspathEntry[] entries = sg.getClasspathEntries(); - - for (int i = 0; i < entries.length; i++) { - final IClasspathEntry entry = entries[i]; - - final IPath srcpath = entry.getSourceAttachmentPath(); - final IPath srcrootpath = entry.getSourceAttachmentRootPath(); - final IClasspathAttribute[] attrs = entry.getExtraAttributes(); - - if (srcpath != null || attrs.length > 0) { - final String eid = entry.getPath().toString(); - final ClasspathDecorations dec = new ClasspathDecorations(); - - dec.setSourceAttachmentPath(srcpath); - dec.setSourceAttachmentRootPath(srcrootpath); - dec.setExtraAttributes(attrs); - - decorations.setDecorations(key, eid, dec); - } - } - - decorations.save(); - - final IClasspathContainer container = JavaCore.getClasspathContainer(containerPath, javaProject); - - ( (J2EEComponentClasspathContainer) container ).refresh( true ); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathUpdater.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathUpdater.java deleted file mode 100644 index a498ad7f9..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathUpdater.java +++ /dev/null @@ -1,543 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.common.classpath; - -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -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.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -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.ISafeRunnable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.common.jdt.internal.classpath.FlexibleProjectContainer; -import org.eclipse.jst.j2ee.application.internal.operations.IModuleExtensions; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.componentcore.EnterpriseBinaryComponentHelper; -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.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.internal.impl.ResourceTreeRootAdapter; -import org.eclipse.wst.common.componentcore.internal.impl.WTPModulesResourceFactory; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil; -import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework; - -public class J2EEComponentClasspathUpdater implements IResourceChangeListener, IResourceDeltaVisitor { - - private static J2EEComponentClasspathUpdater instance = null; - - private static boolean updateDependencyGraph = true; - - private int pauseCount = 0; - - public static IPath WEB_APP_LIBS_PATH = new Path("org.eclipse.jst.j2ee.internal.web.container"); //$NON-NLS-1$ - - public static J2EEComponentClasspathUpdater getInstance() { - if (instance == null) { - init(); - } - return instance; - } - - private static void init() { - if (instance == null) { - instance = new J2EEComponentClasspathUpdater(); - } - } - - /** - * Pauses updates; any caller of this method must ensure through a - * try/finally block that resumeUpdates is subsequently called. - */ - public void pauseUpdates() { - synchronized (this) { - pauseCount++; - } - } - - public void resumeUpdates() { - resumeUpdates(true); - } - - private void resumeUpdates(boolean scheduleJob){ - synchronized (this) { - if (pauseCount > 0) { - pauseCount--; - } - if (pauseCount > 0) { - return; - } - } - if(scheduleJob){ - moduleUpdateJob.schedule(MODULE_UPDATE_DELAY); - } - } - - public void forceUpdate(Collection projects){ - forceUpdate(projects, true); - } - - /** - * Collection of type IProject - * @param projects - */ - public void forceUpdate(Collection projects, boolean runAsJob) { - try { - pauseUpdates(); - Iterator iterator = projects.iterator(); - while(iterator.hasNext()){ - queueUpdate((IProject)iterator.next()); - } - } finally { - forceUpdateOnNextRun = true; - // the following code is in place of the normal call to - // resume updates. This restores the pauseCount and forces - // the job to be scheduled immediately - synchronized (this) { - if (pauseCount > 0) { - pauseCount--; - } - } - if(runAsJob){ - moduleUpdateJob.schedule(0); - } else { - try - { - updateDependencyGraph = false; - moduleUpdateJob.run(new NullProgressMonitor()); - } - finally - { - updateDependencyGraph = true; - } - } - } - } - - private boolean forceUpdateOnNextRun = false; - - public void queueUpdate(IProject project) { - if (J2EEProjectUtilities.isEARProject(project)) { - queueUpdateEAR(project); - } else if (J2EEProjectUtilities.isApplicationClientProject(project) || J2EEProjectUtilities.isEJBProject(project) || J2EEProjectUtilities.isDynamicWebProject(project) - || J2EEProjectUtilities.isJCAProject(project) || J2EEProjectUtilities.isUtilityProject(project)) { - queueUpdateModule(project); - } - } - - public void queueUpdateModule(IProject project) { - moduleUpdateJob.queueModule(project); - synchronized (this) { - if (pauseCount > 0) { - return; - } - } - moduleUpdateJob.schedule(MODULE_UPDATE_DELAY); - } - - public void queueUpdateEAR(IProject earProject) { - moduleUpdateJob.queueEAR(earProject); - synchronized (this) { - if (pauseCount > 0) { - return; - } - } - moduleUpdateJob.schedule(MODULE_UPDATE_DELAY); - } - - public boolean projectsQueued() { - return moduleUpdateJob.projectsQueued() || moduleUpdateJob.getState() != Job.NONE; - } - - private static final int MODULE_UPDATE_DELAY = 30; - public static final String MODULE_UPDATE_JOB_NAME = "EAR Libraries Update Job"; - - private final ModuleUpdateJob moduleUpdateJob = new ModuleUpdateJob(); - - public class ModuleUpdateJob extends Job { - - public boolean belongsTo(Object family) { - if(family == MODULE_UPDATE_JOB_NAME){ - return true; - } - return super.belongsTo(family); - } - - // We use the listener list as a thread safe queue. - private class Queue extends ListenerList { - public synchronized Object[] getListeners() { - Object[] data = super.getListeners(); - clear(); - return data; - } - }; - - private Queue moduleQueue = new Queue(); - - private Queue earQueue = new Queue(); - - //a private queue for adding modules queued by the EAR - private Queue earAddedModuleQueue = new Queue(); - - public ModuleUpdateJob() { - super(MODULE_UPDATE_JOB_NAME); - setRule(ResourcesPlugin.getWorkspace().getRoot()); - setSystem(true); - } - - public void queueEAR(IProject ear) { - earQueue.add(ear); - } - - public void queueModule(IProject project) { - moduleQueue.add(project); - } - - public boolean projectsQueued() { - return !earQueue.isEmpty() || !moduleQueue.isEmpty(); - } - - /** - * Add referenced EARs from the queued modules into the EARs queue - */ - private void queueReferencingEars(Object[] projects) { - for (int p = 0; p < projects.length; p++) { - IProject project = (IProject) projects[p]; - if (!isKnown(project)) { - IProject[] earProjects = J2EEProjectUtilities.getReferencingEARProjects(project); - for (int i = 0; i < earProjects.length; i++) { - queueEAR(earProjects[i]); - } - } - } - } - - private void processEars() { - Object[] earProjects = earQueue.getListeners(); - for (int i = 0; i < earProjects.length; i++) { - IProject earProject = (IProject) earProjects[i]; - if (J2EEProjectUtilities.isEARProject(earProject)) - { - IVirtualComponent earComponent = ComponentCore.createComponent(earProject); - IVirtualReference[] refs = J2EEProjectUtilities.getComponentReferences(earComponent); - IVirtualComponent comp = null; - for (int j = 0; j < refs.length; j++) { - comp = refs[j].getReferencedComponent(); - if (!comp.isBinary()) { - earAddedModuleQueue.add(comp.getProject()); - } - } - if(null != earComponent){ - EnterpriseBinaryComponentHelper.ArchiveCache.getInstance().clearDisconnectedArchivesInEAR(earComponent); - } - } - } - } - - private void processModules(Object[] projects) { - for (int i = 0; i < projects.length; i++) { - IProject project = (IProject) projects[i]; - // this block is for Web app Libraries - if (J2EEProjectUtilities.isDynamicWebProject(project)) { - IClasspathContainer webAppLibrariesContainer = J2EEComponentClasspathContainerUtils.getInstalledWebAppLibrariesContainer(project); - // If the container is present, refresh it - if (webAppLibrariesContainer != null) { - ((FlexibleProjectContainer) webAppLibrariesContainer).refresh(); - } - } - - // ******************** The following is for EAR Libraries - IClasspathContainer earLibrariesContainer = J2EEComponentClasspathContainerUtils.getInstalledEARLibrariesContainer(project); - // If the container is present, refresh it - if (earLibrariesContainer != null) { - ((J2EEComponentClasspathContainer) earLibrariesContainer).refresh(forceUpdateOnNextRun); - } - } - // [202820] - updateDependencyGraph = true; - } - - protected IStatus run(IProgressMonitor monitor) { - - SafeRunner.run(new ISafeRunnable() { - public void handleException(Throwable e) { - J2EEPlugin.getDefault().getLogger().logError(e); - } - - public void run() throws Exception { - try { - Object[] moduleProjects = moduleQueue.getListeners(); - queueReferencingEars(moduleProjects); - processEars(); - Object [] earQueuedModuleProjects = earAddedModuleQueue.getListeners(); - Set modulesSet = new HashSet(); - modulesSet.addAll(Arrays.asList(moduleProjects)); - modulesSet.addAll(Arrays.asList(earQueuedModuleProjects)); - Object [] modulesArray = modulesSet.toArray(); - processModules(modulesArray); - } finally { - forceUpdateOnNextRun = false; - } - - } - }); - - return Status.OK_STATUS; - } - }; - - public IClasspathContainer getWebAppLibrariesContainer(IProject webProject, boolean create) { - IJavaProject jproj = JavaCore.create(webProject); - IClasspathContainer container = null; - IClasspathEntry entry = create ? null : getExistingContainer(jproj, WEB_APP_LIBS_PATH); - if (entry != null || create) { - try { - container = JavaCore.getClasspathContainer(WEB_APP_LIBS_PATH, jproj); - } catch (JavaModelException e) { - J2EEPlugin.getDefault().getLogger().logError(e); - } - } - return container; - } - - /** - * Returns the existing classpath container if it is already on the classpath. This will not - * create a new container. - * - * @param jproj - * @param classpathContainerID - * @return - */ - public IClasspathEntry getExistingContainer(IJavaProject jproj, IPath classpathContainerPath) { - return J2EEComponentClasspathContainerUtils.getInstalledContainerEntry(jproj, classpathContainerPath); - } - - private Set knownProjects = new HashSet(); - - private boolean isKnown(IProject project){ - return !knownProjects.add(project.getName()); - } - - private void forgetProject(IProject project){ - knownProjects.remove(project.getName()); - } - - public void resourceChanged(IResourceChangeEvent event) { - boolean scheduleJob = false; - try { - pauseUpdates(); - switch (event.getType()){ - case IResourceChangeEvent.PRE_CLOSE: - case IResourceChangeEvent.PRE_DELETE: - IResource resource = event.getResource(); - if(resource.getType() == IResource.PROJECT){ - if(ModuleCoreNature.isFlexibleProject((IProject) resource)){ - if(J2EEProjectUtilities.isEARProject((IProject)resource)){ - IProject earProject = (IProject) resource; - - IVirtualReference[] refs = J2EEProjectUtilities.getComponentReferences(ComponentCore.createComponent(earProject)); - IVirtualComponent comp = null; - for (int j = 0; j < refs.length; j++) { - comp = refs[j].getReferencedComponent(); - if (!comp.isBinary()) { - queueUpdateModule(comp.getProject()); - } - } - - } else { - IProject[] earProjects = J2EEProjectUtilities.getReferencingEARProjects((IProject)resource); - for(int i=0; i<earProjects.length; i++){ - queueUpdateEAR(earProjects[i]); - } - } - forgetProject((IProject)resource); - } - EnterpriseBinaryComponentHelper.ArchiveCache.getInstance().clearAllArchivesInProject((IProject)resource); - } - break; - case IResourceChangeEvent.POST_CHANGE: - scheduleJob = true; - event.getDelta().accept(this); - IResourceDelta[] d = event.getDelta().getAffectedChildren(); - findNode(d); - - break; - } - } catch (CoreException e) { - J2EEPlugin.getDefault().getLogger().logError(e); - } - finally { - resumeUpdates(scheduleJob); - } - } - - - public static void clearResourceTreeRootCache(WorkbenchComponent aModule) { - - ResourceTreeRootAdapter resourceTreeAdapter = (ResourceTreeRootAdapter) ExtendedEcoreUtil - .getAdapter(aModule, aModule.eAdapters(), - ResourceTreeRootAdapter.DEPLOY_ADAPTER_TYPE); - if(null != resourceTreeAdapter) { - resourceTreeAdapter.setResourceTreeRoot(null); - } - resourceTreeAdapter = (ResourceTreeRootAdapter) ExtendedEcoreUtil - .getAdapter(aModule, aModule.eAdapters(), - ResourceTreeRootAdapter.SOURCE_ADAPTER_TYPE); - if(null != resourceTreeAdapter){ - resourceTreeAdapter.setResourceTreeRoot(null); - } - } - - - /* - * Needs to notice changes to MANIFEST.MF in any J2EE projects, changes to - * .component in any J2EE Projects, and any archive changes in EAR projects - */ - - public boolean findNode(IResourceDelta[] delta) { - - for (int i = 0; i < delta.length; i++) { - if (delta[i].toString().indexOf(IJ2EEModuleConstants.COMPONENT_FILE_NAME) != -1) { - StructureEdit core = StructureEdit - .getStructureEditForRead(delta[i].getResource() - .getProject()); - if(null != core){ - WorkbenchComponent component = core.getComponent(); - if(component != null){ - clearResourceTreeRootCache(component); - } - } - } else { - findNode(delta[i].getAffectedChildren()); - } - } - - return true; - } - - public boolean visit(IResourceDelta delta) { - IResource resource = delta.getResource(); - switch (resource.getType()) { - case IResource.ROOT: - return true; - case IResource.PROJECT: - return ModuleCoreNature.isFlexibleProject((IProject) resource); - case IResource.FOLDER: { - if (resource.getName().equals(IJ2EEModuleConstants.DOT_SETTINGS)) { - return true; - } - IVirtualComponent comp = ComponentCore.createComponent(resource.getProject()); - - if (comp instanceof J2EEModuleVirtualComponent || comp instanceof EARVirtualComponent) { - IVirtualFolder rootFolder = comp.getRootFolder(); - if (comp instanceof EARVirtualComponent) { - return isRootAncester(resource, rootFolder); - } else { // J2EEModuleVirtualComponent - return isRootAncester(resource, rootFolder) || isFolder(resource, rootFolder.getFolder(J2EEConstants.META_INF)); - } - } - return false; - } - case IResource.FILE: { - String name = resource.getName(); - if (name.equals(WTPModulesResourceFactory.WTP_MODULES_SHORT_NAME) || name.equals(ProjectUtilities.DOT_CLASSPATH)) { - queueUpdate(resource.getProject()); - } else if (name.equals(J2EEConstants.MANIFEST_SHORT_NAME)) { // MANIFEST.MF must be all caps per spec - IFile manifestFile = J2EEProjectUtilities.getManifestFile(resource.getProject(), false); - if (null == manifestFile || resource.equals(manifestFile)) { - queueUpdateModule(resource.getProject()); - } - } else if (endsWithIgnoreCase(name, IModuleExtensions.DOT_JAR)) { - try { - if (FacetedProjectFramework.hasProjectFacet(resource.getProject(), J2EEProjectUtilities.ENTERPRISE_APPLICATION)) { - IVirtualComponent comp = ComponentCore.createComponent(resource.getProject()); - if(isFolder(resource.getParent(), comp.getRootFolder())){ - queueUpdateEAR(resource.getProject()); - } - } - } catch (CoreException e) { - J2EEPlugin.getDefault().getLogger().logError(e); - } - } - } - default: - return false; - } - } - - public static boolean endsWithIgnoreCase(String str, String sfx) { - return str.regionMatches(true, str.length() - sfx.length(), sfx, 0, sfx.length()); - } - - public static boolean isFolder(IResource resource, IVirtualFolder folder) { - IContainer[] realFolders = folder.getUnderlyingFolders(); - for (int i = 0; i < realFolders.length; i++) { - if (realFolders[i].equals(resource)) { - return true; - } - } - return false; - } - - public static boolean isRootAncester(IResource resource, IVirtualFolder rootFolder) { - IContainer[] realRoots = rootFolder.getUnderlyingFolders(); - IPath currentResourcePath = resource.getFullPath(); - for (int i = 0; i < realRoots.length; i++) { - if (currentResourcePath.isPrefixOf(realRoots[i].getFullPath())) - return true; - } - return false; - } - - public static boolean shouldUpdateDependencyGraph() - { - return updateDependencyGraph; - } - - // [202820] - public static void setUpdateDependencyGraph(boolean value) - { - updateDependencyGraph = value; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/INewJavaClassDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/INewJavaClassDataModelProperties.java deleted file mode 100644 index 1d23d6cd7..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/INewJavaClassDataModelProperties.java +++ /dev/null @@ -1,100 +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.internal.common.operations; - -import org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties; - -public interface INewJavaClassDataModelProperties extends IArtifactEditOperationDataModelProperties { - - /** - * Required, String property used to set the unqualified java class name for the new java class. - */ - public static final String CLASS_NAME = "NewJavaClassDataModel.CLASS_NAME"; //$NON-NLS-1$ - - /** - * Optional, String property used to set the source folder location for the new java class. The first - * source folder found in the project will be used if one is not specified. - */ - public static final String SOURCE_FOLDER = "NewJavaClassDataModel.SOURCE_FOLDER"; //$NON-NLS-1$ - - /** - * Optional, String property used to to set the java package for the new java class. The default - * package is used if one is not specified. - */ - public static final String JAVA_PACKAGE = "NewJavaClassDataModel.JAVA_PACKAGE"; //$NON-NLS-1$ - - /** - * Optional, String property used to set the qualified java class name of the superclass of the - * new java class. - */ - public static final String SUPERCLASS = "NewJavaClassDataModel.SUPERCLASS"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to set the visibility of the new java class. This is true - * by default. - */ - public static final String MODIFIER_PUBLIC = "NewJavaClassDataModel.MODIFIER_PUBLIC"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to set whether the new java class is abstract. This is false - * by default. - */ - public static final String MODIFIER_ABSTRACT = "NewJavaClassDataModel.MODIFIER_ABSTRACT"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to set whether the new java class is declared final. This is false - * by default. - */ - public static final String MODIFIER_FINAL = "NewJavaClassDataModel.MODIFIER_FINAL"; //$NON-NLS-1$ - - /** - * Optional, List property of all the qualified names of interfaces the new java class should implement. - */ - public static final String INTERFACES = "NewJavaClassDataModel.INTERFACES"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to set whether the new java class should generate a main method. This - * is false by default. - */ - public static final String MAIN_METHOD = "NewJavaClassDataModel.MAIN_METHOD"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to set whether or not the constructor from the superclass should be - * generated in the new java class. The default value is true. - */ - public static final String CONSTRUCTOR = "NewJavaClassDataModel.CONSTRUCTOR"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to set whether the new java class should add method stubs for unimplemented - * methods defined in the interfaces of the interface list. This is true by default. - */ - public static final String ABSTRACT_METHODS = "NewJavaClassDataModel.ABSTRACT_METHODS"; //$NON-NLS-1$ - - /** - * THIS PROPERTY SHOULD NOT BE SET, it's value is meant to be determined as a helper method - */ - public static final String JAVA_PACKAGE_FRAGMENT_ROOT = "NewJavaClassDataModel.JAVA_PACKAGE_FRAGMENT_ROOT"; //$NON-NLS-1$ - - /** - * THIS PROPERTY SHOULD NOT BE SET, it's value is meant to be determined as a helper method - */ - public static final String JAVA_SOURCE_FOLDER = "NewJavaClassDataModel.JAVA_SOURCE_FOLDER"; //$NON-NLS-1$ - - /** - * THIS PROPERTY SHOULD NOT BE SET, it's value is meant to be determined as a helper method - */ - public static final String PROJECT = "NewJavaClassDataModel.PROJECT"; //$NON-NLS-1$ - - /** - * THIS PROPERTY SHOULD NOT BE SET, it's value is meant to be determined as a helper method - */ - public static final String QUALIFIED_CLASS_NAME = "NewJavaClassDataModel.QUALIFIED_CLASS_NAME"; //$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/J2EEModifierHelperCreator.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/J2EEModifierHelperCreator.java deleted file mode 100644 index 16fa74fb1..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/J2EEModifierHelperCreator.java +++ /dev/null @@ -1,195 +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.internal.common.operations; - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.SecurityRole; -import org.eclipse.jst.j2ee.ejb.AssemblyDescriptor; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.ejb.EnterpriseBean; -import org.eclipse.jst.j2ee.ejb.MethodElement; -import org.eclipse.jst.j2ee.ejb.MethodPermission; -import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl; -import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility; -import org.eclipse.wst.common.internal.emfworkbench.integration.ModifierHelper; - - -/** - * Insert the type's description here. Creation date: (4/8/2001 10:13:52 PM) - * - * @author: Administrator - */ -public class J2EEModifierHelperCreator { - - public static ModifierHelper createAssemblyDescriptorHelper(EJBJar anEJBJar) { - if (anEJBJar == null || anEJBJar.getAssemblyDescriptor() != null) - return null; - EjbPackage pack = EjbFactoryImpl.getPackage(); - EStructuralFeature sf = pack.getEJBJar_AssemblyDescriptor(); - return new ModifierHelper(anEJBJar, sf, null); - } - - /** - * return modifier helper that will create a method element with method type and param - * associated with the methodSig and the methodpermission will be derived from the security - * role. - */ - - public static ModifierHelper createMethodElementAsCopyHelper(MethodElement element, SecurityRole role) { - if (role == null) - return null; - ModifierHelper tempHelper = new ModifierHelper(); - setMethodPermissionOwnerHelper(tempHelper, role); - tempHelper.setFeature(getEjbPackage().getMethodPermission_MethodElements()); - tempHelper.setValue(EtoolsCopyUtility.createCopy(element)); - return tempHelper; - } - - /** - * return modifier helper that will create a method element with method type and param - * associated with the methodSig and the methodpermission will be derived from the security - * role. - */ - - public static ModifierHelper createMethodElementHelper(EnterpriseBean bean, SecurityRole role, String methodType, String methodSig) { - if (role == null) - return null; - ModifierHelper tempHelper = new ModifierHelper(); - setMethodPermissionOwnerHelper(tempHelper, role); - tempHelper.setFeature(getEjbPackage().getMethodPermission_MethodElements()); - tempHelper.addAttribute(getEjbPackage().getMethodElement_Type(), methodType); - int index = methodSig.indexOf("(");//$NON-NLS-1$ - String methodName = methodSig; - String methodParms = null; - if (index > -1) { - methodName = methodSig.substring(0, index); - methodParms = methodSig.substring(index + 1, methodSig.length() - 1); - } - if (methodParms != null) - methodParms = methodParms.replace(',', ' '); - tempHelper.addAttribute(getEjbPackage().getMethodElement_Name(), methodName); - if (methodParms != null) - tempHelper.addAttribute(getEjbPackage().getMethodElement_Parms(), methodParms); - tempHelper.addAttribute(getEjbPackage().getMethodElement_EnterpriseBean(), bean); - return tempHelper; - } - - /** - * return modifier helper that will create a method element with method type and param - * associated with the methodSig and a new methodtransacton for a transtype. - */ - - public static ModifierHelper createMethodElementHelper(EnterpriseBean bean, String methodType, String methodSig, String transType) { - if (bean == null) - return null; - ModifierHelper ownerHelper = createMethodTransactionHelper((EJBJar) bean.eContainer(), transType); - ModifierHelper tempHelper = new ModifierHelper(); - tempHelper.setOwnerHelper(ownerHelper); - tempHelper.setFeature(getEjbPackage().getMethodTransaction_MethodElements()); - tempHelper.addAttribute(getEjbPackage().getMethodElement_Type(), methodType); - int index = methodSig.indexOf("(");//$NON-NLS-1$ - String methodName = methodSig; - String methodParms = null; - if (index > -1) { - methodName = methodSig.substring(0, index); - methodParms = methodSig.substring(index + 1, methodSig.length() - 1); - } - if (methodParms != null) - methodParms = methodParms.replace(',', ' '); - tempHelper.addAttribute(getEjbPackage().getMethodElement_Name(), methodName); - if (methodParms != null) - tempHelper.addAttribute(getEjbPackage().getMethodElement_Parms(), methodParms); - tempHelper.addAttribute(getEjbPackage().getMethodElement_EnterpriseBean(), bean); - return tempHelper; - } - - public static ModifierHelper createMethodPermissionHelper(SecurityRole role) { - - if (role == null) - return null; - - AssemblyDescriptor assembly = (AssemblyDescriptor) role.eContainer(); - EStructuralFeature sf = EjbPackage.eINSTANCE.getAssemblyDescriptor_MethodPermissions(); - ModifierHelper tempHelper = new ModifierHelper(assembly, sf, null); - tempHelper.addAttribute(getEjbPackage().getMethodPermission_Roles(), role); - return tempHelper; - } - - /** - * Create a helper that will create a new MethodTransaction with - * - * @aTransType. - */ - public static ModifierHelper createMethodTransactionHelper(EJBJar anEJBJar, String aTransType) { - if (anEJBJar == null) - return null; - ModifierHelper helper = new ModifierHelper(); - setAssemblyDescriptorOwnerHelper(helper, anEJBJar); - helper.setFeature(getEjbPackage().getAssemblyDescriptor_MethodTransactions()); - helper.addAttribute(getEjbPackage().getMethodTransaction_TransactionAttribute(), aTransType); - return helper; - } - - - - protected static CommonPackage getCommonPackage() { - return CommonPackage.eINSTANCE; - } - - protected static EjbPackage getEjbPackage() { - return EjbFactoryImpl.getPackage(); - } - - /** - * Set the owner of - * - * @helper to be the existing AssemblyDescriptor from - * @anEJBJar or set the ownerHelper of - * @helper for the creation of a new AssemblyDescriptor when one does not exist. - */ - public static void setAssemblyDescriptorOwnerHelper(ModifierHelper helper, EJBJar anEJBJar) { - ModifierHelper ownerHelper = J2EEModifierHelperCreator.createAssemblyDescriptorHelper(anEJBJar); - if (ownerHelper == null) - helper.setOwner(anEJBJar.getAssemblyDescriptor()); - else - helper.setOwnerHelper(ownerHelper); - } - - /** - * Set the owner of - * - * @helper to be the existing AssemblyDescriptor from - * @anEJBJar or set the ownerHelper of - * @helper for the creation of a new AssemblyDescriptor when one does not exist. - */ - public static void setMethodPermissionOwnerHelper(ModifierHelper helper, SecurityRole role) { - List roleList = new ArrayList(1); - roleList.add(role); - MethodPermission permission = ((AssemblyDescriptor) role.eContainer()).getMethodPermission(roleList); - ModifierHelper ownerHelper = null; - if (permission == null) - ownerHelper = J2EEModifierHelperCreator.createMethodPermissionHelper(role); - - if (ownerHelper == null) - helper.setOwner(permission); - else - helper.setOwnerHelper(ownerHelper); - } - - - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyDataModelProperties.java deleted file mode 100644 index 7a4c70ef2..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyDataModelProperties.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.internal.common.operations; - -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProperties; -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; - -/** - * {@link DoNotUseMeThisWillBeDeletedPost15} - * - * @deprecated This should no longer be necessary because of the new EAR & Web Lib classpath - * containers - */ -public interface JARDependencyDataModelProperties { - - /** - * String, the ear project name, required - */ - public static final String EAR_PROJECT_NAME = "AbstractJARDependencyDataModel.EAR_PROJECT_NAME"; //$NON-NLS-1$ - - public static final String REFERENCED_PROJECT_NAME = "AbstractJARDependencyDataModel.REFERENCED_PROJECT_NAME"; //$NON-NLS-1$ - - /** - * nested, required - */ - public static final String PROJECT_NAME = UpdateManifestDataModelProperties.PROJECT_NAME; - - - /** - * Used for client JAR dependency inversion - */ - public static final String OPPOSITE_PROJECT_NAME = "AbstractJARDependencyDataModel.OPPOSITE_PROJECT_NAME"; //$NON-NLS-1$ - - /** - * nested - */ - public static final String JAR_LIST = UpdateManifestDataModelProperties.JAR_LIST; - - /** - * type Integer, default JAR_MANIPULATION_ADD, other possible values are JAR_MANIPULATION_REMOVE - * and JAR_MANIPULATION_INVERT - */ - public static final String JAR_MANIPULATION_TYPE = "AbstractJARDependencyDataModel.JAR_MANIPULATION_TYPE"; //$NON-NLS-1$ - - public static final String NESTED_MODEL_UPDATE_MAINFEST = "AbstractJARDependencyDataModel.NESTED_MODEL_UPDATE_MAINFEST"; //$NON-NLS-1$ - - public static final int JAR_MANIPULATION_ADD = 0; - public static final int JAR_MANIPULATION_REMOVE = 1; - public static final int JAR_MANIPULATION_INVERT = 2; - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyDataModelProvider.java deleted file mode 100644 index 82af68a56..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyDataModelProvider.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Dec 2, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.common.operations; - -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -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.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; - -/** - * {@link DoNotUseMeThisWillBeDeletedPost15} - * - * @deprecated This should no longer be necessary because of the new EAR & Web Lib classpath - * containers - */ -public class JARDependencyDataModelProvider extends AbstractDataModelProvider implements JARDependencyDataModelProperties { - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(EAR_PROJECT_NAME); - propertyNames.add(REFERENCED_PROJECT_NAME); - propertyNames.add(JAR_MANIPULATION_TYPE); - propertyNames.add(OPPOSITE_PROJECT_NAME); - return propertyNames; - } - - public void init() { - super.init(); - IDataModel updateManifestDataModel = DataModelFactory.createDataModel(UpdateManifestDataModelProvider.class); - model.addNestedModel(NESTED_MODEL_UPDATE_MAINFEST, updateManifestDataModel); - } - - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(JAR_MANIPULATION_TYPE)) { - return new Integer(JAR_MANIPULATION_ADD); - } - return super.getDefaultProperty(propertyName); - } - - public IProject getEARProject() { - return ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME)); - } - - /** - * @return - */ - public IDataModel getUpdateManifestDataModel() { - return model.getNestedModel(NESTED_MODEL_UPDATE_MAINFEST); - } - - public IProject getReferencedProject() { - return ProjectUtilities.getProject(getStringProperty(REFERENCED_PROJECT_NAME)); - } - - public IProject getOppositeProject() { - return ProjectUtilities.getProject(getStringProperty(OPPOSITE_PROJECT_NAME)); - } - - public IDataModelOperation getDefaultOperation() { - return new JARDependencyOperation(model); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyOperation.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyOperation.java deleted file mode 100644 index 3d5f1e4bb..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JARDependencyOperation.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Sep 2, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.common.operations; - -import java.lang.reflect.InvocationTargetException; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProperties; -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider; -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestOperation; -import org.eclipse.jst.j2ee.internal.common.ClasspathModel; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; -import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress; - -/** - * {@link DoNotUseMeThisWillBeDeletedPost15} - * - * @deprecated This should no longer be necessary because of the new EAR & Web Lib classpath - * containers - */ -public class JARDependencyOperation extends AbstractDataModelOperation implements JARDependencyDataModelProperties{ - public JARDependencyOperation(IDataModel dataModel) { - super(dataModel); - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - - private void saveModel(ClasspathModel model, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException, CoreException { - if (!model.isDirty()) - return; - validateEdit(model); - monitor.beginTask("", 2); //$NON-NLS-1$ - org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestOperation mfOperation = createManifestOperation(model); - IHeadlessRunnableWithProgress buildPathOperation = createBuildPathOperation(model); - try { - mfOperation.execute(new SubProgressMonitor(monitor, 1), null); - // No longer manipulating build path... containers will calculate - //buildPathOperation.run(new SubProgressMonitor(monitor, 1)); - } catch (Exception e) { - Logger.getLogger().logError(e); - } - } - - /** - * @param model - */ - protected void validateEdit(ClasspathModel aModel) throws CoreException { - Set affectedFiles = aModel.getAffectedFiles(); - IFile[] files = (IFile[]) affectedFiles.toArray(new IFile[affectedFiles.size()]); - IStatus result = J2EEPlugin.getWorkspace().validateEdit(files, null); - if (!result.isOK()) - throw new CoreException(result); - } - - protected UpdateJavaBuildPathOperation createBuildPathOperation(ClasspathModel aModel) { - IJavaProject javaProject = JemProjectUtilities.getJavaProject(aModel.getProject()); - return new UpdateJavaBuildPathOperation(javaProject, aModel.getClassPathSelection()); - } - - private UpdateManifestOperation createManifestOperation(ClasspathModel aModel) { - IDataModel updateManifestDataModel = DataModelFactory.createDataModel(UpdateManifestDataModelProvider.class); - updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.PROJECT_NAME, aModel.getProject().getName()); - updateManifestDataModel.setBooleanProperty(UpdateManifestDataModelProperties.MERGE, false); - updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.JAR_LIST, UpdateManifestDataModelProvider.convertClasspathStringToList(aModel.getClassPathSelection().toString())); - updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.MANIFEST_FILE, J2EEProjectUtilities.getManifestFile( aModel.getProject())); - return new UpdateManifestOperation(updateManifestDataModel); - } - - - public final IStatus execute(IProgressMonitor monitor, IAdaptable adaptable) throws ExecutionException { - - IProject proj = ProjectUtilities.getProject(model.getStringProperty(JARDependencyDataModelProperties.PROJECT_NAME)); - IProject earProject = ProjectUtilities.getProject(model.getStringProperty(JARDependencyDataModelProperties.EAR_PROJECT_NAME)); - - ClasspathModel clpModel = new ClasspathModel(null); - IVirtualComponent earComponent = ComponentCore.createComponent( earProject ); - if( !earComponent.exists() ) - return OK_STATUS; - - clpModel.setSelectedEARComponent( earComponent ); - clpModel.setProject( proj ); - - try { - int jarManipulationType = model.getIntProperty(JARDependencyDataModelProperties.JAR_MANIPULATION_TYPE); - switch (jarManipulationType) { - case JARDependencyDataModelProperties.JAR_MANIPULATION_ADD : - { - List jarList = (List) model.getNestedModel(NESTED_MODEL_UPDATE_MAINFEST).getProperty(UpdateManifestDataModelProperties.JAR_LIST); - if (!jarList.isEmpty()) { - for (int i = 0; i < jarList.size(); i++) { - String jarName = (String) jarList.get(i); - clpModel.selectDependencyIfNecessary(jarName); - } - } else { - IProject refproj = ProjectUtilities.getProject(model.getStringProperty(JARDependencyDataModelProperties.REFERENCED_PROJECT_NAME)); - clpModel.selectDependencyIfNecessary( refproj ); - } - } - break; - - case JARDependencyDataModelProperties.JAR_MANIPULATION_REMOVE : - { - List jarList = (List) model.getNestedModel(NESTED_MODEL_UPDATE_MAINFEST).getProperty(UpdateManifestDataModelProperties.JAR_LIST); - for (int i = 0; i < jarList.size(); i++) { - String jarName = (String) jarList.get(i); - clpModel.removeDependency(jarName); - } - } - break; - - case JARDependencyDataModelProperties.JAR_MANIPULATION_INVERT : - { - IProject refproj = ProjectUtilities.getProject(model.getStringProperty(JARDependencyDataModelProperties.REFERENCED_PROJECT_NAME)); - IProject oppositeProject = ProjectUtilities.getProject(model.getStringProperty(JARDependencyDataModelProperties.OPPOSITE_PROJECT_NAME)); - clpModel.getClassPathSelection().invertClientJARSelection( refproj, oppositeProject ); - } - break; - - } - if (clpModel.isDirty()) - try { - saveModel(clpModel, monitor); - } catch (InvocationTargetException e) { - Logger.getLogger().logError(e); - } catch (InterruptedException e) { - Logger.getLogger().logError(e); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } finally { - if (clpModel != null) - clpModel.dispose(); - if (monitor != null) - monitor.done(); - } - return OK_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JavaModelUtil.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JavaModelUtil.java deleted file mode 100644 index 1d147df0e..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/JavaModelUtil.java +++ /dev/null @@ -1,897 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Apr 30, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.common.operations; - - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Map; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.ClasspathContainerInitializer; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.IClassFile; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.ICodeAssist; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IField; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IMember; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IOpenable; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IParent; -import org.eclipse.jdt.core.ISourceReference; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.ITypeHierarchy; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jdt.core.WorkingCopyOwner; -import org.eclipse.jdt.core.compiler.CharOperation; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.IVMInstall2; -import org.eclipse.jdt.launching.JavaRuntime; - -//TODO this is a copy of the class in org.eclipse.jdt.ui and should be deleted once bugzilla 60567 -// is addressed -/** - * - * @author jsholl - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -/** - * Utility methods for the Java Model. - */ -public final class JavaModelUtil { - - /** - * Only use this suffix for creating new .java files. - * In general, use one of the three *JavaLike*(..) methods in JavaCore or create - * a name from an existing compilation unit with {@link #getRenamedCUName(ICompilationUnit, String)} - * <p> - * Note: Unlike {@link JavaCore#getJavaLikeExtensions()}, this suffix includes a leading ".". - * </p> - * - * @see JavaCore#getJavaLikeExtensions() - * @see JavaCore#isJavaLikeFileName(String) - * @see JavaCore#removeJavaLikeExtension(String) - * @see #getRenamedCUName(ICompilationUnit, String) - */ - public static final String DEFAULT_CU_SUFFIX= ".java"; //$NON-NLS-1$ - - /** - * Finds a type by its qualified type name (dot separated). - * @param jproject The java project to search in - * @param fullyQualifiedName The fully qualified name (type name with enclosing type names and package (all separated by dots)) - * @return The type found, or null if not existing - */ - public static IType findType(IJavaProject jproject, String fullyQualifiedName) throws JavaModelException { - //workaround for bug 22883 - IType type= jproject.findType(fullyQualifiedName); - if (type != null) - return type; - IPackageFragmentRoot[] roots= jproject.getPackageFragmentRoots(); - for (int i= 0; i < roots.length; i++) { - IPackageFragmentRoot root= roots[i]; - type= findType(root, fullyQualifiedName); - if (type != null && type.exists()) - return type; - } - return null; - } - - /** - * Finds a type by its qualified type name (dot separated). - * @param jproject The java project to search in - * @param fullyQualifiedName The fully qualified name (type name with enclosing type names and package (all separated by dots)) - * @param owner the working copy owner - * @return The type found, or null if not existing - */ - public static IType findType(IJavaProject jproject, String fullyQualifiedName, WorkingCopyOwner owner) throws JavaModelException { - //workaround for bug 22883 - IType type= jproject.findType(fullyQualifiedName, owner); - if (type != null) - return type; - IPackageFragmentRoot[] roots= jproject.getPackageFragmentRoots(); - for (int i= 0; i < roots.length; i++) { - IPackageFragmentRoot root= roots[i]; - type= findType(root, fullyQualifiedName); - if (type != null && type.exists()) - return type; - } - return null; - } - - - - private static IType findType(IPackageFragmentRoot root, String fullyQualifiedName) throws JavaModelException{ - IJavaElement[] children= root.getChildren(); - for (int i= 0; i < children.length; i++) { - IJavaElement element= children[i]; - if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT){ - IPackageFragment pack= (IPackageFragment)element; - if (! fullyQualifiedName.startsWith(pack.getElementName())) - continue; - IType type= findType(pack, fullyQualifiedName); - if (type != null && type.exists()) - return type; - } - } - return null; - } - - private static IType findType(IPackageFragment pack, String fullyQualifiedName) throws JavaModelException{ - ICompilationUnit[] cus= pack.getCompilationUnits(); - for (int i= 0; i < cus.length; i++) { - ICompilationUnit unit= cus[i]; - IType type= findType(unit, fullyQualifiedName); - if (type != null && type.exists()) - return type; - } - return null; - } - - private static IType findType(ICompilationUnit cu, String fullyQualifiedName) throws JavaModelException{ - IType[] types= cu.getAllTypes(); - for (int i= 0; i < types.length; i++) { - IType type= types[i]; - if (getFullyQualifiedName(type).equals(fullyQualifiedName)) - return type; - } - return null; - } - - /** - * Finds a type container by container name. - * The returned element will be of type <code>IType</code> or a <code>IPackageFragment</code>. - * <code>null</code> is returned if the type container could not be found. - * @param jproject The Java project defining the context to search - * @param typeContainerName A dot separated name of the type container - * @see #getTypeContainerName(IType) - */ - public static IJavaElement findTypeContainer(IJavaProject jproject, String typeContainerName) throws JavaModelException { - // try to find it as type - IJavaElement result= jproject.findType(typeContainerName); - if (result == null) { - // find it as package - IPath path= new Path(typeContainerName.replace('.', '/')); - result= jproject.findElement(path); - if (!(result instanceof IPackageFragment)) { - result= null; - } - - } - return result; - } - - /** - * Finds a type in a compilation unit. Typical usage is to find the corresponding - * type in a working copy. - * @param cu the compilation unit to search in - * @param typeQualifiedName the type qualified name (type name with enclosing type names (separated by dots)) - * @return the type found, or null if not existing - */ - public static IType findTypeInCompilationUnit(ICompilationUnit cu, String typeQualifiedName) throws JavaModelException { - IType[] types= cu.getAllTypes(); - for (int i= 0; i < types.length; i++) { - String currName= getTypeQualifiedName(types[i]); - if (typeQualifiedName.equals(currName)) { - return types[i]; - } - } - return null; - } - - /** - * Returns the element of the given compilation unit which is "equal" to the - * given element. Note that the given element usually has a parent different - * from the given compilation unit. - * - * @param cu the cu to search in - * @param element the element to look for - * @return an element of the given cu "equal" to the given element - */ - public static IJavaElement findInCompilationUnit(ICompilationUnit cu, IJavaElement element) { - IJavaElement[] elements= cu.findElements(element); - if (elements != null && elements.length > 0) { - return elements[0]; - } - return null; - } - - /** - * Returns the qualified type name of the given type using '.' as separators. - * This is a replace for IType.getTypeQualifiedName() - * which uses '$' as separators. As '$' is also a valid character in an id - * this is ambiguous. JavaCore PR: 1GCFUNT - */ - public static String getTypeQualifiedName(IType type) { - try { - if (type.isBinary() && !type.isAnonymous()) { - IType declaringType= type.getDeclaringType(); - if (declaringType != null) { - return getTypeQualifiedName(declaringType) + '.' + type.getElementName(); - } - } - } catch (JavaModelException e) { - // ignore - } - return type.getTypeQualifiedName('.'); - } - - /** - * Returns the fully qualified name of the given type using '.' as separators. - * This is a replace for IType.getFullyQualifiedTypeName - * which uses '$' as separators. As '$' is also a valid character in an id - * this is ambiguous. JavaCore PR: 1GCFUNT - */ - public static String getFullyQualifiedName(IType type) { - try { - if (type.isBinary() && !type.isAnonymous()) { - IType declaringType= type.getDeclaringType(); - if (declaringType != null) { - return getFullyQualifiedName(declaringType) + '.' + type.getElementName(); - } - } - } catch (JavaModelException e) { - // ignore - } - return type.getFullyQualifiedName('.'); - } - - /** - * Returns the fully qualified name of a type's container. (package name or enclosing type name) - */ - public static String getTypeContainerName(IType type) { - IType outerType= type.getDeclaringType(); - if (outerType != null) { - return getFullyQualifiedName(outerType); - } else { - return type.getPackageFragment().getElementName(); - } - } - - - /** - * Concatenates two names. Uses a dot for separation. - * Both strings can be empty or <code>null</code>. - */ - public static String concatenateName(String name1, String name2) { - StringBuffer buf= new StringBuffer(); - if (name1 != null && name1.length() > 0) { - buf.append(name1); - } - if (name2 != null && name2.length() > 0) { - if (buf.length() > 0) { - buf.append('.'); - } - buf.append(name2); - } - return buf.toString(); - } - - /** - * Concatenates two names. Uses a dot for separation. - * Both strings can be empty or <code>null</code>. - */ - public static String concatenateName(char[] name1, char[] name2) { - StringBuffer buf= new StringBuffer(); - if (name1 != null && name1.length > 0) { - buf.append(name1); - } - if (name2 != null && name2.length > 0) { - if (buf.length() > 0) { - buf.append('.'); - } - buf.append(name2); - } - return buf.toString(); - } - - /** - * Evaluates if a member (possible from another package) is visible from - * elements in a package. - * @param member The member to test the visibility for - * @param pack The package in focus - */ - public static boolean isVisible(IMember member, IPackageFragment pack) throws JavaModelException { - - int type= member.getElementType(); - if (type == IJavaElement.INITIALIZER || (type == IJavaElement.METHOD && member.getElementName().startsWith("<"))) { //$NON-NLS-1$ - return false; - } - - int otherflags= member.getFlags(); - IType declaringType= member.getDeclaringType(); - if (Flags.isPublic(otherflags) || (declaringType != null && isInterfaceOrAnnotation(declaringType))) { - return true; - } else if (Flags.isPrivate(otherflags)) { - return false; - } - - IPackageFragment otherpack= (IPackageFragment) member.getAncestor(IJavaElement.PACKAGE_FRAGMENT); - return (pack != null && otherpack != null && isSamePackage(pack, otherpack)); - } - - /** - * Evaluates if a member in the focus' element hierarchy is visible from - * elements in a package. - * @param member The member to test the visibility for - * @param pack The package of the focus element focus - */ - public static boolean isVisibleInHierarchy(IMember member, IPackageFragment pack) throws JavaModelException { - int type= member.getElementType(); - if (type == IJavaElement.INITIALIZER || (type == IJavaElement.METHOD && member.getElementName().startsWith("<"))) { //$NON-NLS-1$ - return false; - } - - int otherflags= member.getFlags(); - - IType declaringType= member.getDeclaringType(); - if (Flags.isPublic(otherflags) || Flags.isProtected(otherflags) || (declaringType != null && isInterfaceOrAnnotation(declaringType))) { - return true; - } else if (Flags.isPrivate(otherflags)) { - return false; - } - - IPackageFragment otherpack= (IPackageFragment) member.getAncestor(IJavaElement.PACKAGE_FRAGMENT); - return (pack != null && pack.equals(otherpack)); - } - - - /** - * Returns the package fragment root of <code>IJavaElement</code>. If the given - * element is already a package fragment root, the element itself is returned. - */ - public static IPackageFragmentRoot getPackageFragmentRoot(IJavaElement element) { - return (IPackageFragmentRoot) element.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); - } - - /** - * Finds a method in a type. - * This searches for a method with the same name and signature. Parameter types are only - * compared by the simple name, no resolving for the fully qualified type name is done. - * Constructors are only compared by parameters, not the name. - * @param name The name of the method to find - * @param paramTypes The type signatures of the parameters e.g. <code>{"QString;","I"}</code> - * @param isConstructor If the method is a constructor - * @return The first found method or <code>null</code>, if nothing found - */ - public static IMethod findMethod(String name, String[] paramTypes, boolean isConstructor, IType type) throws JavaModelException { - IMethod[] methods= type.getMethods(); - for (int i= 0; i < methods.length; i++) { - if (isSameMethodSignature(name, paramTypes, isConstructor, methods[i])) { - return methods[i]; - } - } - return null; - } - - /** - * @deprecated use {@link #findMethodInHierarchy(ITypeHierarchy, IType, String, String[], boolean)} - */ - public static IMethod findMethodImplementationInHierarchy(ITypeHierarchy hierarchy, IType type, String name, String[] paramTypes, boolean isConstructor) throws JavaModelException { - return findMethodInHierarchy(hierarchy, type, name, paramTypes, isConstructor); - } - - /** - * Finds a method in a type and all its super types. The super class hierarchy is searched first, then the super interfaces. - * This searches for a method with the same name and signature. Parameter types are only - * compared by the simple name, no resolving for the fully qualified type name is done. - * Constructors are only compared by parameters, not the name. - * NOTE: For finding overridden methods or for finding the declaring method, use {@link MethodOverrideTester} - * @param hierarchy The hierarchy containing the type - * @param type The type to start the search from - * @param name The name of the method to find - * @param paramTypes The type signatures of the parameters e.g. <code>{"QString;","I"}</code> - * @param isConstructor If the method is a constructor - * @return The first found method or <code>null</code>, if nothing found - */ - public static IMethod findMethodInHierarchy(ITypeHierarchy hierarchy, IType type, String name, String[] paramTypes, boolean isConstructor) throws JavaModelException { - IMethod method= findMethod(name, paramTypes, isConstructor, type); - if (method != null) { - return method; - } - IType superClass= hierarchy.getSuperclass(type); - if (superClass != null) { - IMethod res= findMethodInHierarchy(hierarchy, superClass, name, paramTypes, isConstructor); - if (res != null) { - return res; - } - } - if (!isConstructor) { - IType[] superInterfaces= hierarchy.getSuperInterfaces(type); - for (int i= 0; i < superInterfaces.length; i++) { - IMethod res= findMethodInHierarchy(hierarchy, superInterfaces[i], name, paramTypes, false); - if (res != null) { - return res; - } - } - } - return method; - } - - - /** - * Tests if a method equals to the given signature. - * Parameter types are only compared by the simple name, no resolving for - * the fully qualified type name is done. Constructors are only compared by - * parameters, not the name. - * @param name Name of the method - * @param paramTypes The type signatures of the parameters e.g. <code>{"QString;","I"}</code> - * @param isConstructor Specifies if the method is a constructor - * @return Returns <code>true</code> if the method has the given name and parameter types and constructor state. - */ - public static boolean isSameMethodSignature(String name, String[] paramTypes, boolean isConstructor, IMethod curr) throws JavaModelException { - if (isConstructor || name.equals(curr.getElementName())) { - if (isConstructor == curr.isConstructor()) { - String[] currParamTypes= curr.getParameterTypes(); - if (paramTypes.length == currParamTypes.length) { - for (int i= 0; i < paramTypes.length; i++) { - String t1= Signature.getSimpleName(Signature.toString(paramTypes[i])); - String t2= Signature.getSimpleName(Signature.toString(currParamTypes[i])); - if (!t1.equals(t2)) { - return false; - } - } - return true; - } - } - } - return false; - } - - /** - * Tests if two <code>IPackageFragment</code>s represent the same logical java package. - * @return <code>true</code> if the package fragments' names are equal. - */ - public static boolean isSamePackage(IPackageFragment pack1, IPackageFragment pack2) { - return pack1.getElementName().equals(pack2.getElementName()); - } - - /** - * Checks whether the given type has a valid main method or not. - */ - public static boolean hasMainMethod(IType type) throws JavaModelException { - IMethod[] methods= type.getMethods(); - for (int i= 0; i < methods.length; i++) { - if (methods[i].isMainMethod()) { - return true; - } - } - return false; - } - - /** - * Checks if the field is boolean. - */ - public static boolean isBoolean(IField field) throws JavaModelException{ - return field.getTypeSignature().equals(Signature.SIG_BOOLEAN); - } - - /** - * @return <code>true</code> iff the type is an interface or an annotation - */ - public static boolean isInterfaceOrAnnotation(IType type) throws JavaModelException { - return type.isInterface(); - } - - /** - * Resolves a type name in the context of the declaring type. - * - * @param refTypeSig the type name in signature notation (for example 'QVector') this can also be an array type, but dimensions will be ignored. - * @param declaringType the context for resolving (type where the reference was made in) - * @return returns the fully qualified type name or build-in-type name. if a unresolved type couldn't be resolved null is returned - */ - public static String getResolvedTypeName(String refTypeSig, IType declaringType) throws JavaModelException { - int arrayCount= Signature.getArrayCount(refTypeSig); - char type= refTypeSig.charAt(arrayCount); - if (type == Signature.C_UNRESOLVED) { - String name= ""; //$NON-NLS-1$ - int bracket= refTypeSig.indexOf(Signature.C_GENERIC_START, arrayCount + 1); - if (bracket > 0) - name= refTypeSig.substring(arrayCount + 1, bracket); - else { - int semi= refTypeSig.indexOf(Signature.C_SEMICOLON, arrayCount + 1); - if (semi == -1) { - throw new IllegalArgumentException(); - } - name= refTypeSig.substring(arrayCount + 1, semi); - } - String[][] resolvedNames= declaringType.resolveType(name); - if (resolvedNames != null && resolvedNames.length > 0) { - return JavaModelUtil.concatenateName(resolvedNames[0][0], resolvedNames[0][1]); - } - return null; - } else { - return Signature.toString(refTypeSig.substring(arrayCount)); - } - } - - /** - * Returns if a CU can be edited. - */ - public static boolean isEditable(ICompilationUnit cu) { - Assert.isNotNull(cu); - IResource resource= cu.getPrimary().getResource(); - return (resource.exists() && !resource.getResourceAttributes().isReadOnly()); - } - - /** - * Returns the original if the given member. If the member is already - * an original the input is returned. The returned member might not exist - * - * @deprecated Replace by IMember#getPrimaryElement() if <code>member</code> is not part - * of a shared working copy owner. Also have a look at http://bugs.eclipse.org/bugs/show_bug.cgi?id=18568 - */ - public static IMember toOriginal(IMember member) { - if (member instanceof IMethod) - return toOriginalMethod((IMethod)member); - - // TODO: remove toOriginalMethod(IMethod) - - return (IMember) member.getPrimaryElement(); - /*ICompilationUnit cu= member.getCompilationUnit(); - if (cu != null && cu.isWorkingCopy()) - return (IMember)cu.getOriginal(member); - return member;*/ - } - - /* - * TODO remove if toOriginal(IMember) can be removed - * XXX workaround for bug 18568 - * http://bugs.eclipse.org/bugs/show_bug.cgi?id=18568 - * to be removed once the bug is fixed - */ - private static IMethod toOriginalMethod(IMethod method) { - ICompilationUnit cu= method.getCompilationUnit(); - if (cu == null || isPrimary(cu)) { - return method; - } - try{ - //use the workaround only if needed - if (! method.getElementName().equals(method.getDeclaringType().getElementName())) - return (IMethod) method.getPrimaryElement(); - - IType originalType = (IType) toOriginal(method.getDeclaringType()); - IMethod[] methods = originalType.findMethods(method); - boolean isConstructor = method.isConstructor(); - for (int i=0; i < methods.length; i++) { - if (methods[i].isConstructor() == isConstructor) - return methods[i]; - } - return null; - } catch (JavaModelException e){ - return null; - } - } - - /** - * Returns true if a cu is a primary cu (original or shared working copy) - */ - public static boolean isPrimary(ICompilationUnit cu) { - return cu.getOwner() == null; - } - - /* - * http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253 - * - * Reconciling happens in a separate thread. This can cause a situation where the - * Java element gets disposed after an exists test has been done. So we should not - * log not present exceptions when they happen in working copies. - */ - public static boolean isExceptionToBeLogged(CoreException exception) { - if (!(exception instanceof JavaModelException)) - return true; - JavaModelException je= (JavaModelException)exception; - if (!je.isDoesNotExist()) - return true; - IJavaElement[] elements= je.getJavaModelStatus().getElements(); - for (int i= 0; i < elements.length; i++) { - IJavaElement element= elements[i]; - // if the element is already a compilation unit don't log - // does not exist exceptions. See bug - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=75894 - // for more details - if (element.getElementType() == IJavaElement.COMPILATION_UNIT) - continue; - ICompilationUnit unit= (ICompilationUnit)element.getAncestor(IJavaElement.COMPILATION_UNIT); - if (unit == null) - return true; - if (!unit.isWorkingCopy()) - return true; - } - return false; - } - - public static boolean isSuperType(ITypeHierarchy hierarchy, IType possibleSuperType, IType type) { - // filed bug 112635 to add this method to ITypeHierarchy - IType superClass= hierarchy.getSuperclass(type); - if (superClass != null && (possibleSuperType.equals(superClass) || isSuperType(hierarchy, possibleSuperType, superClass))) { - return true; - } - if (Flags.isInterface(hierarchy.getCachedFlags(possibleSuperType))) { - IType[] superInterfaces= hierarchy.getSuperInterfaces(type); - for (int i= 0; i < superInterfaces.length; i++) { - IType curr= superInterfaces[i]; - if (possibleSuperType.equals(curr) || isSuperType(hierarchy, possibleSuperType, curr)) { - return true; - } - } - } - return false; - } - - public static boolean isExcludedPath(IPath resourcePath, IPath[] exclusionPatterns) { - char[] path = resourcePath.toString().toCharArray(); - for (int i = 0, length = exclusionPatterns.length; i < length; i++) { - char[] pattern= exclusionPatterns[i].toString().toCharArray(); - if (CharOperation.pathMatch(pattern, path, true, '/')) { - return true; - } - } - return false; - } - - - /* - * Returns whether the given resource path matches one of the exclusion - * patterns. - * - * @see IClasspathEntry#getExclusionPatterns - */ - public final static boolean isExcluded(IPath resourcePath, char[][] exclusionPatterns) { - if (exclusionPatterns == null) return false; - char[] path = resourcePath.toString().toCharArray(); - for (int i = 0, length = exclusionPatterns.length; i < length; i++) - if (CharOperation.pathMatch(exclusionPatterns[i], path, true, '/')) - return true; - return false; - } - - - /** - * Force a reconcile of a compilation unit. - * @param unit - */ - public static void reconcile(ICompilationUnit unit) throws JavaModelException { - unit.reconcile( - ICompilationUnit.NO_AST, - false /* don't force problem detection */, - null /* use primary owner */, - null /* no progress monitor */); - } - - /** - * Helper method that tests if an classpath entry can be found in a - * container. <code>null</code> is returned if the entry can not be found - * or if the container does not allows the configuration of source - * attachments - * @param jproject The container's parent project - * @param containerPath The path of the container - * @param libPath The path of the library to be found - * @return IClasspathEntry A classpath entry from the container of - * <code>null</code> if the container can not be modified. - */ - public static IClasspathEntry getClasspathEntryToEdit(IJavaProject jproject, IPath containerPath, IPath libPath) throws JavaModelException { - IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject); - ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0)); - if (container != null && initializer != null && initializer.canUpdateClasspathContainer(containerPath, jproject)) { - IClasspathEntry[] entries= container.getClasspathEntries(); - for (int i= 0; i < entries.length; i++) { - IClasspathEntry curr= entries[i]; - IClasspathEntry resolved= JavaCore.getResolvedClasspathEntry(curr); - if (resolved != null && libPath.equals(resolved.getPath())) { - return curr; // return the real entry - } - } - } - return null; // attachment not possible - } - - /** - * Get all compilation units of a selection. - * @param javaElements the selected java elements - * @return all compilation units containing and contained in elements from javaElements - * @throws JavaModelException - */ - public static ICompilationUnit[] getAllCompilationUnits(IJavaElement[] javaElements) throws JavaModelException { - HashSet result= new HashSet(); - for (int i= 0; i < javaElements.length; i++) { - addAllCus(result, javaElements[i]); - } - return (ICompilationUnit[]) result.toArray(new ICompilationUnit[result.size()]); - } - - private static void addAllCus(HashSet/*<ICompilationUnit>*/ collector, IJavaElement javaElement) throws JavaModelException { - switch (javaElement.getElementType()) { - case IJavaElement.JAVA_PROJECT: - IJavaProject javaProject= (IJavaProject) javaElement; - IPackageFragmentRoot[] packageFragmentRoots= javaProject.getPackageFragmentRoots(); - for (int i= 0; i < packageFragmentRoots.length; i++) - addAllCus(collector, packageFragmentRoots[i]); - return; - - case IJavaElement.PACKAGE_FRAGMENT_ROOT: - IPackageFragmentRoot packageFragmentRoot= (IPackageFragmentRoot) javaElement; - if (packageFragmentRoot.getKind() != IPackageFragmentRoot.K_SOURCE) - return; - IJavaElement[] packageFragments= packageFragmentRoot.getChildren(); - for (int j= 0; j < packageFragments.length; j++) - addAllCus(collector, packageFragments[j]); - return; - - case IJavaElement.PACKAGE_FRAGMENT: - IPackageFragment packageFragment= (IPackageFragment) javaElement; - collector.addAll(Arrays.asList(packageFragment.getCompilationUnits())); - return; - - case IJavaElement.COMPILATION_UNIT: - collector.add(javaElement); - return; - - default: - IJavaElement cu= javaElement.getAncestor(IJavaElement.COMPILATION_UNIT); - if (cu != null) - collector.add(cu); - } - } - - - /** - * Sets all compliance settings in the given map to 5.0 - */ - public static void set50CompilanceOptions(Map map) { - setCompilanceOptions(map, JavaCore.VERSION_1_5); - } - - public static void setCompilanceOptions(Map map, String compliance) { - if (JavaCore.VERSION_1_6.equals(compliance)) { - map.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_6); - map.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6); - map.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_6); - map.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR); - map.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR); - } else if (JavaCore.VERSION_1_5.equals(compliance)) { - map.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); - map.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); - map.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5); - map.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR); - map.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR); - } else if (JavaCore.VERSION_1_4.equals(compliance)) { - map.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); - map.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); - map.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2); - map.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.WARNING); - map.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING); - } else if (JavaCore.VERSION_1_3.equals(compliance)) { - map.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_3); - map.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); - map.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_1); - map.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.IGNORE); - map.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.IGNORE); - } else { - throw new IllegalArgumentException("Unsupported compliance: " + compliance); //$NON-NLS-1$ - } - } - - /** - * @return returns if version 1 is less than version 2. - */ - public static boolean isVersionLessThan(String version1, String version2) { - return version1.compareTo(version2) < 0; - } - - public static boolean is50OrHigher(String compliance) { - return !isVersionLessThan(compliance, JavaCore.VERSION_1_5); - } - - public static boolean is50OrHigher(IJavaProject project) { - return is50OrHigher(project.getOption(JavaCore.COMPILER_COMPLIANCE, true)); - } - - public static boolean is50OrHigherJRE(IJavaProject project) throws CoreException { - IVMInstall vmInstall= JavaRuntime.getVMInstall(project); - if (!(vmInstall instanceof IVMInstall2)) - return true; // assume 5.0. - - String compliance= getCompilerCompliance((IVMInstall2) vmInstall, null); - if (compliance == null) - return true; // assume 5.0 - return compliance.startsWith(JavaCore.VERSION_1_5) || compliance.startsWith(JavaCore.VERSION_1_6); - } - - public static String getCompilerCompliance(IVMInstall2 vMInstall, String defaultCompliance) { - String version= vMInstall.getJavaVersion(); - if (version == null) { - return defaultCompliance; - } else if (version.startsWith(JavaCore.VERSION_1_6)) { - return JavaCore.VERSION_1_6; - } else if (version.startsWith(JavaCore.VERSION_1_5)) { - return JavaCore.VERSION_1_5; - } else if (version.startsWith(JavaCore.VERSION_1_4)) { - return JavaCore.VERSION_1_4; - } else if (version.startsWith(JavaCore.VERSION_1_3)) { - return JavaCore.VERSION_1_3; - } else if (version.startsWith(JavaCore.VERSION_1_2)) { - return JavaCore.VERSION_1_3; - } else if (version.startsWith(JavaCore.VERSION_1_1)) { - return JavaCore.VERSION_1_3; - } - return defaultCompliance; - } - - /** - * Compute a new name for a compilation unit, given the name of the new main type. - * This query tries to maintain the existing extension (e.g. ".java"). - * - * @param cu a compilation unit - * @param newMainName the new name of the cu's main type (without extension) - * @return the new name for the compilation unit - */ - public static String getRenamedCUName(ICompilationUnit cu, String newMainName) { - String oldName = cu.getElementName(); - int i = oldName.lastIndexOf('.'); - if (i != -1) { - return newMainName + oldName.substring(i); - } else { - return newMainName; - } - } - - public static boolean isImplicitImport(String qualifier, ICompilationUnit cu) { - if ("java.lang".equals(qualifier)) { //$NON-NLS-1$ - return true; - } - String packageName= cu.getParent().getElementName(); - if (qualifier.equals(packageName)) { - return true; - } - String typeName= JavaCore.removeJavaLikeExtension(cu.getElementName()); - String mainTypeName= JavaModelUtil.concatenateName(packageName, typeName); - return qualifier.equals(mainTypeName); - } - - /** - * If <code>true</code>, then element can safely be cast to any of - * {@link IParent}, {@link IOpenable}, {@link ISourceReference}, or {@link ICodeAssist}. - * @param element - * @return <code>true</code> iff element is an {@link ICompilationUnit} or an {@link IClassFile} - */ - public static boolean isTypeContainerUnit(IJavaElement element) { - // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=125504 - return element instanceof ICompilationUnit || element instanceof IClassFile; - } - - public static IJavaElement getTypeContainerUnit(IMember member) { - ICompilationUnit cu= member.getCompilationUnit(); - if (cu != null) - return cu; - else - return member.getClassFile(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/NewJavaClassDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/NewJavaClassDataModelProvider.java deleted file mode 100644 index 3268f9314..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/NewJavaClassDataModelProvider.java +++ /dev/null @@ -1,523 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.common.operations; - -import java.lang.reflect.Modifier; -import java.util.Set; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaConventions; -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.j2ee.internal.common.J2EECommonMessages; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditOperationDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; - -/** - * This data model provider is a subclass of AbstractDataModelProvider and follows the - * IDataModelOperation and Data Model Wizard frameworks. - * - * @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider - * - * This data model provider extends the ArtifactEditOperationDataModelProvider to get project name - * and artifact edit information that during the operation, the artifact edit model can be used to - * save changes. - * @see org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditOperationDataModelProvider - * - * The NewJavaClassDataModelProvider is used to store all the base properties which would be needed - * to generate a new instance of a java class. Validations for these properties such as class name, - * package name, superclass, and modifiers are also provided. - * - * The INewJavaClassDataModelProperties is implemented to store all of the property names. - * @see org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties - * - * Clients must subclass this data model provider and the properties interface to use it and to - * cache and provide their own specific attributes. They should also provide their own validation - * methods and default values for the properties they add. - * - * The use of this class is EXPERIMENTAL and is subject to substantial changes. - */ -public class NewJavaClassDataModelProvider extends ArtifactEditOperationDataModelProvider implements INewJavaClassDataModelProperties { - - /** - * Subclasses may extend this method to perform their own validation. This method should not - * return null. It does not accept null as a parameter. - * - * @see NewJavaClassDataModelProvider#validate(String) - * - * @param folderFullPath - * @return IStatus - */ - protected IStatus validateJavaSourceFolder(String folderFullPath) { - // Ensure that the source folder path is not empty - if (folderFullPath == null || folderFullPath.length() == 0) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NAME_EMPTY; - return WTPCommonPlugin.createErrorStatus(msg); - } - // Ensure that the source folder path is absolute - else if (!new Path(folderFullPath).isAbsolute()) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NOT_ABSOLUTE; - return WTPCommonPlugin.createErrorStatus(msg); - } - IProject project = getTargetProject(); - // Ensure project is not closed - if (project == null) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NOT_EXIST; - return WTPCommonPlugin.createErrorStatus(msg); - } - // Ensure project is accessible. - if (!project.isAccessible()) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NOT_EXIST; - return WTPCommonPlugin.createErrorStatus(msg); - } - // Ensure the project is a java project. - try { - if (!project.hasNature(JavaCore.NATURE_ID)) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_NOT_JAVA_PROJECT; - return WTPCommonPlugin.createErrorStatus(msg); - } - } catch (CoreException e) { - Logger.getLogger().log(e); - } - // Ensure the selected folder is a valid java source folder for the component - IFolder sourcefolder = getJavaSourceFolder(); - if (sourcefolder == null || (sourcefolder != null && !sourcefolder.getFullPath().equals(new Path(folderFullPath)))) { - String msg = J2EECommonMessages.getResourceString(J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NOT_SOURCE, new String[]{folderFullPath}); - return WTPCommonPlugin.createErrorStatus(msg); - } - // Valid source is selected - return WTPCommonPlugin.OK_STATUS; - } - - /** - * Subclasses may extend this method to perform their own retrieval of a default java source - * folder. This implementation returns the first source folder in the project for the component. - * This method may return null. - * - * @return IFolder instance of default java source folder - */ - protected IFolder getDefaultJavaSourceFolder() { - IProject project = getTargetProject(); - if (project == null) - return null; - IPackageFragmentRoot[] sources = J2EEProjectUtilities.getSourceContainers(project); - // Try and return the first source folder - if (sources.length > 0) { - try { - return (IFolder) sources[0].getCorrespondingResource(); - } catch (Exception e) { - return null; - } - } - return null; - } - - /** - * Subclasses may extend this method to create their own specialized default WTP operation. This - * implementation creates an instance of the NewJavaClassOperation to create a new java class. - * This method will not return null. - * - * @see WTPOperationDataModel#getDefaultOperation() - * @see NewJavaClassOperation - * - * @return WTPOperation - */ - public IDataModelOperation getDefaultOperation() { - return new NewJavaClassOperation(getDataModel()); - } - - /** - * Subclasses may extend this method to add their own data model's properties as valid base - * properties. - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getPropertyNames() - */ - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(SOURCE_FOLDER); - propertyNames.add(JAVA_PACKAGE); - propertyNames.add(CLASS_NAME); - propertyNames.add(SUPERCLASS); - propertyNames.add(MODIFIER_PUBLIC); - propertyNames.add(MODIFIER_ABSTRACT); - propertyNames.add(MODIFIER_FINAL); - propertyNames.add(INTERFACES); - propertyNames.add(MAIN_METHOD); - propertyNames.add(CONSTRUCTOR); - propertyNames.add(ABSTRACT_METHODS); - propertyNames.add(JAVA_PACKAGE_FRAGMENT_ROOT); - propertyNames.add(JAVA_SOURCE_FOLDER); - propertyNames.add(PROJECT); - propertyNames.add(QUALIFIED_CLASS_NAME); - return propertyNames; - } - - /** - * Subclasses may extend this method to add the default values for their own specific data model - * properties. This declares the default values for the new java class. This method does not - * accept null. It may return null. - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getDefaultProperty(String) - * - * @param propertyName - * @return default object value of the property - */ - public Object getDefaultProperty(String propertyName) { - // Get the default source folder for the project - if (propertyName.equals(SOURCE_FOLDER)) { - IFolder sourceFolder = getDefaultJavaSourceFolder(); - if (sourceFolder != null && sourceFolder.exists()) - return sourceFolder.getFullPath().toOSString(); - } - // Use Object as the default superclass if one is not specified - else if (propertyName.equals(SUPERCLASS)) - return new String("java.lang.Object"); //$NON-NLS-1$ - // Use public as default visibility - else if (propertyName.equals(MODIFIER_PUBLIC)) - return new Boolean(true); - // Generate constructors from the superclass by default - else if (propertyName.equals(CONSTRUCTOR)) - return new Boolean(true); - // Generate unimplemented methods from declared interfaces by default - else if (propertyName.equals(ABSTRACT_METHODS)) - return new Boolean(true); - else if (propertyName.equals(PROJECT)) - return getTargetProject(); - else if (propertyName.equals(JAVA_SOURCE_FOLDER)) - return getJavaSourceFolder(); - else if (propertyName.equals(JAVA_PACKAGE_FRAGMENT_ROOT)) - return getJavaPackageFragmentRoot(); - else if (propertyName.equals(QUALIFIED_CLASS_NAME)) - return getQualifiedClassName(); - return super.getDefaultProperty(propertyName); - } - - /** - * This method will return the qualified java class name as specified by the class name and - * package name properties in the data model. This method should not return null. - * - * @see INewJavaClassDataModelProperties#CLASS_NAME - * @see INewJavaClassDataModelProperties#JAVA_PACKAGE - * - * @return String qualified java classname - */ - private String getQualifiedClassName() { - // Use the java package name and unqualified class name to create a qualified java class - // name - String packageName = getStringProperty(JAVA_PACKAGE); - String className = getStringProperty(CLASS_NAME); - // Ensure the class is not in the default package before adding package name to qualified - // name - if (packageName != null && packageName.trim().length() > 0) - return packageName + "." + className; //$NON-NLS-1$ - return className; - } - - /** - * Subclasses may override this method to provide their own validation of any of the data - * model's properties. This implementation ensures that a java class can be properly generated - * from the values as specified. This method will not return null. This method will not accept - * null as a parameter. - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#validate(java.lang.String) - * - * @param propertyName - * @return IStatus of the validity of the specifiec property - */ - public IStatus validate(String propertyName) { - IStatus result = super.validate(propertyName); - if (result != null && !result.isOK()) - return result; - if (propertyName.equals(SOURCE_FOLDER)) - return validateJavaSourceFolder(getStringProperty(propertyName)); - if (propertyName.equals(JAVA_PACKAGE)) - return validateJavaPackage(getStringProperty(propertyName)); - if (propertyName.equals(CLASS_NAME)) { - result = validateJavaClassName(getStringProperty(propertyName)); - if (result.isOK()) - result = canCreateTypeInClasspath(getStringProperty(CLASS_NAME)); - } - if (propertyName.equals(SUPERCLASS)) - return validateSuperclass(getStringProperty(propertyName)); - if (propertyName.equals(MODIFIER_ABSTRACT) || propertyName.equals(MODIFIER_FINAL)) - return validateModifier(propertyName, getBooleanProperty(propertyName)); - return result; - } - - /** - * This method will validate whether the specified package name is a valid java package name. It - * will be called during the doValidateProperty(String). This method will accept null. It will - * not return null. - * - * @see NewJavaClassDataModelProvider#validate(String) - * - * @param packName -- - * the package name - * @return IStatus of if the package name is valid - */ - private IStatus validateJavaPackage(String packName) { - if (packName != null && packName.trim().length() > 0) { - // Use standard java conventions to validate the package name - IStatus javaStatus = JavaConventions.validatePackageName(packName); - if (javaStatus.getSeverity() == IStatus.ERROR) { - String msg = J2EECommonMessages.ERR_JAVA_PACAKGE_NAME_INVALID + javaStatus.getMessage(); - return WTPCommonPlugin.createErrorStatus(msg); - } else if (javaStatus.getSeverity() == IStatus.WARNING) { - String msg = J2EECommonMessages.ERR_JAVA_PACKAGE_NAME_WARNING + javaStatus.getMessage(); - return WTPCommonPlugin.createWarningStatus(msg); - } - } - // java package name is valid - return WTPCommonPlugin.OK_STATUS; - } - - /** - * Subclasses may override this method to provide their own validation of the class name. This - * implementation will verify if the specified class name is a valid UNQUALIFIED java class - * name. This method will not accept null. It will not return null. - * - * @see NewJavaClassDataModelProvider#validate(String) - * - * @param className - * @return IStatus of if java class name is valid - */ - protected IStatus validateJavaClassName(String className) { - // Do not allow qualified name - if (className.lastIndexOf('.') != -1) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_NAME_QUALIFIED; - return WTPCommonPlugin.createErrorStatus(msg); - } - // Check Java class name by standard java conventions - IStatus javaStatus = JavaConventions.validateJavaTypeName(className); - if (javaStatus.getSeverity() == IStatus.ERROR) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_NAME_INVALID + javaStatus.getMessage(); - return WTPCommonPlugin.createErrorStatus(msg); - } else if (javaStatus.getSeverity() == IStatus.WARNING) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_NAME_WARNING + javaStatus.getMessage(); - return WTPCommonPlugin.createWarningStatus(msg); - } - return WTPCommonPlugin.OK_STATUS; - } - - /** - * This method will verify the specified superclass can be subclassed. It ensures the superclass - * is a valid java class, that it exists, and that it is not final. This method will accept - * null. It will not return null. - * - * @see NewJavaClassDataModelProvider#validate(String) - * - * @param superclassName - * @return IStatus of if the superclass can be subclassed - */ - private IStatus validateSuperclass(String superclassName) { - // Ensure the superclass name is not empty - if (superclassName == null || superclassName.trim().length() == 0) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_NAME_EMPTY; - return WTPCommonPlugin.createErrorStatus(msg); - } - // In default case of Object, return OK right away - if (superclassName.equals("java.lang.Object")) //$NON-NLS-1$ - return WTPCommonPlugin.OK_STATUS; - // Ensure the unqualified java class name of the superclass is valid - String className = superclassName; - int index = superclassName.lastIndexOf("."); //$NON-NLS-1$ - if (index != -1) { - className = superclassName.substring(index + 1); - } - IStatus status = validateJavaClassName(className); - // If unqualified super class name is valid, ensure validity of superclass itself - if (status.getSeverity() != IStatus.ERROR) { - // If the superclass does not exist, throw an error - IJavaProject javaProject = JemProjectUtilities.getJavaProject(getTargetProject()); - IType supertype = null; - try { - supertype = javaProject.findType(superclassName); - } catch (Exception e) { - // Just throw error below - } - if (supertype == null) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_SUPERCLASS_NOT_EXIST; - return WTPCommonPlugin.createErrorStatus(msg); - } - // Ensure the superclass is not final - int flags = -1; - try { - flags = supertype.getFlags(); - if (Modifier.isFinal(flags)) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_SUPERCLASS_FINAL; - return WTPCommonPlugin.createErrorStatus(msg); - } - } catch (Exception e) { - Logger.getLogger().log(e); - } - } - // Return status of specified superclass - return status; - } - - /** - * This method will ensure that if the abstract modifier is set, that final is not set, and - * vice-versa, as this is not supported either way. This method will not accept null. It will - * not return null. - * - * @see NewJavaClassDataModelProvider#validate(String) - * - * @param prop - * @return IStatus of whether abstract value is valid - */ - private IStatus validateModifier(String propertyName, boolean prop) { - // Throw an error if both Abstract and Final are checked - if (prop) { - // Ensure final is not also checked - if (propertyName.equals(MODIFIER_ABSTRACT) && getBooleanProperty(MODIFIER_FINAL)) { - String msg = J2EECommonMessages.ERR_BOTH_FINAL_AND_ABSTRACT; - return WTPCommonPlugin.createErrorStatus(msg); - } - // Ensure abstract is not also checked - if (propertyName.equals(MODIFIER_FINAL) && getBooleanProperty(MODIFIER_ABSTRACT)) { - String msg = J2EECommonMessages.ERR_BOTH_FINAL_AND_ABSTRACT; - return WTPCommonPlugin.createErrorStatus(msg); - } - } - // Abstract and final settings are valid - return WTPCommonPlugin.OK_STATUS; - } - - /** - * This method is intended for internal use only. This will check the java model for the - * specified javaproject in the data model for the existence of the passed in qualified - * classname. This method does not accept null. It may return null. - * - * @see NewJavaClassDataModelProvider#getTargetProject() - * @see JavaModelUtil#findType(IJavaProject, String) - * - * @param fullClassName - * @return IType for the specified classname - */ - protected IStatus canCreateTypeInClasspath(String className) { - // Retrieve the java project for the cached project - IJavaProject javaProject = JemProjectUtilities.getJavaProject(getTargetProject()); - try { - String folderPath = getStringProperty(SOURCE_FOLDER); - String packagePath = getStringProperty(JAVA_PACKAGE); - // Replace all "." with "//" in the package path to denote folders - if (packagePath.indexOf('.')>-1) { - StringBuffer buffer = new StringBuffer(packagePath); - for (int i = 0; i < buffer.length(); i++) { - if (buffer.charAt(i)=='.') { - buffer.deleteCharAt(i); - buffer.insert(i, "//"); //$NON-NLS-1$ - } - } - packagePath = buffer.toString(); - } - IPath path = new Path(folderPath + "//" + packagePath); //$NON-NLS-1$ - IPackageFragment pack = javaProject.findPackageFragment(path); - if (pack != null) { - ICompilationUnit cu = pack.getCompilationUnit(className + ".java"); //$NON-NLS-1$ - IResource resource = cu.getResource(); - if (resource.exists()) { - String msg = J2EECommonMessages.ERR_JAVA_CLASS_NAME_EXIST; - return WTPCommonPlugin.createErrorStatus(msg); - } - } - return WTPCommonPlugin.OK_STATUS; - } catch (Exception e) { - Logger.getLogger().log(e); - } - return WTPCommonPlugin.OK_STATUS; - } - - /** - * This will return the IFolder instance for the specified folder name in the data model. This - * method may return null. - * - * @see INewJavaClassDataModelProperties#SOURCE_FOLDER - * @see NewJavaClassDataModelProvider#getAllSourceFolders() - * - * @return IFolder java source folder - */ - protected final IFolder getJavaSourceFolder() { - IPackageFragmentRoot[] sources = J2EEProjectUtilities.getSourceContainers(getTargetProject()); - // Ensure there is valid source folder(s) - if (sources == null || sources.length == 0) - return null; - String folderFullPath = getStringProperty(SOURCE_FOLDER); - // Get the source folder whose path matches the source folder name value in the data model - for (int i = 0; i < sources.length; i++) { - if (sources[i].getPath().equals(new Path(folderFullPath))) { - try { - return (IFolder) sources[i].getCorrespondingResource(); - } catch (Exception e) { - break; - } - } - } - return null; - } - - /** - * Subclasses may extend this method to perform their own retrieval mechanism. This - * implementation simply returns the JDT package fragment root for the selected source folder. - * This method may return null. - * - * @see IJavaProject#getPackageFragmentRoot(org.eclipse.core.resources.IResource) - * - * @return IPackageFragmentRoot - */ - protected IPackageFragmentRoot getJavaPackageFragmentRoot() { - IProject project = getTargetProject(); - if (project != null) { - IJavaProject aJavaProject = JemProjectUtilities.getJavaProject(project); - // Return the source folder for the java project of the selected project - if (aJavaProject != null) { - IFolder sourcefolder = (IFolder) getProperty(JAVA_SOURCE_FOLDER); - if (sourcefolder != null) - return aJavaProject.getPackageFragmentRoot(sourcefolder); - } - } - return null; - } - - /** - * This method ensures the source folder is updated if the component is changed. - * - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#propertySet(String, - * Object) - * - * @return boolean if property set successfully - */ - public boolean propertySet(String propertyName, Object propertyValue) { - boolean result = super.propertySet(propertyName, propertyValue); - if (result) { - if (COMPONENT_NAME.equals(propertyName)){ - if( getDefaultJavaSourceFolder() != null ){ - setProperty(SOURCE_FOLDER, getDefaultJavaSourceFolder().getFullPath().toOSString()); - } - } - } - return result; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/NewJavaClassOperation.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/NewJavaClassOperation.java deleted file mode 100644 index 610d31713..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/NewJavaClassOperation.java +++ /dev/null @@ -1,875 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.common.operations; - -import java.io.ByteArrayInputStream; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.AbstractOperation; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.ITypeHierarchy; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * NewJavaClassOperation is a data model operation that is used to create a default instance of a new java class - * based on the input and properties set in the NewJavaClassDataModelProvider. - * @see org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModelProvider - * - * It is a subclass of ArtifactEditProviderOperation and clients can invoke this operation as is or it may be subclassed to - * add additional or modify behaviour. The execute() method can be extended to drive this behaviour. - * @see org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditProviderOperation - * - * The new java class is generated through the use of adding a series of static tokens defined within to - * an ongoing string buffer. - * - * The use of this class is EXPERIMENTAL and is subject to substantial changes. - * - * This needs to be removed as it is legacy inherited from another team - */ -public class NewJavaClassOperation extends AbstractDataModelOperation { - - // Tokens for string buffer creation of default java class - protected static final String EMPTY_STRING = ""; //$NON-NLS-1$ - protected static final String TAB = "\t"; //$NON-NLS-1$ - protected static final String SPACE = " "; //$NON-NLS-1$ - protected static final String DOT = "."; //$NON-NLS-1$ - protected static final String COMMA = ","; //$NON-NLS-1$ - protected static final String SEMICOLON = ";"; //$NON-NLS-1$ - protected static final String POUND = "#"; //$NON-NLS-1$ - protected static final String OPEN_PAR = "("; //$NON-NLS-1$ - protected static final String CLOSE_PAR = ")"; //$NON-NLS-1$ - protected static final String OPEN_BRA = "{"; //$NON-NLS-1$ - protected static final String CLOSE_BRA = "}"; //$NON-NLS-1$ - protected static final String lineSeparator = System.getProperty("line.separator"); //$NON-NLS-1$ - - protected static final String JAVA_LANG_OBJECT = "java.lang.Object"; //$NON-NLS-1$ - protected static final String PACKAGE = "package "; //$NON-NLS-1$ - protected static final String CLASS = "class "; //$NON-NLS-1$ - protected static final String IMPORT = "import "; //$NON-NLS-1$ - protected static final String EXTENDS = "extends "; //$NON-NLS-1$ - protected static final String IMPLEMENTS = "implements "; //$NON-NLS-1$ - protected static final String THROWS = "throws "; //$NON-NLS-1$ - protected static final String SUPER = "super"; //$NON-NLS-1$ - protected static final String PUBLIC = "public "; //$NON-NLS-1$ - protected static final String PROTECTED = "protected "; //$NON-NLS-1$ - protected static final String PRIVATE = "private "; //$NON-NLS-1$ - protected static final String STATIC = "static "; //$NON-NLS-1$ - protected static final String ABSTRACT = "abstract "; //$NON-NLS-1$ - protected static final String FINAL = "final "; //$NON-NLS-1$ - protected static final String VOID = "void"; //$NON-NLS-1$ - protected static final String INT = "int"; //$NON-NLS-1$ - protected static final String BOOLEAN = "boolean"; //$NON-NLS-1$ - protected static final String MAIN_METHOD = "\tpublic static void main(String[] args) {"; //$NON-NLS-1$ - protected static final String TODO_COMMENT = "\t\t// TODO Auto-generated method stub"; //$NON-NLS-1$ - protected static final String RETURN_NULL = "\t\treturn null;"; //$NON-NLS-1$ - protected static final String RETURN_0 = "\t\treturn 0;"; //$NON-NLS-1$ - protected static final String RETURN_FALSE = "\t\treturn false;"; //$NON-NLS-1$ - - /** - * This is a list of all the calculated import statements that will need to be added - */ - private List importStatements; - - /** - * This is a NewJavaClassOperation constructor. Data models passed in should be instances - * of NewJavaClassDataModel. This method does not accept null. It will not return null. - * @see NewJavaClassDataModelProvider - * - * @param dataModel - * @return NewJavaClassOperation - */ - public NewJavaClassOperation(IDataModel dataModel) { - super(dataModel); - importStatements = new ArrayList(); - } - - /** - * Subclasses may extend this method to add their own actions during execution. - * The implementation of the execute method drives the running of the operation. This - * method will create the source folder, the java package, and then create the java file. - * This method will accept null. - * @see AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - * - * @param monitor ProgressMonitor - * @throws CoreException - * @throws InterruptedException - * @throws InvocationTargetException - */ - public IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // Ensure source folder exists - IFolder sourceFolder = createJavaSourceFolder(); - // Ensure java package exists - IPackageFragment pack = createJavaPackage(); - // Create java class - createJavaFile(sourceFolder, pack); - return OK_STATUS; - } - - /** - * This method will return the java source folder as specified in the java class data model. - * It will create the java source folder if it does not exist. This method may return null. - * @see INewJavaClassDataModelProperties#SOURCE_FOLDER - * @see IFolder#create(boolean, boolean, org.eclipse.core.runtime.IProgressMonitor) - * - * @return IFolder the java source folder - */ - protected final IFolder createJavaSourceFolder() { - // Get the source folder name from the data model - String folderFullPath = model.getStringProperty(INewJavaClassDataModelProperties.SOURCE_FOLDER); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IFolder folder = root.getFolder(new Path(folderFullPath)); - // If folder does not exist, create the folder with the specified path - if (!folder.exists()) { - try { - folder.create(true, true, null); - } catch (CoreException e) { - Logger.getLogger().log(e); - } - } - // Return the source folder - return folder; - } - - /** - * This method will return the java package as specified by the new java class data model. - * If the package does not exist, it will create the package. This method should not return - * null. - * @see INewJavaClassDataModelProperties#JAVA_PACKAGE - * @see IPackageFragmentRoot#createPackageFragment(java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor) - * - * @return IPackageFragment the java package - */ - protected final IPackageFragment createJavaPackage() { - // Retrieve the package name from the java class data model - String packageName = model.getStringProperty(INewJavaClassDataModelProperties.JAVA_PACKAGE); - IPackageFragmentRoot packRoot = (IPackageFragmentRoot) model.getProperty(INewJavaClassDataModelProperties.JAVA_PACKAGE_FRAGMENT_ROOT); - IPackageFragment pack = packRoot.getPackageFragment(packageName); - // Handle default package - if (pack == null) { - pack = packRoot.getPackageFragment(""); //$NON-NLS-1$ - } - // Create the package fragment if it does not exist - if (!pack.exists()) { - String packName = pack.getElementName(); - try { - pack = packRoot.createPackageFragment(packName, true, null); - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - } - // Return the package - return pack; - } - - /** - * Subclasses may extend this method to provide their own java file creation path. - * This implementation will use the properties specified in the data model to create - * a default java class. The class will be built using pre-defined tokens and will be - * built up using a string buffer. The method getJavaFileContent will handle the building - * of the string buffer while this method will write those contents to the file. - * This method does not accept null parameters. - * @see INewJavaClassDataModelProperties#CLASS_NAME - * @see NewJavaClassOperation#getJavaFileContent(IPackageFragment, String) - * - * @param sourceFolder - * @param pack - */ - protected void createJavaFile(IFolder sourceFolder, IPackageFragment pack) { - // Retrieve properties from the java class data model - String packageName = model.getStringProperty(INewJavaClassDataModelProperties.JAVA_PACKAGE); - String className = model.getStringProperty(INewJavaClassDataModelProperties.CLASS_NAME); - String fileName = className + ".java"; //$NON-NLS-1$ - //ICompilationUnit cu = null; - try { - // Get the java file content from the string buffer - String content = getJavaFileContent(pack, className); - // Create the compilation unit - pack.createCompilationUnit(fileName, content, true, null); - byte[] contentBytes = content.getBytes(); - IPath packageFullPath = new Path(packageName.replace('.', IPath.SEPARATOR)); - IPath javaFileFullPath = packageFullPath.append(fileName); - IFile file = sourceFolder.getFile(javaFileFullPath); - // Set the contents in the file if it already exists - if (file != null && file.exists()) { - file.setContents(new ByteArrayInputStream(contentBytes), false, true, null); - } // If the file does not exist, create it with the contents - else if (file != null) { - file.create(new ByteArrayInputStream(contentBytes), false, null); - } - // editModel.getWorkingCopy(cu, true); //Track CU. - } catch (Exception ex) { - ex.printStackTrace(); - } - } - - /** - * This is intended for internal use only. This is where the string buffer for the contents - * of the java file is built up using the properties in the data model and the predefined tokens. - * This method will not accept null parameters. It will not return null. - * @see NewJavaClassDataModelProvider - * @see NewJavaClassOperation#createJavaFile(IFolder, IPackageFragment) - * - * @param pack - * @param className - * @return String java file contents - */ - private String getJavaFileContent(IPackageFragment pack, String className) { - // Create the superclass name - String superclassName = model.getStringProperty(INewJavaClassDataModelProperties.SUPERCLASS); - List interfaces = (List) model.getProperty(INewJavaClassDataModelProperties.INTERFACES); - String packageStatement = getPackageStatement(pack); - // Create the import statements - setupImportStatements(pack, superclassName, interfaces); - // Create the class declaration - String classDeclaration = getClassDeclaration(superclassName, className, interfaces); - // Create the fields - String fields = getFields(); - // Create the methods - String methods = getMethodStubs(superclassName, className); - - StringBuffer contents = new StringBuffer(); - // Add the package statement to the buffer - contents.append(packageStatement); - // Add all the import statements to the buffer - for (int i = 0; i < importStatements.size(); i++) { - contents.append(IMPORT + importStatements.get(i) + SEMICOLON); - contents.append(lineSeparator); - } - contents.append(lineSeparator); - // Add the class declaration to the buffer - contents.append(classDeclaration); - // Add the fields to the buffer - contents.append(fields); - // Add the method bodies to the buffer - contents.append(methods); - contents.append(CLOSE_BRA); - // Return the contents of the buffer - return contents.toString(); - } - - /** - * This is intended for internal use only. This method will return a package string for - * the class. It will not accept a null parameter. It will not return null. - * @see NewJavaClassOperation#getJavaFileContent(IPackageFragment, String) - * - * @param pack - * @return String package statement - */ - private String getPackageStatement(IPackageFragment pack) { - StringBuffer sb = new StringBuffer(); - // If it is not default package, add package statement - if (!pack.isDefaultPackage()) { - sb.append(PACKAGE + pack.getElementName() + SEMICOLON); - sb.append(lineSeparator); - sb.append(lineSeparator); - } - // Return contents of buffer - return sb.toString(); - } - - /** - * This method is intended for internal use. It checks to see if the qualified class name - * belongs to the specified package. This method will not accept nulls. It will not return null. - * @see NewJavaClassOperation#setupImportStatements(IPackageFragment, String, List) - * - * @param packageFragment - * @param className - * @return boolean is class in this package? - */ - private boolean isSamePackage(IPackageFragment packageFragment, String className) { - if (className != null && className.length() > 0) { - String sPackageName = packageFragment.getElementName(); - String classPackageName = Signature.getQualifier(className); - // Does the qualified class's package name match the passed in package's name? - if (classPackageName.equals(sPackageName)) - return true; - } - return false; - } - - /** - * This method is intended for internal use only. This method will set up the required import - * statements and cache to the importStatements list. - * This method does not accept null parameters. - * @see NewJavaClassOperation#importStatements - * @see NewJavaClassOperation#getJavaFileContent(IPackageFragment, String) - * - * @param pack - * @param superclassName - * @param interfaces - */ - private void setupImportStatements(IPackageFragment pack, String superclassName, List interfaces) { - // If there is a superclass and it is not in the same package, add an import for it - if (superclassName != null && superclassName.length() > 0) { - if (!superclassName.equals(JAVA_LANG_OBJECT) && !isSamePackage(pack, superclassName)) { - importStatements.add(superclassName); - } - } - // Add an import the list of implemented interfaces - if (interfaces != null && interfaces.size() > 0) { - int size = interfaces.size(); - for (int i = 0; i < size; i++) { - String interfaceName = (String) interfaces.get(i); - if(!interfaceName.equals(JAVA_LANG_OBJECT) && !isSamePackage(pack, interfaceName)){ - importStatements.add(interfaceName); - } - } - } - } - - /** - * This class is intended for internal use only. This will build up the class declartion - * statement based off the properties set in the java class data model. - * This method does not accept null parameters. It will not return null. - * @see NewJavaClassOperation#getJavaFileContent(IPackageFragment, String) - * - * @param superclassName - * @param className - * @param interfaces - * @return String class declaration string - */ - private String getClassDeclaration(String superclassName, String className, List interfaces) { - StringBuffer sb = new StringBuffer(); - // Append appropriate modifiers - if (model.getBooleanProperty(INewJavaClassDataModelProperties.MODIFIER_PUBLIC)) - sb.append(PUBLIC); - if (model.getBooleanProperty(INewJavaClassDataModelProperties.MODIFIER_ABSTRACT)) - sb.append(ABSTRACT); - if (model.getBooleanProperty(INewJavaClassDataModelProperties.MODIFIER_FINAL)) - sb.append(FINAL); - // Add the class token - sb.append(CLASS); - // Add the class name - sb.append(className + SPACE); - // If there is a superclass, add the extends and super class name - if (superclassName != null && superclassName.length() > 0 && !superclassName.equals(JAVA_LANG_OBJECT)) { - int index = superclassName.lastIndexOf(DOT); - if (index != -1) - superclassName = superclassName.substring(index + 1); - sb.append(EXTENDS + superclassName + SPACE); - } - // If there are interfaces, add the implements and then interate over the interface list - if (interfaces != null && interfaces.size() > 0) { - sb.append(IMPLEMENTS); - int size = interfaces.size(); - for (int i = 0; i < size; i++) { - String interfaceName = (String) interfaces.get(i); - int index = interfaceName.lastIndexOf(DOT); - if (index != -1) - interfaceName = interfaceName.substring(index + 1); - sb.append(interfaceName); - if (i < size - 1) - sb.append(COMMA); - sb.append(SPACE); - } - } - sb.append(OPEN_BRA); - sb.append(lineSeparator); - // Return the finished class declaration string - return sb.toString(); - } - - /** - * Subclasses may extend this method to add their own fields. The default implementation - * is not to have any fields. This method will not return null. - * @see NewJavaClassOperation#getJavaFileContent(IPackageFragment, String) - * - * @return String fields string - */ - protected String getFields() { - return EMPTY_STRING; - } - - /** - * This method is intended for internal use only. This will build up a string with the - * contents of all the method stubs for the unimplemented methods defined in the interfaces. - * It will also add inherited constructors from the superclass as appropriate. - * This method does not accept null parameters. It will not return null. - * @see NewJavaClassOperation#getJavaFileContent(IPackageFragment, String) - * - * @param superclassName - * @param className - * @return String method stubs string - */ - private String getMethodStubs(String superclassName, String className) { - StringBuffer sb = new StringBuffer(); - IJavaProject javaProj = JemProjectUtilities.getJavaProject(getTargetProject()); - if (model.getBooleanProperty(INewJavaClassDataModelProperties.MAIN_METHOD)) { - // Add main method - sb.append(MAIN_METHOD); - sb.append(lineSeparator); - sb.append(TODO_COMMENT); - sb.append(lineSeparator); - sb.append(TAB + CLOSE_BRA); - sb.append(lineSeparator); - sb.append(lineSeparator); - } - - IType superClassType = null; - if (model.getBooleanProperty(INewJavaClassDataModelProperties.CONSTRUCTOR) || model.getBooleanProperty(INewJavaClassDataModelProperties.ABSTRACT_METHODS)) { - // Find super class type - try { - superClassType = javaProj.findType(superclassName); - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - } - if (model.getBooleanProperty(INewJavaClassDataModelProperties.CONSTRUCTOR)) { - // Implement constructors from superclass - try { - if (superClassType != null) { - IMethod[] methods = superClassType.getMethods(); - for (int j = 0; j < methods.length; j++) { - if (methods[j].isConstructor() && !Flags.isPrivate(methods[j].getFlags()) && !hasGenericParams(methods[j])) { - String methodStub = getMethodStub(methods[j], superclassName, className); - sb.append(methodStub); - } - } - } - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - } - // Add unimplemented methods defined in the interfaces list - if (model.getBooleanProperty(INewJavaClassDataModelProperties.ABSTRACT_METHODS) && superClassType != null) { - String methodStub = getUnimplementedMethodsFromSuperclass(superClassType, className); - if (methodStub != null && methodStub.trim().length() > 0) - sb.append(methodStub); - methodStub = getUnimplementedMethodsFromInterfaces(superClassType, className, javaProj); - if (methodStub != null && methodStub.trim().length() > 0) - sb.append(methodStub); - } - // Add any user defined method stubs - if (superClassType != null) { - String userDefined = getUserDefinedMethodStubs(superClassType); - if (userDefined != null && userDefined.trim().length() > 0) - sb.append(userDefined); - } - // Return the methods string - return sb.toString(); - } - - private boolean hasGenericParams(IMethod method) { - try { - IType parentType = method.getDeclaringType(); - String[] paramTypes = method.getParameterTypes(); - - int nP = paramTypes.length; - for (int i = 0; i < nP; i++) { - String type = paramTypes[i]; - if (!isPrimitiveType(type)) { - type = JavaModelUtil.getResolvedTypeName(type, parentType); - if(type.indexOf(Signature.C_GENERIC_START, 0) != -1){ - return true; - } - } - } - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - return false; - } - - /** - * This method is intended for internal use only. This will retrieve method stubs for - * unimplemented methods in the superclass that will need to be created in the new class. - * This method does not accept null parameters. It will not return null. - * @see NewJavaClassOperation#getMethodStubs(String, String) - * - * @param superClassType - * @param className - * @return String unimplemented methods defined in superclass - */ - private String getUnimplementedMethodsFromSuperclass(IType superClassType, String className) { - StringBuffer sb = new StringBuffer(); - try { - // Implement abstract methods from superclass - IMethod[] methods = superClassType.getMethods(); - for (int j = 0; j < methods.length; j++) { - IMethod method = methods[j]; - int flags = method.getFlags(); - // Add if the method is abstract, not private or static, and the option is selected in data model - if ((Flags.isAbstract(flags) && !Flags.isStatic(flags) && !Flags.isPrivate(flags)) || implementImplementedMethod(methods[j])) { - String methodStub = getMethodStub(methods[j], superClassType.getFullyQualifiedName(), className); - sb.append(methodStub); - } - } - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - // Return method stubs string - return sb.toString(); - } - - /** - * This method is intended for internal use only. This will retrieve method stubs for - * unimplemented methods defined in the interfaces that will need to be created in the new class. - * This method does not accept null parameters. It will not return null. - * @see NewJavaClassOperation#getMethodStubs(String, String) - * - * @param superClassType - * @param className - * @param javaProj - * @return String unimplemented methods defined in interfaces - */ - private String getUnimplementedMethodsFromInterfaces(IType superClassType, String className, IJavaProject javaProj) { - StringBuffer sb = new StringBuffer(); - try { - // Implement defined methods from interfaces - List interfaces = (List) model.getProperty(INewJavaClassDataModelProperties.INTERFACES); - if (interfaces != null) { - for (int i = 0; i < interfaces.size(); i++) { - String qualifiedClassName = (String) interfaces.get(i); - IType interfaceType = javaProj.findType(qualifiedClassName); - IMethod[] methodArray = interfaceType.getMethods(); - // Make sure the method isn't already defined in the heirarchy - for (int j = 0; j < methodArray.length; j++) { - if (isMethodImplementedInHierarchy(methodArray[j], superClassType)) - continue; - String methodStub = getMethodStub(methodArray[j], qualifiedClassName, className); - sb.append(methodStub); - } - } - } - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - // Return method stubs string - return sb.toString(); - } - - /** - * This method is intended for internal use only. Checks to see if the passed type name - * is of a primitive type. This method does not accept null. It will not return null. - * @see Signature#getElementType(java.lang.String) - * - * @param typeName - * @return boolean is type Primitive? - */ - private boolean isPrimitiveType(String typeName) { - char first = Signature.getElementType(typeName).charAt(0); - return (first != Signature.C_RESOLVED && first != Signature.C_UNRESOLVED); - } - - /** - * This method is intended for internal use only. This will add import statements for the specified - * type if it is determined to be necessary. This does accept null parameters. It will not return null. - * @see NewJavaClassOperation#getMethodStub(IMethod, String, String) - * - * @param refTypeSig - * @param declaringType - * @return String type signature - * @throws JavaModelException - */ - private String resolveAndAdd(String refTypeSig, IType declaringType) throws JavaModelException { - if(refTypeSig.indexOf(Signature.C_GENERIC_START, 0) != -1){ - getImportStatements(refTypeSig, declaringType); - } else { - String resolvedTypeName = JavaModelUtil.getResolvedTypeName(refTypeSig, declaringType); - // Could type not be resolved and is import statement missing? - if (resolvedTypeName != null && !importStatements.contains(resolvedTypeName) && !resolvedTypeName.startsWith("java.lang")) { //$NON-NLS-1$ - importStatements.add(resolvedTypeName); - } - } - return Signature.toString(refTypeSig); - } - - private void getImportStatements(String signature, IType declaringType) throws JavaModelException{ - String erasure = Signature.getTypeErasure(signature); - String resolvedTypeName = JavaModelUtil.getResolvedTypeName(erasure, declaringType); - if (resolvedTypeName != null && !importStatements.contains(resolvedTypeName) && !resolvedTypeName.startsWith("java.lang")) { //$NON-NLS-1$ - importStatements.add(resolvedTypeName); - } - String [] params = Signature.getTypeArguments(signature); - for(int i=0;i<params.length; i++){ - getImportStatements(params[i], declaringType); - } - } - - /** - * This method is intended for internal use only. This will use the predefined tokens to generate the - * actual method stubs. This method does not accept null parameters. It will not return null. - * - * @param method - * @param superClassName - * @param className - * @return String method stub - */ - private String getMethodStub(IMethod method, String superClassName, String className) { - StringBuffer sb = new StringBuffer(); - try { - IType parentType = method.getDeclaringType(); - String name = method.getElementName(); - String[] paramTypes = method.getParameterTypes(); - String[] paramNames = method.getParameterNames(); - String[] exceptionTypes = method.getExceptionTypes(); - - // Parameters String - String paramString = EMPTY_STRING; - int nP = paramTypes.length; - for (int i = 0; i < nP; i++) { - String type = paramTypes[i]; - // update import statements - if (!isPrimitiveType(type)) { - type = resolveAndAdd(type, parentType); - } else { - type = Signature.toString(type); - } - - int index = type.lastIndexOf(DOT); - if (index != -1) - type = type.substring(index + 1); - paramString += type + SPACE + paramNames[i]; - if (i < nP - 1) - paramString += COMMA + SPACE; - } - // Java doc - sb.append("\t/* (non-Java-doc)"); //$NON-NLS-1$ - sb.append(lineSeparator); - sb.append("\t * @see "); //$NON-NLS-1$ - sb.append(superClassName + POUND + name + OPEN_PAR); - sb.append(paramString); - sb.append(CLOSE_PAR); - sb.append(lineSeparator); - sb.append("\t */"); //$NON-NLS-1$ - sb.append(lineSeparator); - // access - sb.append(TAB); - if (Flags.isPublic(method.getFlags())) - sb.append(PUBLIC); - else if (Flags.isProtected(method.getFlags())) - sb.append(PROTECTED); - else if (Flags.isPrivate(method.getFlags())) - sb.append(PRIVATE); - String returnType = null; - if (method.isConstructor()) { - sb.append(className); - } else { - // return type - returnType = method.getReturnType(); - if (!isPrimitiveType(returnType)) { - returnType = resolveAndAdd(returnType, parentType); - } else { - returnType = Signature.toString(returnType); - } - int idx = returnType.lastIndexOf(DOT); - if (idx == -1) - sb.append(returnType); - else - sb.append(returnType.substring(idx + 1)); - sb.append(SPACE); - // name - sb.append(name); - } - // Parameters - sb.append(OPEN_PAR + paramString + CLOSE_PAR); - // exceptions - int nE = exceptionTypes.length; - if (nE > 0) { - sb.append(SPACE + THROWS); - for (int i = 0; i < nE; i++) { - String type = exceptionTypes[i]; - if (!isPrimitiveType(type)) { - type = resolveAndAdd(type, parentType); - } else { - type = Signature.toString(type); - } - int index = type.lastIndexOf(DOT); - if (index != -1) - type = type.substring(index + 1); - sb.append(type); - if (i < nE - 1) - sb.append(COMMA + SPACE); - } - } - sb.append(SPACE + OPEN_BRA); - sb.append(lineSeparator); - if (method.isConstructor()) { - sb.append(TAB + TAB + SUPER + OPEN_PAR); - for (int i = 0; i < nP; i++) { - sb.append(paramNames[i]); - if (i < nP - 1) - sb.append(COMMA + SPACE); - } - sb.append(CLOSE_PAR + SEMICOLON); - sb.append(lineSeparator); - } else { - String methodBody = getMethodBody(method, returnType); - sb.append(methodBody); - } - sb.append(TAB + CLOSE_BRA); - sb.append(lineSeparator); - sb.append(lineSeparator); - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - return sb.toString(); - } - - /** - * This method is intended for internal use only. It checks to see whether or not the - * method is already implemented in the class heirarchy. - * It does not accept null parameters. It will not return null. - * @see NewJavaClassOperation#getUnimplementedMethodsFromInterfaces(IType, String, IJavaProject) - * - * @param method - * @param superClass - * @return boolean is method already in heirarchy? - */ - private boolean isMethodImplementedInHierarchy(IMethod method, IType superClass) { - boolean ret = false; - IMethod foundMethod = findMethodImplementationInHierarchy(method, superClass); - // if the method exists and the property is set on the data model, then return true - if (foundMethod != null && foundMethod.exists() && !implementImplementedMethod(method)) - ret = true; - return ret; - } - - /** - * This method is intended for internal use only. This will recursively check the supertype heirarchy for - * the passed in method. This will not accept null parameters. It will return null if the method does - * not already exist in the heirarchy. - * @see NewJavaClassOperation#isMethodImplementedInHierarchy(IMethod, IType) - * - * @param method - * @param superClass - * @return IMethod the method from the heirarchy - */ - private IMethod findMethodImplementationInHierarchy(IMethod method, IType superClass) { - IMethod implementedMethod = null; - try { - if (superClass != null && superClass.exists()) { - ITypeHierarchy tH = superClass.newSupertypeHierarchy(new NullProgressMonitor()); - implementedMethod = findMethodImplementationInHierarchy(tH, superClass, method.getElementName(), method.getParameterTypes(), method.isConstructor()); - } - } catch (JavaModelException e) { - //Ignore - } - return implementedMethod; - } - - /** - * This method is intended for internal use only. This will recursively check the supertype heirarchy for - * the passed in method. This will not accept null parameters. It will return null if the method does - * not already exist in the heirarchy. - * @see NewJavaClassOperation#findMethodImplementationInHierarchy(IMethod, IType) - * @see JavaModelUtil#findMethodImplementationInHierarchy(ITypeHierarchy, IType, String, String[], boolean) - * - * @param tH - * @param thisType - * @param methodName - * @param parameterTypes - * @param isConstructor - * @return IMethod - * @throws JavaModelException - */ - private IMethod findMethodImplementationInHierarchy(ITypeHierarchy tH, IType thisType, String methodName, String parameterTypes[], boolean isConstructor) throws JavaModelException { - IMethod found = JavaModelUtil.findMethod(methodName, parameterTypes, isConstructor, thisType); - // If method exists make sure it is not abstract - if (found != null && !Flags.isAbstract(found.getFlags())) { - return found; - } - // Check recursively - return JavaModelUtil.findMethodInHierarchy(tH, thisType, methodName, parameterTypes, isConstructor); - } - - /** - * Subclasses may extend this method to provide their own specific method body definitions. - * The default implementation is to add a todo, and to return the appropriate type. - * This method does not accept null parameters. It will not return null. - * @see NewJavaClassOperation#getMethodStub(IMethod, String, String) - * - * @param method - * @param returnType - * @return String method body - */ - protected String getMethodBody(IMethod method, String returnType) { - // Add a todo comment - String body = TODO_COMMENT; - body += lineSeparator; - // Add the appropriate default return type - if (returnType == null || returnType.equals(VOID)) - return body; - if (returnType.equals(INT)) - body += RETURN_0; - else if (returnType.equals(BOOLEAN)) - body += RETURN_FALSE; - else - body += RETURN_NULL; - body += lineSeparator; - // Return the method body - return body; - } - - /** - * Subclasses may extend this method to provide their own user defined method stubs. The - * default implementation to just return an empty string. This method will not accept - * null parameter. It will not return null. - * @see NewJavaClassOperation#getMethodStubs(String, String) - * - * @param superClassType - * @return String user defined methods - */ - protected String getUserDefinedMethodStubs(IType superClassType) { - return EMPTY_STRING; - } - - /** - * Subclasses may extend this method to provide their own specialized return on which nonimplemented - * methods to implement. This does not accept a null parameter. This will not return null. - * The default implementation is to always return false. - * - * @param method - * @return boolean should implement method? - */ - protected boolean implementImplementedMethod(IMethod method) { - return false; - } - - @Override - public IStatus execute(IProgressMonitor monitor, IAdaptable info) - throws ExecutionException { - // TODO Auto-generated method stub - return doExecute(monitor, info); - } - - public IProject getTargetProject() { - String projectName = model.getStringProperty(IArtifactEditOperationDataModelProperties.PROJECT_NAME); - return ProjectUtilities.getProject(projectName); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/UpdateJavaBuildPathOperation.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/UpdateJavaBuildPathOperation.java deleted file mode 100644 index 8b8df9089..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/operations/UpdateJavaBuildPathOperation.java +++ /dev/null @@ -1,273 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.common.operations; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jface.operation.IRunnableContext; -import org.eclipse.jst.j2ee.application.internal.operations.ClassPathSelection; -import org.eclipse.jst.j2ee.application.internal.operations.ClasspathElement; -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; -import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WFTWrappedException; -import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress; - -/** - * {@link DoNotUseMeThisWillBeDeletedPost15} - * - * @deprecated This should no longer be necessary because of the new EAR & Web Lib classpath - * containers - */ -public class UpdateJavaBuildPathOperation implements IHeadlessRunnableWithProgress { - protected IJavaProject javaProject; - protected ClassPathSelection classPathSelection; - // All the Java build path entries created by the classpath selection - protected Set allClasspathEntries; - protected List allUnselectedClasspathEntries; - - /** - * UpdateJavaBuildPathOperation constructor comment. - */ - public UpdateJavaBuildPathOperation(IJavaProject aJavaProject, ClassPathSelection aClassPathSelection) { - super(); - javaProject = aJavaProject; - classPathSelection = aClassPathSelection; - allClasspathEntries = new HashSet(); - IClasspathEntry[] classpathEntry = aClassPathSelection.getClasspathEntriesForSelected(); - if (classpathEntry != null) - allClasspathEntries.addAll(Arrays.asList(classpathEntry)); - } - - /** - * UpdateJavaBuildPathOperation constructor comment. - */ - public UpdateJavaBuildPathOperation(IJavaProject aJavaProject, ClassPathSelection selected, ClassPathSelection unselected) { - super(); - javaProject = aJavaProject; - classPathSelection = selected; - allClasspathEntries = new HashSet(); - if (selected != null && !selected.getClasspathElements().isEmpty()) - allClasspathEntries.addAll(Arrays.asList(selected.getClasspathEntriesForSelected())); - - allUnselectedClasspathEntries = new ArrayList(); - if (unselected != null && !unselected.getClasspathElements().isEmpty()) - allUnselectedClasspathEntries.addAll(unselected.getClasspathElements()); - } - - public UpdateJavaBuildPathOperation(IJavaProject aJavaProject, ClassPathSelection selected, List unselected) { - super(); - javaProject = aJavaProject; - classPathSelection = selected; - allClasspathEntries = new HashSet(); - if (selected != null && !selected.getClasspathElements().isEmpty()) - allClasspathEntries.addAll(Arrays.asList(selected.getClasspathEntriesForSelected())); - - allUnselectedClasspathEntries = new ArrayList(); - if (unselected != null && !unselected.isEmpty()) - allUnselectedClasspathEntries.addAll(unselected); - } - - protected void ensureClasspathEntryIsExported(List cp, IClasspathEntry entry) { - if (entry.isExported()) - return; - int index = getIndex(cp, entry); - IClasspathEntry newEntry = null; - switch (entry.getEntryKind()) { - case IClasspathEntry.CPE_PROJECT : - newEntry = JavaCore.newProjectEntry(entry.getPath(), true); - break; - case IClasspathEntry.CPE_LIBRARY : - newEntry = JavaCore.newLibraryEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), true); - break; - case IClasspathEntry.CPE_VARIABLE : - newEntry = JavaCore.newVariableEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath()); - default : - break; - } - if (entry != null) - cp.set(index, newEntry); - } - - protected IClasspathEntry ensureElementInList(List cp, ClasspathElement element, IClasspathEntry predecessor) { - IClasspathEntry addedEntry = null; - // The element might have multiple entries in the case of - // the imported_classes.jar file - IClasspathEntry[] cpEntries = element.newClasspathEntries(); - if (cpEntries == null || cpEntries.length == 0) - // indicates an invalid entry - return null; - - int predecessorPos = predecessor == null ? -1 : getIndex(cp, predecessor); - addedEntry = cpEntries[0]; - // Ensure that the first item is in the list, and follows - // the predecessor if specified; preserve existing items in - // the case of source attachments - int pos = getIndex(cp, addedEntry); - if (pos == -1) { - if (predecessorPos == -1) - cp.add(addedEntry); - else - cp.add(predecessorPos + 1, addedEntry); - } else { - addedEntry = (IClasspathEntry) cp.get(pos); - if (pos < predecessorPos) { - cp.remove(addedEntry); - cp.add(predecessorPos, addedEntry); - } - } - ensureClasspathEntryIsExported(cp, addedEntry); - - // Remove and add so we can ensure the proper order; this - // is the case of the imported_classes.jar; we always want it - // directly after the project - for (int i = 1; i < cpEntries.length; i++) { - int index = getIndex(cp, cpEntries[i]); - if (index != -1) { - addedEntry = (IClasspathEntry) cp.get(index); - cp.remove(index); - } else - addedEntry = cpEntries[i]; - pos = getIndex(cp, cpEntries[0]); - cp.add(pos + 1, addedEntry); - } - return addedEntry; - } - - protected int getIndex(List cp, IClasspathEntry entry) { - for (int i = 0; i < cp.size(); i++) { - IClasspathEntry elmt = (IClasspathEntry) cp.get(i); - if (elmt.getPath().equals(entry.getPath())) - return i; - } - return -1; - } - - protected void ensureElementNotInList(List cp, ClasspathElement element) { - IClasspathEntry[] cpEntries = element.newClasspathEntries(); - if (cpEntries == null || cpEntries.length == 0) - return; - for (int i = 0; i < cpEntries.length; i++) { - if (allClasspathEntries.contains(cpEntries[i])) - // This may be included indirectly by a transitive dependency - continue; - int index = getIndex(cp, cpEntries[i]); - if (index != -1) - cp.remove(index); - } - } - - protected void ensureRemoveElementInList(List cp, ClasspathElement element) { - IClasspathEntry[] cpEntries = element.newClasspathEntries(); - if (cpEntries == null || cpEntries.length == 0) - return; - for (int i = 0; i < cpEntries.length; i++) { - if (cp.contains(cpEntries[i])) { - int index = getIndex(cp, cpEntries[i]); - if (index != -1) - cp.remove(index); - } - } - } - - /** - * Runs this operation. Progress should be reported to the given progress monitor. This method - * is usually invoked by an <code>IRunnableContext</code>'s<code>run</code> method, which - * supplies the progress monitor. A request to cancel the operation should be honored and - * acknowledged by throwing <code>InterruptedException</code>. - * - * @param monitor - * the progress monitor to use to display progress and receive requests for - * cancelation - * @exception InvocationTargetException - * if the run method must propagate a checked exception, it should wrap it inside - * an <code>InvocationTargetException</code>; runtime exceptions are - * automatically wrapped in an <code>InvocationTargetException</code> by the - * calling context - * @exception InterruptedException - * if the operation detects a request to cancel, using - * <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing - * <code>InterruptedException</code> - * - * @see IRunnableContext#run - */ - public void run(org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.reflect.InvocationTargetException, InterruptedException { - try { - String[] prevRequiredProjects = javaProject.getRequiredProjectNames(); - List cp = new ArrayList(Arrays.asList(javaProject.getRawClasspath())); - List classpathElements = classPathSelection.getClasspathElements(); - IClasspathEntry predecessor = null; - IClasspathEntry result = null; - for (int i = 0; i < classpathElements.size(); i++) { - ClasspathElement element = (ClasspathElement) classpathElements.get(i); - if (element.isSelected()) { - result = ensureElementInList(cp, element, predecessor); - if (result != null) - predecessor = result; - } else - ensureElementNotInList(cp, element); - } - filterUnselectedEntries(cp); - IClasspathEntry[] newCp = ((IClasspathEntry[]) cp.toArray(new IClasspathEntry[cp.size()])); - javaProject.setRawClasspath(newCp, monitor); - updateRequiredProjects(javaProject, prevRequiredProjects, new SubProgressMonitor(monitor, 1)); - } catch (Exception ex) { - throw new WFTWrappedException(ex); - } - } - - private void filterUnselectedEntries(List cp) { - if (allUnselectedClasspathEntries != null) { - for (int i = 0; i < allUnselectedClasspathEntries.size(); i++) { - ClasspathElement element = (ClasspathElement) allUnselectedClasspathEntries.get(i); - ensureRemoveElementInList(cp, element); - } - } - } - - protected void updateRequiredProjects(IJavaProject jproject, String[] prevRequiredProjects, IProgressMonitor monitor) throws CoreException { - String[] newRequiredProjects = jproject.getRequiredProjectNames(); - - ArrayList prevEntries = new ArrayList(Arrays.asList(prevRequiredProjects)); - ArrayList newEntries = new ArrayList(Arrays.asList(newRequiredProjects)); - - IProject proj = jproject.getProject(); - IProjectDescription projDesc = proj.getDescription(); - - ArrayList newRefs = new ArrayList(); - IProject[] referencedProjects = projDesc.getReferencedProjects(); - for (int i = 0; i < referencedProjects.length; i++) { - String curr = referencedProjects[i].getName(); - if (newEntries.remove(curr) || !prevEntries.contains(curr)) { - newRefs.add(referencedProjects[i]); - } - } - IWorkspaceRoot root = proj.getWorkspace().getRoot(); - for (int i = 0; i < newEntries.size(); i++) { - String curr = (String) newEntries.get(i); - newRefs.add(root.getProject(curr)); - } - projDesc.setReferencedProjects((IProject[]) newRefs.toArray(new IProject[newRefs.size()])); - proj.setDescription(projDesc, monitor); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/DefaultWSDLServiceHelper.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/DefaultWSDLServiceHelper.java deleted file mode 100644 index 6e449ca54..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/DefaultWSDLServiceHelper.java +++ /dev/null @@ -1,147 +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 - *******************************************************************************/ -/* - * Created on Feb 21, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.webservices; - -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; - -/** - * @author cbridgha - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class DefaultWSDLServiceHelper implements WSDLServiceHelper { - - /** - * - */ - public DefaultWSDLServiceHelper() { - super(); - // TODO Auto-generated constructor stub - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getPortName(java.lang.Object) - */ - public String getPortName(Object port) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getServicePorts(java.lang.Object) - */ - public Map getServicePorts(Object aService) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getServiceNamespaceURI(java.lang.Object) - */ - public String getServiceNamespaceURI(Object aService) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getServiceDefinitionLocation(org.eclipse.emf.ecore.EObject) - */ - public Object getServiceDefinitionLocation(EObject aService) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getPortBindingNamespaceURI(java.lang.Object) - */ - public String getPortBindingNamespaceURI(Object aPort) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getServiceLocalPart(java.lang.Object) - */ - public String getServiceLocalPart(Object aService) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getServiceQName(java.lang.Object) - */ - public Object getServiceQName(Object aService) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getDefinitionServices(java.lang.Object) - */ - public Map getDefinitionServices(Object aDefinition) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getWSDLDefinition(java.lang.String) - */ - public Object getWSDLDefinition(String wsdlURL) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getWSDLDefinition(org.eclipse.emf.ecore.resource.Resource) - */ - public Object getWSDLDefinition(Resource wsdlResource) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper#getWsdlServicesFromWsilFile(org.eclipse.core.resources.IFile) - */ - public List getWsdlServicesFromWsilFile(IFile wsil) { - // TODO Auto-generated method stub - return null; - } - - public boolean isService(Object aService) { - // TODO Auto-generated method stub - return false; - } - public boolean isWSDLResource(Object aResource) { - // TODO Auto-generated method stub - return false; - } - public boolean isDefinition(Object aDefinition) { - // TODO Auto-generated method stub - return false; - } - - public List get13ServiceRefs(EObject j2eeObject) { - // TODO Auto-generated method stub - return null; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceExtManager.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceExtManager.java deleted file mode 100644 index f6b9b00bd..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceExtManager.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.webservices; - -public class WSDLServiceExtManager { - public static WSDLServiceHelper extension; - - public static WSDLServiceHelper getServiceHelper() { - if (extension == null) { - // Initialize the WSDL Service Registry to register extensions into this manager - WSDLServiceExtensionRegistry.getInstance(); - } - return extension; - } - - public static void registerWSDLServiceHelper(WSDLServiceHelper ext) { - extension = ext; - } - - public static void removeWSDLServiceHelper() { - extension = null; - } - - public WSDLServiceExtManager() { - super(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceExtensionRegistry.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceExtensionRegistry.java deleted file mode 100644 index c006c96e5..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceExtensionRegistry.java +++ /dev/null @@ -1,71 +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 - *******************************************************************************/ -/* - * Created on Oct 29, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.webservices; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - -/** - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class WSDLServiceExtensionRegistry extends RegistryReader { - - static final String EXTENSION_NAME = "WSDLServiceHelper"; //$NON-NLS-1$ - static final String ELEMENT_WSDL_HELPER = "wsdlHelper"; //$NON-NLS-1$ - static final String WSDL_HELPER_CLASS = "helperClass"; //$NON-NLS-1$ - private static WSDLServiceExtensionRegistry INSTANCE = null; - - public WSDLServiceExtensionRegistry() { - super(J2EEPlugin.PLUGIN_ID, EXTENSION_NAME); - } - - public static WSDLServiceExtensionRegistry getInstance() { - if (INSTANCE == null) { - INSTANCE = new WSDLServiceExtensionRegistry(); - INSTANCE.readRegistry(); - } - return INSTANCE; - } - - /** - * readElement() - parse and deal w/ an extension like: <earModuleExtension extensionClass = - * "com.ibm.etools.web.plugin.WebModuleExtensionImpl"/> - */ - public boolean readElement(IConfigurationElement element) { - if (!element.getName().equals(ELEMENT_WSDL_HELPER)) - return false; - WSDLServiceHelper extension = null; - try { - extension = (WSDLServiceHelper) element.createExecutableExtension(WSDL_HELPER_CLASS); - } catch (Throwable e) { - //Ignore - } - if (extension != null) - addModuleExtension(extension); - else // Register default do nothing helper...... - addModuleExtension(new DefaultWSDLServiceHelper()); - return true; - } - - - private static void addModuleExtension(WSDLServiceHelper ext) { - WSDLServiceExtManager.registerWSDLServiceHelper(ext); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceHelper.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceHelper.java deleted file mode 100644 index be9521778..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WSDLServiceHelper.java +++ /dev/null @@ -1,51 +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 - *******************************************************************************/ -/* - * Created on Feb 21, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.webservices; - -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; - -/** - * @author cbridgha - * - * This interface is intended to expand the visibility of wsdl api, without a direct dependency - */ -public interface WSDLServiceHelper { - - public static final String WSIL_EXT = "wsil"; //$NON-NLS-1$ - - public String getPortName(Object port); - public Map getServicePorts(Object aService); - public String getServiceNamespaceURI(Object aService); - public Object getServiceDefinitionLocation(EObject aService); - public String getPortBindingNamespaceURI(Object aPort); - public String getServiceLocalPart(Object aService); - public Object getServiceQName(Object aService); - public Map getDefinitionServices(Object aDefinition); - public Object getWSDLDefinition(String wsdlURL); - public Object getWSDLDefinition(Resource wsdlResource); - public List getWsdlServicesFromWsilFile(IFile wsil); - public boolean isService(Object aService); - public boolean isWSDLResource(Object aResource); - public boolean isDefinition(Object aDefinition); - public List get13ServiceRefs(EObject j2eeObject); - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServiceClientGenerator.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServiceClientGenerator.java deleted file mode 100644 index 5797b899e..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServiceClientGenerator.java +++ /dev/null @@ -1,56 +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 - *******************************************************************************/ -/* - * Created on Apr 28, 2004 - */ -package org.eclipse.jst.j2ee.internal.webservices; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.internal.common.J2EECommonMessages; - - -/** - * Extension for generating web service clients - */ -public abstract class WebServiceClientGenerator { - - public static final String GENERIC_J2EE_CONTAINER = J2EECommonMessages.WebServiceClientGenerator_UI_0; - - private List runtime = null; - - /** - * Generates Web service client artifacts based on information obatined from the dataModel - * (wsdlURL, serviceQName, outputWSDLFilePathName, projectName, shouldDeploy) After generating - * the Web service client artifacts, sets the following on the dataModel: serviceInterfaceName, - * serviceEndpointInterfaceName, didGenDescriptors - * - * @return Status for results - */ - public abstract IStatus genWebServiceClientArtifacts(WebServicesClientDataHelper dataModel); - - public void setRuntime(List serverTargets) { - runtime = serverTargets; - } - - public List getServerTargets() { - if (runtime == null) - runtime = new ArrayList(); - return runtime; - } - - public boolean isRuntimeSupported(String serverTargetID) { - return getServerTargets().contains(serverTargetID); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServicesClientDataHelper.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServicesClientDataHelper.java deleted file mode 100644 index 909295edb..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServicesClientDataHelper.java +++ /dev/null @@ -1,78 +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 - *******************************************************************************/ -/* - * Created on Apr 26, 2004 - */ -package org.eclipse.jst.j2ee.internal.webservices; - - -/** - * WebServicesClientDataHelper Interface Extension - For use in generating Web Service Clients by - * sharing data between J2EE operations and web services operations - */ -public interface WebServicesClientDataHelper { - - /** - * @return the URL for the associated original WSDL file referenced by the client - */ - public String getWSDLUrl(); - - /** - * @return the QName of form http://someNamespace:someLocalPart for the associated web service - * for the client - */ - public String getServiceQName(); - - /** - * @return the name of the target project for the web service client - */ - public String getProjectName(); - - /** - * @return the URI for the fileName path for the copied WSDL file into the client project - */ - public String getOutputWSDLFileName(); - - /** - * @return the qualified classname of the generated Service Interface - */ - public String getServiceInterfaceName(); - - /** - * @return the qualified classname of the generated Service Endpoint Interface - */ - public String[] getServiceEndpointInterfaceNames(); - - /** - * @return should generate code for deployment? - */ - public boolean shouldDeploy(); - - /** - * @return whether the extension generated the descriptors or not - */ - public boolean shouldGenDescriptors(); - - /** - * Set the SEI classname for the web service client - */ - public void setServiceInterfaceName(String name); - - /** - * Set the SI classname for the web service client - */ - public void setServiceEndpointInterfaceNames(String[] names); - - /** - * Set whether descriptors were generated - */ - public void setDidGenDescriptors(boolean b); -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServicesClientDataRegistry.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServicesClientDataRegistry.java deleted file mode 100644 index 67160f679..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/webservices/WebServicesClientDataRegistry.java +++ /dev/null @@ -1,86 +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 - *******************************************************************************/ -/* - * Created on Apr 26, 2004 - */ -package org.eclipse.jst.j2ee.internal.webservices; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - -/** - * Read the WebServicesClientDataExtensions - */ -public class WebServicesClientDataRegistry extends RegistryReader { - - private static WebServicesClientDataRegistry INSTANCE = null; - public static final String WS_CLIENT_EXTENSION_POINT = "WebServiceClientGenerator"; //$NON-NLS-1$ - public static final String GENERATOR = "generator"; //$NON-NLS-1$ - public static final String CLASS_NAME = "className"; //$NON-NLS-1$ - public static final String SERVER_TARGET = "serverTarget"; //$NON-NLS-1$ - public static final String RUNTIME = "runtime"; //$NON-NLS-1$ - private List wsClientDataExtensions = null; - - /** - * Default constructor - */ - public WebServicesClientDataRegistry() { - super(J2EEPlugin.PLUGIN_ID, WS_CLIENT_EXTENSION_POINT); - } - - public static WebServicesClientDataRegistry getInstance() { - if (INSTANCE == null) { - INSTANCE = new WebServicesClientDataRegistry(); - INSTANCE.readRegistry(); - } - return INSTANCE; - } - - /** - * @see org.eclipse.wst.common.frameworks.internal.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement) - */ - public boolean readElement(IConfigurationElement element) { - if (!element.getName().equals(GENERATOR)) - return false; - // Get the class specified in the extension point - WebServiceClientGenerator helper = null; - try { - helper = (WebServiceClientGenerator) element.createExecutableExtension(CLASS_NAME); - // get server target runtimes - IConfigurationElement[] runtimes = element.getChildren(RUNTIME); - List runtimeList = new ArrayList(); - for (int i = 0; i < runtimes.length; i++) { - IConfigurationElement runtime = runtimes[i]; - String serverTarget = runtime.getAttribute(SERVER_TARGET); - runtimeList.add(serverTarget); - } - helper.setRuntime(runtimeList); - } catch (Exception e) { - e.printStackTrace(); - } - // Add data helper class to registry extensions list - if (helper != null) { - getWSClientGeneratorExtensions().add(helper); - return true; - } - return false; - } - - public List getWSClientGeneratorExtensions() { - if (wsClientDataExtensions == null) - wsClientDataExtensions = new ArrayList(); - return wsClientDataExtensions; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IEARModelProvider.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IEARModelProvider.java deleted file mode 100644 index d9fbe9ea7..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IEARModelProvider.java +++ /dev/null @@ -1,36 +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.j2ee.model; - - -import org.eclipse.core.resources.IProject; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -/** - * In progress... Simple interface that serves to unify the various model access api's - * - */ -public interface IEARModelProvider extends IModelProvider { - - /** - * This provides a way to get module URIs from the appropriate model context - */ - public String getModuleURI(IVirtualComponent moduleComp); - - /** - * This method will return the context root in this application for the passed in web project. - * - * @param webProject - * @return contextRoot String - */ - public String getWebContextRoot(IProject webProject); - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProvider.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProvider.java deleted file mode 100644 index b588d0d19..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProvider.java +++ /dev/null @@ -1,69 +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.j2ee.model; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; - -/** - * Simple J2EE model registration interface that serves to unify the various model access api's - * - */ -public interface IModelProvider { - - // Flag used to save in memory model when no file exists. - final static IPath FORCESAVE = new Path("FORCE"); //$NON-NLS-1$ - - /** - * This returns the designated "default" model for the given context - * @return Object - */ - Object getModelObject(); - /** - * This returns the model specifically for a given path within the model context, path can also be used - * to designate the source of the model (xml, java annotations, etc..) - * @param modelPath - * @return Object - */ - Object getModelObject(IPath modelPath); - /** - * The modify method should be used during a write operation on the model. - * The model will be properly accessed, saved and released - * Note: All implementors need to ensure all model access using this instance within the runnable block - * Use a cached/consistent view of the model that is being modified - * This method does not support nested writable views, and should return a RuntimeException if this is detected - * @param runnable {@link Runnable} - User specified code that alters the model. - * @param modelPath {@link IPath} - Optional path to specify which model instance will be modified - */ - void modify(Runnable runnable, IPath modelPath); - - /** - * Validate edit for resource state - * - * @param modelPath - Path of resource verifying, or null if default resource. - * @param context - The context object to help display dialogs etc, or null, then IWorkspace.VALIDATE_PROMPT will be used - * @return IStatus - */ - IStatus validateEdit(IPath modelPath, Object context); - - /** - * Add a listener to listen for model changes. - * @param listener - */ - void addListener(IModelProviderListener listener); - - /** - * Remove a listener from the list of model change listeners - * @param listener - */ - void removeListener(IModelProviderListener listener); -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderEvent.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderEvent.java deleted file mode 100644 index 5d82400c8..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderEvent.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.jst.j2ee.model; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.core.resources.IProject; - -public interface IModelProviderEvent { - - // Used when the edit model is saved. - public static final int SAVE = 1; - // Used when the command stack becomes dirty. - public static final int DIRTY = 2; - // Used when a referenced resource is removed from the ResourceSet. - public static final int REMOVED_RESOURCE = 3; - // Used when a referenced resource is added to the ResourceSet. - public static final int ADDED_RESOURCE = 4; - // Used when the edit model is disposed - public static final int PRE_DISPOSE = 5; - // Used when a Resource is loaded or the first object - // is added to the contents when created. - public static final int LOADED_RESOURCE = 6; - // Used when a Resource is unloaded. - public static final int UNLOADED_RESOURCE = 7; - // Indicates that the list of known resources managed by the edit model is about to change - public static final int KNOWN_RESOURCES_ABOUT_TO_CHANGE = 8; - // Indicates that the list of known resources managed by the edit model has changed - public static final int KNOWN_RESOURCES_CHANGED = 9; - - public abstract void addResource(Object aResource); - - public abstract void addResources(Collection<Object> someResources); - - public abstract List<Object> getChangedResources(); - - public abstract IModelProvider getModel(); - - public abstract IProject getProject(); - - public abstract int getEventCode(); - - public abstract void setChangedResources(List<Object> newChangedResources); - - public abstract void setModel(IModelProvider newModel); - - public abstract void setProject(IProject project); - - public abstract void setEventCode(int newEventCode); - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderFactory.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderFactory.java deleted file mode 100644 index 9539fdc1c..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderFactory.java +++ /dev/null @@ -1,34 +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.j2ee.model; - -import org.eclipse.core.resources.IProject; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -/** - * Factory interface for creating IModelProvider instances. - * These factories are registered for a specific model domain/version - * - */ -public interface IModelProviderFactory { - - /** - * @param aProject {@link IProject} - * @return {@link IModelProvider} - */ - IModelProvider create (IProject aProject); - /** - * @param aComponent {@link IVirtualComponent} - * @return {@link IModelProvider} - */ - IModelProvider create (IVirtualComponent aComponent); - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderListener.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderListener.java deleted file mode 100644 index a5b58f2e0..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/IModelProviderListener.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.j2ee.model; - - -public interface IModelProviderListener { - /** - * Tell listeners about model changes - */ - public void modelsChanged(IModelProviderEvent event); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/J2EEModelProviderRegistry.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/J2EEModelProviderRegistry.java deleted file mode 100644 index 2b92311f6..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/J2EEModelProviderRegistry.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed Material - Property of IBM - * (C) Copyright IBM Corp. 2001, 2005 - All Rights Reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure - * restricted by GSA ADP Schedule Contract with IBM Corp. - */ -package org.eclipse.jst.j2ee.model; - -import java.util.StringTokenizer; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -/** - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class J2EEModelProviderRegistry extends RegistryReader { - - static final String EXTENSION_NAME = "J2EEModelProvider"; //$NON-NLS-1$ - static final String ELEMENT_providers = "provider"; //$NON-NLS-1$ - static final String MODEL_PROVIDER = "modelProvider"; //$NON-NLS-1$ - static final String PROVIDER_FACTORY_CLASS = "factoryClass"; //$NON-NLS-1$ - static final String PROVIDER_PRIORITY = "priority"; //$NON-NLS-1$ - static final String PROVIDER_FACET = "facet"; //$NON-NLS-1$ - static final String PROVIDER_FACET_ID = "id"; //$NON-NLS-1$ - static final String PROVIDER_FACET_VERSION = "versions"; //$NON-NLS-1$ - private static J2EEModelProviderRegistry INSTANCE = null; - - public J2EEModelProviderRegistry() { - super(J2EEPlugin.PLUGIN_ID, EXTENSION_NAME); - } - - public static J2EEModelProviderRegistry getInstance() { - if (INSTANCE == null) { - INSTANCE = new J2EEModelProviderRegistry(); - INSTANCE.readRegistry(); - } - return INSTANCE; - } - - - public boolean readElement(IConfigurationElement element) { - String priority = null; - if (!element.getName().equals(ELEMENT_providers)) - return false; - - IModelProviderFactory factory = null; - IConfigurationElement[] mp = element.getChildren(MODEL_PROVIDER); - try { - factory = (IModelProviderFactory) mp[0].createExecutableExtension(PROVIDER_FACTORY_CLASS); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (factory != null) { //Optionally read priority if to override providers for type - priority = mp[0].getAttribute(PROVIDER_PRIORITY); - } - if (factory != null) { - IConfigurationElement[] facet = element.getChildren(PROVIDER_FACET); - String facetId = facet[0].getAttribute(PROVIDER_FACET_ID); - IProjectFacet pv = ProjectFacetsManager.getProjectFacet(facetId); - if (pv == null) { - System.out.println("Unrecognized facet: " + facetId); - return true; // Unrecognized facet - } - String facetVersions = facet[0].getAttribute(PROVIDER_FACET_VERSION); - StringTokenizer tokens = new StringTokenizer(facetVersions,","); - while (tokens.hasMoreElements()) { - String facetversion = (String) tokens.nextElement(); - IProjectFacetVersion fv = pv.getVersion(facetversion); - if (fv != null) - addModelProvider(factory, fv, priority); - } - - - } - return true; - } - - - private static void addModelProvider(IModelProviderFactory provider, IProjectFacetVersion version, String priority) { - // Check priority of existing provider for override - ModelProviderManager.registerProvider(provider,version,priority); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/ModelProviderEvent.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/ModelProviderEvent.java deleted file mode 100644 index 61c8cf697..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/ModelProviderEvent.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.jst.j2ee.model; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.core.resources.IProject; - -public class ModelProviderEvent implements IModelProviderEvent { - - private IModelProvider model; - private IProject proj; - private int event; - - public ModelProviderEvent(int anEventCode, IModelProvider model, IProject proj) { - setEventCode(anEventCode); - setModel(model); - setProject(proj); - } - - public void setProject(IProject project) { - proj = project; - - } - - public void addResource(Object resource) { - // TODO Auto-generated method stub - - } - - public void addResources(Collection<Object> someResources) { - // TODO Auto-generated method stub - - } - - public List<Object> getChangedResources() { - // TODO Auto-generated method stub - return null; - } - - public int getEventCode() { - // TODO Auto-generated method stub - return event; - } - - public IModelProvider getModel() { - - return model; - } - - public void setChangedResources(List<Object> newChangedResources) { - // TODO Auto-generated method stub - - } - - public void setEventCode(int newEventCode) { - event = newEventCode; - - } - - public void setModel(IModelProvider newModel) { - model = newModel; - - } - - public IProject getProject() { - return proj; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/ModelProviderManager.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/ModelProviderManager.java deleted file mode 100644 index 2ddb18dda..000000000 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/model/ModelProviderManager.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Licensed Material - Property of IBM - * (C) Copyright IBM Corp. 2001, 2005 - All Rights Reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure - * restricted by GSA ADP Schedule Contract with IBM Corp. - */ -package org.eclipse.jst.j2ee.model; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.WeakHashMap; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.common.J2EECommonMessages; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.internal.emf.resource.CompatibilityXMIResource; -import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -public class ModelProviderManager { - -public static class ModelProviderKey { - - protected IProjectFacetVersion version; - protected int priority; - - public ModelProviderKey() { - super(); - } - public boolean equals(Object aOther){ - if( this == aOther ) - return true; - - ModelProviderKey otherKey = (ModelProviderKey)aOther; - if( version.equals( otherKey.version) ) - return true; - return false; - } - - public int hashCode() { - return version.hashCode(); - } - } -private static class ResourceSetListener extends AdapterImpl { - /* - * @see Adapter#notifyChanged(new ENotificationImpl((InternalEObject)Notifier, - * int,(EStructuralFeature) EObject, Object, Object, int)) - */ - public void notifyChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - addedResource((Resource) notification.getNewValue()); - break; - case Notification.REMOVE : - removedResource((Resource) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - removedResources((List) notification.getOldValue()); - break; - } - } -} -private static WeakHashMap modelsProviders = new WeakHashMap(); -private static final int DEFAULT_PRIORITY = 100; -private static HashMap providers; -protected static HashMap resourceSetListeners; - - /** - * - * @param - * @param - * @return IModelProvider for the given project of the given version, NULL if no IModelProvider exists for project, version pair - */ - public static IModelProvider getModelProvider(IProject project, IProjectFacetVersion vers) { - - IModelProviderFactory factory = getProvider(vers); - if(factory != null){ - startListeningToResourceSet(project); - return factory.create(project); - } - - String errorMessage = J2EECommonMessages.getResourceString( - J2EECommonMessages.ERR_NO_MODEL_PROVIDER_FOR_PROJECT, new Object[] {project, vers}); - Throwable error = new NullPointerException(errorMessage); - - J2EEPlugin.INSTANCE.getLogger().logError(error); - - return null; - } - - - /** - * - * @param - * @param - * @return IModelProvider for the given component of the given version, NULL if no IModelProvider exists for virtual component/version pair - */ - public static IModelProvider getModelProvider(IVirtualComponent aModule, IProjectFacetVersion vers) { - - IModelProviderFactory factory = getProvider(vers); - if(factory != null){ - IModelProvider mp = factory.create(aModule); - addProvider(mp); - return mp; - } - - String errorMessage = J2EECommonMessages.getResourceString( - J2EECommonMessages.ERR_NO_MODEL_PROVIDER_FOR_PROJECT, new Object[] {aModule, vers}); - Throwable error = new NullPointerException(errorMessage); - - J2EEPlugin.INSTANCE.getLogger().logError(error); - - return null; - } - - - private static void addProvider(IModelProvider mp) { - modelsProviders.put(mp, null); - - } - - /** - * Notify all editModels of the change. - */ - private static void addedResource(Resource addedResource) { - if ((addedResource != null) && (addedResource instanceof CompatibilityXMIResource)) - ((CompatibilityXMIResource) addedResource).setFormat(CompatibilityXMIResource.FORMAT_MOF5); - IProject proj = WorkbenchResourceHelper.getProject(addedResource); - IModelProviderEvent event = new ModelProviderEvent(IModelProviderEvent.ADDED_RESOURCE, null,proj); - event.addResource(addedResource); - notifyModelProviders(event); - - } - /** - * Notify all editModels of the change. - */ - protected static void notifyModelProviders(IModelProviderEvent anEvent) { - if (anEvent == null) - return; - List aList = new ArrayList(); - synchronized (modelsProviders) { - aList.addAll(modelsProviders.keySet()); - } - - for (int i = 0; i < aList.size(); i++) { - IModelProviderListener mod; - mod = (IModelProviderListener) aList.get(i); - try { - mod.modelsChanged(anEvent); - } catch (Exception e) { - Logger.getLogger().logError(e); - } - } - } - - /** - * Notify all editModels of the change. - */ - private static void removedResource(Resource removedResource) { - IProject proj = WorkbenchResourceHelper.getProject(removedResource); - IModelProviderEvent event = new ModelProviderEvent(IModelProviderEvent.REMOVED_RESOURCE, null,proj); - event.addResource(removedResource); - notifyModelProviders(event); - - } - - /** - * Notify all editModels of the change. - */ - private static void removedResources(List removedResources) { - Resource firstRes = (Resource)removedResources.get(0); - IProject proj = WorkbenchResourceHelper.getProject(firstRes); - IModelProviderEvent event = new ModelProviderEvent(IModelProviderEvent.REMOVED_RESOURCE, null,proj); - event.addResources(removedResources); - notifyModelProviders(event); - - } - - - /** - * Used to register an IModelProviderFactory against a facet version - * @param providerFactory - {@link IModelProviderFactory} - * @param v - {@link IProjectFacetVersion} - * @param priority - {@link String}- Used to allow multiple instances, the highest priority is chosen - */ - public static void registerProvider(IModelProviderFactory providerFactory, - IProjectFacetVersion v, String priority) { - - int newPriority = (priority != null) ? Integer.parseInt(priority) : DEFAULT_PRIORITY; - int currentPriority = getProviderPriority(v); - if (newPriority <= currentPriority) { - ModelProviderKey key = createProviderKey(v, newPriority); - providers.put(key, providerFactory); - } - } - - private static IModelProviderFactory getProvider(IProjectFacetVersion v) { - Set<ModelProviderKey> keys = getProviders().keySet(); - for (Iterator iterator = keys.iterator(); iterator.hasNext();) { - ModelProviderKey key = (ModelProviderKey) iterator.next(); - if (key.version.equals(v)) - return (IModelProviderFactory)providers.get(key); - } - return null; - } - private static int getProviderPriority(IProjectFacetVersion v) { - Set<ModelProviderKey> keys = providers.keySet(); - for (Iterator iterator = keys.iterator(); iterator.hasNext();) { - ModelProviderKey key = (ModelProviderKey) iterator.next(); - if (key.version.equals(v)) - return key.priority; - } - return DEFAULT_PRIORITY; - } - protected static Adapter getResourceSetListener(IProject project) { - if (resourceSetListeners == null) - resourceSetListeners = new HashMap(); - Adapter listener = (Adapter)resourceSetListeners.get(project); - if (listener == null) { - listener = new ResourceSetListener(); - resourceSetListeners.put(project, listener); - } - return listener; - } - - private static J2EEModelProviderRegistry registry; - - - private static void initProviders() { - providers = new HashMap(); - registry = J2EEModelProviderRegistry.getInstance(); - - } - private static void startListeningToResourceSet(IProject project) { - ResourceSet set = WorkbenchResourceHelper.getResourceSet(project); - if (set != null) - set.eAdapters().add(getResourceSetListener(project)); - } - private static ModelProviderKey createProviderKey(IProjectFacetVersion fv, int priority) { - ModelProviderKey key = new ModelProviderKey(); - key.priority = priority; - key.version = fv; - return key; - } - - public static IModelProvider getModelProvider(IProject proj) { - IProjectFacetVersion facetVersion = getDefaultFacet(proj); - return getModelProvider(proj, facetVersion); - - } - - public static IModelProvider getModelProvider(IVirtualComponent aModule) { - IProjectFacetVersion facetVersion = getDefaultFacet(aModule); - return getModelProvider(aModule, facetVersion); - } - - private static IProjectFacetVersion getDefaultFacet(IProject proj) { - String type = J2EEProjectUtilities.getJ2EEProjectType(proj); - IProjectFacet facet = ProjectFacetsManager.getProjectFacet(type); - IFacetedProject fp = null; - try { - fp = ProjectFacetsManager.create(proj); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (fp != null && facet != null) { - return fp.getInstalledVersion(facet); - } - return null; - - } - - private static IProjectFacetVersion getDefaultFacet(IVirtualComponent aModule) { - String type = J2EEProjectUtilities.getJ2EEComponentType(aModule); - IProjectFacet facet = ProjectFacetsManager.getProjectFacet(type); - IFacetedProject fp = null; - try { - if (aModule.isBinary()) - { - - } - else - { - fp = ProjectFacetsManager.create(aModule.getProject()); - } - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (fp != null && facet != null) { - return fp.getInstalledVersion(facet); - } - return null; - } - - private static HashMap<ModelProviderKey, IModelProviderFactory> getProviders() { - if (registry == null) - initProviders(); - return providers; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CommonItemProviderAdapter.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CommonItemProviderAdapter.java deleted file mode 100644 index 1b321b06d..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CommonItemProviderAdapter.java +++ /dev/null @@ -1,116 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.Collections; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This extended item provider supports two addition features, (@link CreateChildCommand} and - * {@link CreateChildrenCommand}. These two actions are implemented uniformly on all our item - * adapters using this common base class. - */ -public class CommonItemProviderAdapter extends ItemProviderAdapter { - - /** - * This creates and instance from an adapter factory and a domain notifier. - */ - protected CommonItemProviderAdapter(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This implements the default behavior for {@link CreateChildCommand}. - */ - public Object createChild(Object object) { - return null; - } - - /** - * This creates the default new children for {@link CreateChildrenCommand}. - */ - public Collection createChildren(Object object) { - return Collections.EMPTY_LIST; - } - - /** - * This returns the default image for {@link com.ibm.etools.common.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - Collection localChildrenReferences = getChildrenReferences(object); - if (localChildrenReferences.size() != 1) { - return J2EEPlugin.getPlugin().getImage("create_child");//$NON-NLS-1$ - } - return J2EEPlugin.getPlugin().getImage(refObject.eClass().getName() + "Create" + //$NON-NLS-1$ - ((EReference) localChildrenReferences.iterator().next()).getEType().getName()); - } - - /** - * This returns the default create children label. - */ - public String getCreateChildrenText(Object object) { - //EObject refObject = (EObject)object; - Collection localChildrenReferences = getChildrenReferences(object); - if (localChildrenReferences.size() != 1) { - return CommonEditResourceHandler.getString("Create_Two_Children_UI_"); //$NON-NLS-1$ - } - return CommonEditResourceHandler.getString("21concat", (new Object[]{((EReference) localChildrenReferences.iterator().next()).getEType().getName()})); //$NON-NLS-1$ - } - - /** - * This returns the default create children help text. - */ - public String getCreateChildrenToolTipText(Object object) { - EObject refObject = (EObject) object; - Collection localChildrenReferences = getChildrenReferences(object); - if (localChildrenReferences.size() != 1) { - return CommonEditResourceHandler.getString("19concat_UI_", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ - } - return CommonEditResourceHandler.getString("20concat_UI_", (new Object[]{((EReference) localChildrenReferences.iterator().next()).getEType().getName(), refObject.eClass().getName()})); //$NON-NLS-1$ = "Create two new children of type {0} for the selected {1}." - } - - /** - * This returns the default label for {@link com.ibm.etools.common.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - //EObject refObject = (EObject)object; - Collection localChildrenReferences = getChildrenReferences(object); - if (localChildrenReferences.size() != 1) { - return CommonEditResourceHandler.getString("Create_Child_UI_"); //$NON-NLS-1$ - } - return CommonEditResourceHandler.getString("18concat_UI_", (new Object[]{((EReference) localChildrenReferences.iterator().next()).getEType().getName()})); //$NON-NLS-1$ = "Create {0}" - } - - /** - * This returns the default help text for - * {@link com.ibm.etools.common.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - Collection localChildrenReferences = getChildrenReferences(object); - if (localChildrenReferences.size() != 1) { - return CommonEditResourceHandler.getString("29concat", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a new child for the selected {0}." - } - return CommonEditResourceHandler.getString("16concat_UI_", (new Object[]{((EReference) localChildrenReferences.iterator().next()).getEType().getName(), refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a child of type {0} for the selected {1}." - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CommonItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CommonItemProviderAdapterFactory.java deleted file mode 100644 index 27a6a5e67..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CommonItemProviderAdapterFactory.java +++ /dev/null @@ -1,562 +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.common.internal.provider; - - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.Disposable; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITableItemLabelProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.common.internal.util.CommonAdapterFactory; - - -/** - * This is the factory that is used to provide the interfaces needed to support - * {@link org.eclipse.jface.viewer.ContentViewer}s. The adapters generated by this factory convert - * MOF adapter notificiations into {@link org.eclipse.jface.DomainEvent}s. The adapters also - * support property sheets, see {@link com.ibm.itp.ui.api.propertysheet}. Note that most of the - * adapters are shared among multiple instances. - */ -public class CommonItemProviderAdapterFactory extends CommonAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - /** - * This keeps track of the one adapter used for all {@link com.ibm.etools.common.SecurityRole} - * instances. - */ - protected SecurityRoleItemProvider securityRoleItemProvider; - /** - * This keeps track of the one adapter used for all {@link com.ibm.etools.common.EjbRef} - * instances. - */ - protected EjbRefItemProvider ejbRefItemProvider; - /** - * This keeps track of the one adapter used for all {@link com.ibm.etools.common.ResourceRef} - * instances. - */ - protected ResourceRefItemProvider resourceRefItemProvider; - /** - * This keeps track of the one adapter used for all {@link com.ibm.etools.common.ResourceEnvRef} - * instances. - */ - protected ResourceEnvRefItemProvider resourceEnvRefItemProvider; - /** - * This keeps track of the one adapter used for all {@link com.ibm.etools.common.EnvEntry} - * instances. - */ - //ItemProviders - protected EnvEntryItemProvider envEntryItemProvider; - - protected SecurityIdentityItemProvider securityIdentityItemProvider; - - protected RunAsSpecifiedIdentityItemProvider runAsSpecifiedIdentityItemProvider; - - protected IdentityItemProvider identityItemProvider; - - protected UseCallerIdentityItemProvider useCallerIdentityItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link com.ibm.etools.common.SecurityRoleRef}instances. - */ - protected SecurityRoleRefItemProvider securityRoleRefItemProvider; - protected Disposable disposable = new Disposable(); - - /** - * This constructs an instance. - */ - public CommonItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(ITableItemLabelProvider.class); - } - - public Adapter adapt(Notifier target, Object adapterKey) { - return super.adapt(target, this); - } - - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - public Adapter adaptNew(Notifier target, Object adapterType) { - Adapter adapter = super.adaptNew(target, adapterType); - disposable.add(adapter); - return adapter; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This creates an adapter for a {@link com.ibm.etools.common.EjbRef}. - */ - public Adapter createEjbRefAdapter() { - if (ejbRefItemProvider == null) { - ejbRefItemProvider = new EjbRefItemProvider(this); - } - - return ejbRefItemProvider; - } - - - - /** - * This creates an adapter for a {@link com.ibm.etools.common.UseCallerIdentity}. - */ - public Adapter createUseCallerIdentityAdapter() { - if (useCallerIdentityItemProvider == null) { - useCallerIdentityItemProvider = new UseCallerIdentityItemProvider(this); - } - - return useCallerIdentityItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.Description}instances. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected DescriptionItemProvider descriptionItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.Description}. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - public Adapter createDescriptionAdapter() { - if (descriptionItemProvider == null) { - descriptionItemProvider = new DescriptionItemProvider(this); - } - - return descriptionItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.QName}instances. <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @generated - */ - protected QNameItemProvider qNameItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.common.QName}. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createQNameAdapter() { - if (qNameItemProvider == null) { - qNameItemProvider = new QNameItemProvider(this); - } - - return qNameItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.Listener}instances. <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @generated - */ - protected ListenerItemProvider listenerItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.common.Listener}. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createListenerAdapter() { - if (listenerItemProvider == null) { - listenerItemProvider = new ListenerItemProvider(this); - } - - return listenerItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.CompatibilityDescriptionGroup} - * instances. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected CompatibilityDescriptionGroupItemProvider compatibilityDescriptionGroupItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.CompatibilityDescriptionGroup}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createCompatibilityDescriptionGroupAdapter() { - if (compatibilityDescriptionGroupItemProvider == null) { - compatibilityDescriptionGroupItemProvider = new CompatibilityDescriptionGroupItemProvider(this); - } - - return compatibilityDescriptionGroupItemProvider; - } - - /** - * This creates an adapter for a {@link com.ibm.etools.common.EnvEntry}. - */ - public Adapter createEnvEntryAdapter() { - if (envEntryItemProvider == null) { - envEntryItemProvider = new EnvEntryItemProvider(this); - } - - return envEntryItemProvider; - } - - /** - * This creates an adapter for a {@link com.ibm.etools.common.ResourceRef}. - */ - public Adapter createResourceRefAdapter() { - if (resourceRefItemProvider == null) { - resourceRefItemProvider = new ResourceRefItemProvider(this); - } - - return resourceRefItemProvider; - } - - /** - * This creates an adapter for a {@link com.ibm.etools.common.ResourceEnvRef}. - */ - public Adapter createResourceEnvRefAdapter() { - if (resourceEnvRefItemProvider == null) { - resourceEnvRefItemProvider = new ResourceEnvRefItemProvider(this); - } - - return resourceEnvRefItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.EJBLocalRef}instances. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EJBLocalRefItemProvider ejbLocalRefItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.EJBLocalRef}. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - public Adapter createEJBLocalRefAdapter() { - if (ejbLocalRefItemProvider == null) { - ejbLocalRefItemProvider = new EJBLocalRefItemProvider(this); - } - - return ejbLocalRefItemProvider; - } - - /** - * This creates an adapter for a {@link com.ibm.etools.common.SecurityRole}. - */ - public Adapter createSecurityRoleAdapter() { - if (securityRoleItemProvider == null) { - securityRoleItemProvider = new SecurityRoleItemProvider(this); - } - - return securityRoleItemProvider; - } - - /** - * This creates an adapter for a {@link com.ibm.etools.common.Identity}. - */ - public Adapter createIdentityAdapter() { - if (identityItemProvider == null) { - identityItemProvider = new IdentityItemProvider(this); - } - - return identityItemProvider; - } - - - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.IconType}instances. <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @generated - */ - protected IconTypeItemProvider iconTypeItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.common.IconType}. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createIconTypeAdapter() { - if (iconTypeItemProvider == null) { - iconTypeItemProvider = new IconTypeItemProvider(this); - } - - return iconTypeItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.DisplayName}instances. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected DisplayNameItemProvider displayNameItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.DisplayName}. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - public Adapter createDisplayNameAdapter() { - if (displayNameItemProvider == null) { - displayNameItemProvider = new DisplayNameItemProvider(this); - } - - return displayNameItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.MessageDestinationRef}instances. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected MessageDestinationRefItemProvider messageDestinationRefItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.MessageDestinationRef}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createMessageDestinationRefAdapter() { - if (messageDestinationRefItemProvider == null) { - messageDestinationRefItemProvider = new MessageDestinationRefItemProvider(this); - } - - return messageDestinationRefItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.MessageDestination}instances. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected MessageDestinationItemProvider messageDestinationItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.MessageDestination}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createMessageDestinationAdapter() { - if (messageDestinationItemProvider == null) { - messageDestinationItemProvider = new MessageDestinationItemProvider(this); - } - - return messageDestinationItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.ParamValue}instances. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected ParamValueItemProvider paramValueItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.ParamValue}. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - public Adapter createParamValueAdapter() { - if (paramValueItemProvider == null) { - paramValueItemProvider = new ParamValueItemProvider(this); - } - - return paramValueItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.common.DescriptionGroup}instances. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected DescriptionGroupItemProvider descriptionGroupItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.DescriptionGroup}. <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createDescriptionGroupAdapter() { - if (descriptionGroupItemProvider == null) { - descriptionGroupItemProvider = new DescriptionGroupItemProvider(this); - } - - return descriptionGroupItemProvider; - } - - /** - * This creates an adapter for a {@link com.ibm.etools.common.RunAsSpecifiedIdentity}. - */ - public Adapter createRunAsSpecifiedIdentityAdapter() { - if (runAsSpecifiedIdentityItemProvider == null) { - runAsSpecifiedIdentityItemProvider = new RunAsSpecifiedIdentityItemProvider(this); - } - - return runAsSpecifiedIdentityItemProvider; - } - - public Adapter createSecurityIdentityAdapter() { - if (securityIdentityItemProvider == null) { - securityIdentityItemProvider = new SecurityIdentityItemProvider(this); - } - - return securityIdentityItemProvider; - } - - /** - * This creates an adapter for a {@link com.ibm.etools.common.SecurityRoleRef}. - */ - public Adapter createSecurityRoleRefAdapter() { - if (securityRoleRefItemProvider == null) { - securityRoleRefItemProvider = new SecurityRoleRefItemProvider(this); - } - - return securityRoleRefItemProvider; - } - - public void dispose() { - disposable.dispose(); - } - - /** - * This returns the root adapter factory that contains the factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return (parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory()); - } - - public boolean isFactoryForType(Object type) { - return super.isFactoryForType(type) || supportedTypes.contains(type); - } - - /** - * This removes a listener. - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This sets the composed adapter factory that contains the factory. - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CompatibilityDescriptionGroupItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CompatibilityDescriptionGroupItemProvider.java deleted file mode 100644 index 9158a3a1f..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/CompatibilityDescriptionGroupItemProvider.java +++ /dev/null @@ -1,173 +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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.CompatibilityDescriptionGroup; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.CompatibilityDescriptionGroup}object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class CompatibilityDescriptionGroupItemProvider extends DescriptionGroupItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public CompatibilityDescriptionGroupItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addSmallIconPropertyDescriptor(object); - addLargeIconPropertyDescriptor(object); - addDescriptionPropertyDescriptor(object); - addDisplayNamePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Small Icon feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - protected void addSmallIconPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_CompatibilityDescriptionGroup_smallIcon_feature"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_CompatibilityDescriptionGroup_smallIcon_feature_desc"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getCompatibilityDescriptionGroup_SmallIcon(), false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Large Icon feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - protected void addLargeIconPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_CompatibilityDescriptionGroup_largeIcon_feature"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_CompatibilityDescriptionGroup_largeIcon_feature_desc"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getCompatibilityDescriptionGroup_LargeIcon(), false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_CompatibilityDescriptionGroup_description_feature"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_CompatibilityDescriptionGroup_description_feature_desc"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getCompatibilityDescriptionGroup_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Display Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - protected void addDisplayNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_CompatibilityDescriptionGroup_displayName_feature"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_CompatibilityDescriptionGroup_displayName_feature_desc"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getCompatibilityDescriptionGroup_DisplayName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns CompatibilityDescriptionGroup.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("full/obj16/CompatibilityDescriptionGroup"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((CompatibilityDescriptionGroup) object).getDisplayName(); - return label == null || label.length() == 0 ? getString("_UI_CompatibilityDescriptionGroup_type") : //$NON-NLS-1$ - getString("_UI_CompatibilityDescriptionGroup_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(CompatibilityDescriptionGroup.class)) { - case CommonPackage.COMPATIBILITY_DESCRIPTION_GROUP__SMALL_ICON : - case CommonPackage.COMPATIBILITY_DESCRIPTION_GROUP__LARGE_ICON : - case CommonPackage.COMPATIBILITY_DESCRIPTION_GROUP__DESCRIPTION : - case CommonPackage.COMPATIBILITY_DESCRIPTION_GROUP__DISPLAY_NAME : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DescriptionGroupItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DescriptionGroupItemProvider.java deleted file mode 100644 index b4d292f19..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DescriptionGroupItemProvider.java +++ /dev/null @@ -1,159 +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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.DescriptionGroup; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.DescriptionGroup}object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class DescriptionGroupItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public DescriptionGroupItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - //childrenReferences.add(CommonPackage.eINSTANCE.getDescriptionGroup_Icons()); - //childrenReferences.add(CommonPackage.eINSTANCE.getDescriptionGroup_DisplayNames()); - //childrenReferences.add(CommonPackage.eINSTANCE.getDescriptionGroup_Descriptions()); - } - return childrenReferences; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns DescriptionGroup.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("full/obj16/DescriptionGroup"); //$NON-NLS-1$ - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getDescriptionGroup_Icons(), CommonFactory.eINSTANCE.createIconType())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getDescriptionGroup_DisplayNames(), CommonFactory.eINSTANCE.createDisplayName())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getDescriptionGroup_DisplayNames(), WscommonFactory.eINSTANCE.createDisplayNameType())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getDescriptionGroup_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getDescriptionGroup_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - return getString("_UI_DescriptionGroup_type"); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(DescriptionGroup.class)) { - case CommonPackage.DESCRIPTION_GROUP__ICONS : - case CommonPackage.DESCRIPTION_GROUP__DISPLAY_NAMES : - case CommonPackage.DESCRIPTION_GROUP__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DescriptionItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DescriptionItemProvider.java deleted file mode 100644 index b7f11e222..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DescriptionItemProvider.java +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.Description; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.Description}object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ -public class DescriptionItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public DescriptionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addLangPropertyDescriptor(object); - addValuePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Lang feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLangPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Description_lang_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Description_lang_feature", "_UI_Description_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getDescription_Lang(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Value feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addValuePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Description_value_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Description_value_feature", "_UI_Description_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getDescription_Value(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns Description.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("full/obj16/CompatibilityDescriptionGroup"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - */ - public String getText(Object object) { - String label = ((Description) object).getValue(); - return label == null || label.length() == 0 ? CommonEditResourceHandler.getString("Description_UI_") : //$NON-NLS-1$ - CommonEditResourceHandler.getString("Description_UI_") + ": " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(Description.class)) { - case CommonPackage.DESCRIPTION__LANG : - case CommonPackage.DESCRIPTION__VALUE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DisplayNameItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DisplayNameItemProvider.java deleted file mode 100644 index c1bd1e647..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/DisplayNameItemProvider.java +++ /dev/null @@ -1,146 +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.common.internal.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.DisplayName; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.DisplayName}object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ -public class DisplayNameItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public DisplayNameItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addLangPropertyDescriptor(object); - addValuePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * This adds a property descriptor for the Lang feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLangPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_DisplayName_lang_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_DisplayName_lang_feature", "_UI_DisplayName_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getDisplayName_Lang(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Value feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addValuePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_DisplayName_value_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_DisplayName_value_feature", "_UI_DisplayName_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getDisplayName_Value(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns DisplayName.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("full/obj16/DisplayName"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((DisplayName) object).getLang(); - return label == null || label.length() == 0 ? getString("_UI_DisplayName_type") : //$NON-NLS-1$ - getString("_UI_DisplayName_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(DisplayName.class)) { - case CommonPackage.DISPLAY_NAME__LANG : - case CommonPackage.DISPLAY_NAME__VALUE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EJBLocalRefItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EJBLocalRefItemProvider.java deleted file mode 100644 index 620d8243c..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EJBLocalRefItemProvider.java +++ /dev/null @@ -1,143 +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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.EJBLocalRef; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.EJBLocalRef}object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ -public class EJBLocalRefItemProvider extends EjbRefItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - - - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public EJBLocalRefItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addLocalHomePropertyDescriptor(object); - addLocalPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * This adds a property descriptor for the Local Home feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - */ - protected void addLocalHomePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_EJBLocalRef_localHome_feature"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_EJBLocalRef_localHome_feature_desc"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getEJBLocalRef_LocalHome(), false)); - } - - /** - * This adds a property descriptor for the Local feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - */ - protected void addLocalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_EJBLocalRef_local_feature"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_EJBLocalRef_local_feature_desc"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getEJBLocalRef_Local(), false)); - } - - - /** - * This returns EJBLocalRef.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - */ - public Object getImage(Object object) { - return J2EEPlugin.getDefault().getImage("ejb_local_ref_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - */ - public String getText(Object object) { - String label = ((EJBLocalRef) object).getName(); - return label == null || label.length() == 0 ? CommonEditResourceHandler.getString("_UI_EJBLocalRef_type") : label; //$NON-NLS-1$ - } - - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(EJBLocalRef.class)) { - case CommonPackage.EJB_LOCAL_REF__LOCAL_HOME : - case CommonPackage.EJB_LOCAL_REF__LOCAL : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EjbRefItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EjbRefItemProvider.java deleted file mode 100644 index 05365e781..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EjbRefItemProvider.java +++ /dev/null @@ -1,296 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.EJBLocalRef; -import org.eclipse.jst.j2ee.common.EjbRef; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.EjbRef}object. - */ -public class EjbRefItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public EjbRefItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns ejb_reference.gif. - */ - public Object getImage(Object object) { - String key = ((EjbRef) object).isLocal() ? "ejb_local_ref_obj" : "ejb_reference"; //$NON-NLS-1$ //$NON-NLS-2$ - return J2EEPlugin.getPlugin().getImage(key); - } - - /** - * This returns the parent of the EjbRef. - */ - public Object getParent(Object object) { - return object == null ? null : ((EjbRef) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - - // This is for the name feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Name_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_name_property_UI_"), //$NON-NLS-1$ - pkg.getEjbRef_Name(), true)); - - // This is for the type feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Type_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_type_property_UI_"), //$NON-NLS-1$ - pkg.getEjbRef_Type(), false)); - - // This is for the home feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Home_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_home_property_UI_"), //$NON-NLS-1$ - pkg.getEjbRef_Home(), false)); - - // This is for the remote feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Remote_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_remote_property_UI_"), //$NON-NLS-1$ - pkg.getEjbRef_Remote(), false)); - - // This is for the link feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Link_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_link_property_UI_"), //$NON-NLS-1$ - pkg.getEjbRef_Link(), false)); - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Description_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ - pkg.getEjbRef_Description(), true)); - - // This is for the client feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("Client_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_client_property_UI_"), //$NON-NLS-1$ - * pkg.getEjbRef_Client())); - */ - - // This is for the webApp feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ - * pkg.getEjbRef_WebApp())); - */ - - // This is for the ejb feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), // next four - * lines for 175333 //ResourceHandler.getString("Ejb_UI_"), //$NON-NLS-1$ - * "EJB",//$NON-NLS-1$ //ResourceHandler.getString("The_ejb_property_UI_"), - * //$NON-NLS-1$ ResourceHandler.getString("The_EJB_property_UI_"), //$NON-NLS-1$ = "The - * EJB property" pkg.getEjbRef_Ejb())); - */ - - } - return itemPropertyDescriptors; - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getEjbRef_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getEjbRef_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EjbRef_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EjbRef_name_feature", "_UI_EjbRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEjbRef_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Type feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EjbRef_type_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EjbRef_type_feature", "_UI_EjbRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEjbRef_Type(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Home feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addHomePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EjbRef_home_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EjbRef_home_feature", "_UI_EjbRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEjbRef_Home(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Remote feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addRemotePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EjbRef_remote_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EjbRef_remote_feature", "_UI_EjbRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEjbRef_Remote(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Link feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLinkPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EjbRef_link_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EjbRef_link_feature", "_UI_EjbRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEjbRef_Link(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EjbRef_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EjbRef_description_feature", "_UI_EjbRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEjbRef_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getEjbRef_Descriptions()); - } - return childrenReferences; - } - - - public String getText(Object object) { - if (object instanceof EJBLocalRef) - return "EjbLocalRef " + ((EJBLocalRef) object).getName(); //$NON-NLS-1$ - return "EjbRef " + ((EjbRef) object).getName(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(EjbRef.class)) { - case CommonPackage.EJB_REF__NAME : - case CommonPackage.EJB_REF__TYPE : - case CommonPackage.EJB_REF__HOME : - case CommonPackage.EJB_REF__REMOTE : - case CommonPackage.EJB_REF__LINK : - case CommonPackage.EJB_REF__DESCRIPTION : - case CommonPackage.EJB_REF__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren}to return the empty - * enumeration, and this to check that enumeration, but we know there can't be any children, so - * this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EnvEntryItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EnvEntryItemProvider.java deleted file mode 100644 index 4331c4361..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/EnvEntryItemProvider.java +++ /dev/null @@ -1,244 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.EnvEntry; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.EnvEntry}object. - */ -public class EnvEntryItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public EnvEntryItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns environment_entity.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("environment_entity");//$NON-NLS-1$ - } - - /** - * This returns the parent of the EnvEntry. - */ - public Object getParent(Object object) { - - return object == null ? null : ((EnvEntry) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Description_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ - pkg.getEnvEntry_Description())); - - // This is for the name feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Name_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_name_property_UI_"), //$NON-NLS-1$ - pkg.getEnvEntry_Name())); - - // This is for the value feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Value_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_value_property_UI_"), //$NON-NLS-1$ - pkg.getEnvEntry_Value())); - - // This is for the type feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Type_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_type_property_UI_"), //$NON-NLS-1$ - pkg.getEnvEntry_Type())); - - // This is for the webApp feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ - * pkg.getEnvEntry_WebApp())); - */ - - // This is for the client feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("Client_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_client_property_UI_"), //$NON-NLS-1$ - * pkg.getEnvEntry_Client())); - */ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EnvEntry_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EnvEntry_description_feature", "_UI_EnvEntry_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEnvEntry_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EnvEntry_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EnvEntry_name_feature", "_UI_EnvEntry_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEnvEntry_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Value feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addValuePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EnvEntry_value_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EnvEntry_value_feature", "_UI_EnvEntry_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEnvEntry_Value(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Type feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_EnvEntry_type_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_EnvEntry_type_feature", "_UI_EnvEntry_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getEnvEntry_Type(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getEnvEntry_Descriptions()); - } - return childrenReferences; - } - - - public String getText(Object object) { - return "EnvEntry " + ((EnvEntry) object).getName();//$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(EnvEntry.class)) { - case CommonPackage.ENV_ENTRY__DESCRIPTION : - case CommonPackage.ENV_ENTRY__NAME : - case CommonPackage.ENV_ENTRY__VALUE : - case CommonPackage.ENV_ENTRY__TYPE : - case CommonPackage.ENV_ENTRY__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getEnvEntry_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getEnvEntry_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren}to return the empty - * enumeration, and this to check that enumeration, but we know there can't be any children, so - * this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/IconTypeItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/IconTypeItemProvider.java deleted file mode 100644 index 18a8cd246..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/IconTypeItemProvider.java +++ /dev/null @@ -1,163 +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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.IconType; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.IconType}object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ -public class IconTypeItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public IconTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addSmallIconPropertyDescriptor(object); - addLargeIconPropertyDescriptor(object); - addLangPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Small Icon feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addSmallIconPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_IconType_smallIcon_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_IconType_smallIcon_feature", "_UI_IconType_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getIconType_SmallIcon(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Large Icon feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLargeIconPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_IconType_largeIcon_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_IconType_largeIcon_feature", "_UI_IconType_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getIconType_LargeIcon(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Lang feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLangPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_IconType_lang_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_IconType_lang_feature", "_UI_IconType_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getIconType_Lang(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns IconType.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("full/obj16/IconType"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((IconType) object).getSmallIcon(); - return label == null || label.length() == 0 ? getString("_UI_IconType_type") : //$NON-NLS-1$ - getString("_UI_IconType_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(IconType.class)) { - case CommonPackage.ICON_TYPE__SMALL_ICON : - case CommonPackage.ICON_TYPE__LARGE_ICON : - case CommonPackage.ICON_TYPE__LANG : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/IdentityItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/IdentityItemProvider.java deleted file mode 100644 index a9e139b81..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/IdentityItemProvider.java +++ /dev/null @@ -1,176 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.Identity; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.Identity}object. - */ -public class IdentityItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - */ - public IdentityItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - ; - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), "Description", //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_description_property_of_the_identity_2"), //$NON-NLS-1$ - pkg.getIdentity_Description(), true, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - // This is for the roleName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), "Role Name", //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_role_name_property_of_the_identity_4"), //$NON-NLS-1$ - pkg.getIdentity_RoleName(), true, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Identity_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Identity_description_feature", "_UI_Identity_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getIdentity_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Role Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addRoleNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Identity_roleName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Identity_roleName_feature", "_UI_Identity_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getIdentity_RoleName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getIdentity_Descriptions()); - } - return childrenReferences; - } - - - /** - * This returns the parent of the Identity. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns Identity.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("security_identity_obj");//$NON-NLS-1$ - } - - public String getText(Object object) { - Identity identity = ((Identity) object); - return "Identity " + identity.getRoleName(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(Identity.class)) { - case CommonPackage.IDENTITY__DESCRIPTION : - case CommonPackage.IDENTITY__ROLE_NAME : - case CommonPackage.IDENTITY__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getIdentity_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getIdentity_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/JNDIEnvRefsGroupItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/JNDIEnvRefsGroupItemProvider.java deleted file mode 100644 index 9ac243d48..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/JNDIEnvRefsGroupItemProvider.java +++ /dev/null @@ -1,190 +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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.JNDIEnvRefsGroup; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientFactory; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.JNDIEnvRefsGroup}object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class JNDIEnvRefsGroupItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public JNDIEnvRefsGroupItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EnvironmentProperties()); - childrenReferences.add(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_ResourceRefs()); - childrenReferences.add(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbRefs()); - childrenReferences.add(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_ResourceEnvRefs()); - childrenReferences.add(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbLocalRefs()); - childrenReferences.add(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_MessageDestinationRefs()); - childrenReferences.add(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_ServiceRefs()); - } - return childrenReferences; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns JNDIEnvRefsGroup.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("full/obj16/JNDIEnvRefsGroup"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((JNDIEnvRefsGroup) object).getDisplayName(); - return label == null || label.length() == 0 ? getString("_UI_JNDIEnvRefsGroup_type") : //$NON-NLS-1$ - getString("_UI_JNDIEnvRefsGroup_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(JNDIEnvRefsGroup.class)) { - case CommonPackage.JNDI_ENV_REFS_GROUP__ENVIRONMENT_PROPERTIES : - case CommonPackage.JNDI_ENV_REFS_GROUP__RESOURCE_REFS : - case CommonPackage.JNDI_ENV_REFS_GROUP__EJB_REFS : - case CommonPackage.JNDI_ENV_REFS_GROUP__RESOURCE_ENV_REFS : - case CommonPackage.JNDI_ENV_REFS_GROUP__EJB_LOCAL_REFS : - case CommonPackage.JNDI_ENV_REFS_GROUP__MESSAGE_DESTINATION_REFS : - case CommonPackage.JNDI_ENV_REFS_GROUP__SERVICE_REFS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EnvironmentProperties(), CommonFactory.eINSTANCE.createEnvEntry())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_ResourceRefs(), CommonFactory.eINSTANCE.createResourceRef())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbRefs(), CommonFactory.eINSTANCE.createEjbRef())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbRefs(), CommonFactory.eINSTANCE.createEJBLocalRef())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_ResourceEnvRefs(), CommonFactory.eINSTANCE.createResourceEnvRef())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbLocalRefs(), CommonFactory.eINSTANCE.createEJBLocalRef())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_MessageDestinationRefs(), CommonFactory.eINSTANCE.createMessageDestinationRef())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_ServiceRefs(), Webservice_clientFactory.eINSTANCE.createServiceRef())); - } - - /** - * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public String getCreateChildText(Object owner, Object feature, Object child, Collection selection) { - boolean qualify = feature == CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbRefs() || feature == CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbLocalRefs(); - return getString(qualify ? "_UI_CreateChild_text2" : "_UI_CreateChild_text", //$NON-NLS-1$ //$NON-NLS-2$ - new Object[]{getTypeText(child), getFeatureText(feature), getTypeText(owner)}); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ListenerItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ListenerItemProvider.java deleted file mode 100644 index 86c3d02a7..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ListenerItemProvider.java +++ /dev/null @@ -1,122 +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.common.internal.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.Listener; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webapplication.WebapplicationPackage; - - -public class ListenerItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ListenerItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns Listener.gif - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("listener");//$NON-NLS-1$ - } - - /** - * This returns the webApp of the Listener. - */ - public Object getParent(Object object) { - return WebapplicationPackage.eINSTANCE.getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - CommonPackage wap = CommonPackage.eINSTANCE; - - // This is for the listenerClass feature. - - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), "ListenerClass", CommonEditResourceHandler.getString("The_ListenerClass_property_2"), wap.getListener_ListenerClass(), false)); //$NON-NLS-1$ //$NON-NLS-2$ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Listener Class feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addListenerClassPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Listener_listenerClass_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Listener_listenerClass_feature", "_UI_Listener_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getListener_ListenerClass(), true)); - } - - - public String getText(Object object) { - Listener listener = (Listener) object; - String name = listener.getListenerClassName(); - if (name == null) - name = "<listener>"; //$NON-NLS-1$ - return name; - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/MessageDestinationItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/MessageDestinationItemProvider.java deleted file mode 100644 index c253268f5..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/MessageDestinationItemProvider.java +++ /dev/null @@ -1,133 +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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.MessageDestination; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.MessageDestination}object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class MessageDestinationItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public MessageDestinationItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addNamePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_MessageDestination_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_MessageDestination_name_feature", "_UI_MessageDestination_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getMessageDestination_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns MessageDestination.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("full/obj16/msgdrivendestination_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - */ - public String getText(Object object) { - String md = CommonEditResourceHandler.getString("MessageDestination_UI_"); //$NON-NLS-1$ - String label = ((MessageDestination) object).getName(); - return label == null || label.length() == 0 ? md : md + " " + label; //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(MessageDestination.class)) { - case CommonPackage.MESSAGE_DESTINATION__NAME : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/MessageDestinationRefItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/MessageDestinationRefItemProvider.java deleted file mode 100644 index 76513c5f0..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/MessageDestinationRefItemProvider.java +++ /dev/null @@ -1,197 +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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.MessageDestinationRef; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.MessageDestinationRef}object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class MessageDestinationRefItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public MessageDestinationRefItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addNamePropertyDescriptor(object); - addTypePropertyDescriptor(object); - addUsagePropertyDescriptor(object); - addLinkPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Name feature. - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Name_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_name_property_UI_"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getMessageDestinationRef_Name(), true)); - } - - /** - * This adds a property descriptor for the Type feature. - */ - protected void addTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Type_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_type_property_UI_"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getMessageDestinationRef_Type(), true)); - } - - /** - * This adds a property descriptor for the Usage feature. - */ - protected void addUsagePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Usage_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_usage_property_UI_"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getMessageDestinationRef_Usage(), true)); - } - - /** - * This adds a property descriptor for the Link feature. - */ - protected void addLinkPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Link_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_link_property_UI_"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getMessageDestinationRef_Link(), true)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getMessageDestinationRef_Descriptions()); - } - return childrenReferences; - } - - - /** - * This returns MessageDestinationRef.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("message_bean_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((MessageDestinationRef) object).getName(); - return CommonEditResourceHandler.getString("MessageDestinationRefItemProvider_UI_0") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$, $NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(MessageDestinationRef.class)) { - case CommonPackage.MESSAGE_DESTINATION_REF__NAME : - case CommonPackage.MESSAGE_DESTINATION_REF__TYPE : - case CommonPackage.MESSAGE_DESTINATION_REF__USAGE : - case CommonPackage.MESSAGE_DESTINATION_REF__LINK : - case CommonPackage.MESSAGE_DESTINATION_REF__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getMessageDestinationRef_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getMessageDestinationRef_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.edit.provider.ITreeItemContentProvider#hasChildren(java.lang.Object) - */ - public boolean hasChildren(Object arg0) { - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ParamValueItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ParamValueItemProvider.java deleted file mode 100644 index aa40f4d04..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ParamValueItemProvider.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.ParamValue; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.ParamValue}object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ -public class ParamValueItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ParamValueItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addNamePropertyDescriptor(object); - addValuePropertyDescriptor(object); - addDescriptionPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_ParamValue_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ParamValue_name_feature", "_UI_ParamValue_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getParamValue_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Value feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addValuePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_ParamValue_value_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ParamValue_value_feature", "_UI_ParamValue_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getParamValue_Value(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_ParamValue_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ParamValue_description_feature", "_UI_ParamValue_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getParamValue_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getParamValue_Descriptions()); - } - return childrenReferences; - } - - - /** - * This returns ParamValue.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("initializ_parameter"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((ParamValue) object).getName(); - return label == null || label.length() == 0 ? CommonEditResourceHandler.getString("_UI_ParamValue_type") : //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_ParamValue_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ParamValue.class)) { - case CommonPackage.PARAM_VALUE__NAME : - case CommonPackage.PARAM_VALUE__VALUE : - case CommonPackage.PARAM_VALUE__DESCRIPTION : - case CommonPackage.PARAM_VALUE__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getParamValue_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getParamValue_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/QNameItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/QNameItemProvider.java deleted file mode 100644 index 8c7ec4964..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/QNameItemProvider.java +++ /dev/null @@ -1,176 +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.common.internal.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.QName; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.common.QName}object. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ -public class QNameItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public QNameItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addNamespaceURIPropertyDescriptor(object); - addLocalPartPropertyDescriptor(object); - //addCombinedQNamePropertyDescriptor(object); - //addInternalPrefixOrNsURIPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Namespace URI feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - protected void addNamespaceURIPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_QName_namespaceURI_feature"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_QName_namespaceURI_feature_desc"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getQName_NamespaceURI(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Local Part feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - protected void addLocalPartPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("_UI_QName_localPart_feature"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("_UI_QName_localPart_feature_desc"), //$NON-NLS-1$ - CommonPackage.eINSTANCE.getQName_LocalPart(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Combined QName feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addCombinedQNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_QName_combinedQName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_QName_combinedQName_feature", "_UI_QName_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getQName_CombinedQName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Internal Prefix Or Ns URI feature. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected void addInternalPrefixOrNsURIPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_QName_internalPrefixOrNsURI_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_QName_internalPrefixOrNsURI_feature", "_UI_QName_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getQName_InternalPrefixOrNsURI(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns QName.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - */ - public Object getImage(Object object) { - return getResourceLocator().getImage("qname"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - */ - public String getText(Object object) { - String label = CommonEditResourceHandler.getString("_UI_QName_type"); //$NON-NLS-1$ - if (((QName) object).getNamespaceURI() != null && (((QName) object).getLocalPart() != null)) { - label = CommonEditResourceHandler.getString("_UI_QName_type") + " " + //$NON-NLS-1$ //$NON-NLS-2$ - ((QName) object).getNamespaceURI() + "#" + ((QName) object).getLocalPart(); //$NON-NLS-1$ - } - return label; - - - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(QName.class)) { - case CommonPackage.QNAME__NAMESPACE_URI : - case CommonPackage.QNAME__LOCAL_PART : - case CommonPackage.QNAME__COMBINED_QNAME : - case CommonPackage.QNAME__INTERNAL_PREFIX_OR_NS_URI : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ResourceEnvRefItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ResourceEnvRefItemProvider.java deleted file mode 100644 index b7680b513..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ResourceEnvRefItemProvider.java +++ /dev/null @@ -1,202 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.ResourceEnvRef; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.ResourceRef}object. - */ -public class ResourceEnvRefItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ResourceEnvRefItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns resource_reference.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("res_env_ref_obj"); //$NON-NLS-1$ - } - - /** - * This returns the parent of the ResourceRef. - */ - public Object getParent(Object object) { - return object == null ? null : ((ResourceEnvRef) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Description_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ - pkg.getResourceEnvRef_Description(), true)); - - // This is for the name feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Name_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_name_property_UI_"), //$NON-NLS-1$ - pkg.getResourceEnvRef_Name(), true)); - - // This is for the type feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Type_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_type_property_UI_"), //$NON-NLS-1$ - pkg.getResourceEnvRef_Type(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceEnvRef_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRef_description_feature", "_UI_ResourceEnvRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceEnvRef_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceEnvRef_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRef_name_feature", "_UI_ResourceEnvRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceEnvRef_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Type feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceEnvRef_type_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRef_type_feature", "_UI_ResourceEnvRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceEnvRef_Type(), true)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getResourceEnvRef_Descriptions()); - } - return childrenReferences; - } - - - public String getText(Object object) { - return "ResourceEnvRef " + ((ResourceEnvRef) object).getName(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ResourceEnvRef.class)) { - case CommonPackage.RESOURCE_ENV_REF__DESCRIPTION : - case CommonPackage.RESOURCE_ENV_REF__NAME : - case CommonPackage.RESOURCE_ENV_REF__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getResourceEnvRef_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getResourceEnvRef_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren}to return the empty - * enumeration, and this to check that enumeration, but we know there can't be any children, so - * this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ResourceRefItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ResourceRefItemProvider.java deleted file mode 100644 index 9d564185a..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/ResourceRefItemProvider.java +++ /dev/null @@ -1,281 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.ResourceRef; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - -; - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.ResourceRef}object. - */ -public class ResourceRefItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ResourceRefItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns resource_reference.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("resource_reference"); //$NON-NLS-1$ - } - - /** - * This returns the parent of the ResourceRef. - */ - public Object getParent(Object object) { - return object == null ? null : ((ResourceRef) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - ; - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Description_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ - pkg.getResourceRef_Description())); - - // This is for the name feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Name_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_name_property_UI_"), //$NON-NLS-1$ - pkg.getResourceRef_Name())); - - // This is for the type feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Type_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_type_property_UI_"), //$NON-NLS-1$ - pkg.getResourceRef_Type(), false)); - - // This is for the auth feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Auth_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_auth_property_UI_"), //$NON-NLS-1$ - pkg.getResourceRef_Auth())); - - // This is for the link feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("Link_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_link_property_UI_"), //$NON-NLS-1$ - * pkg.getResourceRef_Link())); - */ - - // This is for the client feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("Client_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_client_property_UI_"), //$NON-NLS-1$ - * pkg.getResourceRef_Client())); - */ - - // This is for the webApp feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ - * pkg.getResourceRef_WebApp())); - */ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceRef_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceRef_description_feature", "_UI_ResourceRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceRef_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceRef_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceRef_name_feature", "_UI_ResourceRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceRef_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Type feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceRef_type_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceRef_type_feature", "_UI_ResourceRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceRef_Type(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Auth feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addAuthPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceRef_auth_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceRef_auth_feature", "_UI_ResourceRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceRef_Auth(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Link feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLinkPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceRef_link_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceRef_link_feature", "_UI_ResourceRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceRef_Link(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Res Sharing Scope feature. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void addResSharingScopePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ResourceRef_resSharingScope_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ResourceRef_resSharingScope_feature", "_UI_ResourceRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getResourceRef_ResSharingScope(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getResourceRef_Descriptions()); - } - return childrenReferences; - } - - - public String getText(Object object) { - return "ResourceRef " + ((ResourceRef) object).getName(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ResourceRef.class)) { - case CommonPackage.RESOURCE_REF__DESCRIPTION : - case CommonPackage.RESOURCE_REF__NAME : - case CommonPackage.RESOURCE_REF__TYPE : - case CommonPackage.RESOURCE_REF__AUTH : - case CommonPackage.RESOURCE_REF__LINK : - case CommonPackage.RESOURCE_REF__RES_SHARING_SCOPE : - case CommonPackage.RESOURCE_REF__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getResourceRef_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getResourceRef_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren}to return the empty - * enumeration, and this to check that enumeration, but we know there can't be any children, so - * this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/RunAsSpecifiedIdentityItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/RunAsSpecifiedIdentityItemProvider.java deleted file mode 100644 index aac1e6f2d..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/RunAsSpecifiedIdentityItemProvider.java +++ /dev/null @@ -1,136 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.RunAsSpecifiedIdentity; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.RunAsSpecifiedIdentity} - * object. - */ -public class RunAsSpecifiedIdentityItemProvider extends SecurityIdentityItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - */ - public RunAsSpecifiedIdentityItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - - // This is for the identity feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), "Identity", //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_identity_of_the_run_as_specified_identity_2"), //$NON-NLS-1$ - pkg.getRunAsSpecifiedIdentity_Identity(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getRunAsSpecifiedIdentity_Identity()); - } - return childrenReferences; - } - - /** - * This returns the parent of the RunAsSpecifiedIdentity. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns RunAsSpecifiedIdentity.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("security_identity_obj");//$NON-NLS-1$ - } - - public String getText(Object object) { - RunAsSpecifiedIdentity runAsSpecifiedIdentity = ((RunAsSpecifiedIdentity) object); - return "RunAsSpecifiedIdentity " + runAsSpecifiedIdentity.getDescription(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(RunAsSpecifiedIdentity.class)) { - case CommonPackage.RUN_AS_SPECIFIED_IDENTITY__IDENTITY : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getRunAsSpecifiedIdentity_Identity(), CommonFactory.eINSTANCE.createIdentity())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityIdentityItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityIdentityItemProvider.java deleted file mode 100644 index 05363da3f..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityIdentityItemProvider.java +++ /dev/null @@ -1,160 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.SecurityIdentity; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - - -; - - - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.SecurityIdentity}object. - */ -public class SecurityIdentityItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - */ - public SecurityIdentityItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - ; - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), "Description", //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_description_property_of_the_security_identity_2"), //$NON-NLS-1$ - pkg.getSecurityIdentity_Description(), true, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_SecurityIdentity_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_SecurityIdentity_description_feature", "_UI_SecurityIdentity_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getSecurityIdentity_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getSecurityIdentity_Descriptions()); - } - return childrenReferences; - } - - - /** - * This returns the parent of the SecurityIdentity. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns SecurityIdentity.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("environment_entity");//$NON-NLS-1$ - } - - public String getText(Object object) { - SecurityIdentity securityIdentity = ((SecurityIdentity) object); - return "SecurityIdentity " + securityIdentity.getDescription(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(SecurityIdentity.class)) { - case CommonPackage.SECURITY_IDENTITY__DESCRIPTION : - case CommonPackage.SECURITY_IDENTITY__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getSecurityIdentity_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getSecurityIdentity_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityRoleItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityRoleItemProvider.java deleted file mode 100644 index c510a5e5b..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityRoleItemProvider.java +++ /dev/null @@ -1,203 +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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.SecurityRole; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.SecurityRole}object. - */ -public class SecurityRoleItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public SecurityRoleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns security_role.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("security_role");//$NON-NLS-1$ - } - - /** - * This returns the parent of the SecurityRole. - */ - public Object getParent(Object object) { - return object == null ? null : ((SecurityRole) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Description_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ - pkg.getSecurityRole_Description())); - - // This is for the roleName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("RoleName_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_roleName_property_UI_"), //$NON-NLS-1$ - pkg.getSecurityRole_RoleName())); - - // This is for the application feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("Application_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_application_property_UI_"), //$NON-NLS-1$ - * pkg.getSecurityRole_Application())); - */ - - // This is for the webApp feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * ResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ - * ResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ - * pkg.getSecurityRole_WebApp())); - */ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_SecurityRole_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_SecurityRole_description_feature", "_UI_SecurityRole_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getSecurityRole_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Role Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addRoleNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_SecurityRole_roleName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_SecurityRole_roleName_feature", "_UI_SecurityRole_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getSecurityRole_RoleName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getSecurityRole_Descriptions()); - } - return childrenReferences; - } - - - public String getText(Object object) { - return " " + ((SecurityRole) object).getRoleName();//$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(SecurityRole.class)) { - case CommonPackage.SECURITY_ROLE__DESCRIPTION : - case CommonPackage.SECURITY_ROLE__ROLE_NAME : - case CommonPackage.SECURITY_ROLE__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getSecurityRole_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getSecurityRole_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren}to return the empty - * enumeration, and this to check that enumeration, but we know there can't be any children, so - * this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityRoleRefItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityRoleRefItemProvider.java deleted file mode 100644 index 0d63afaef..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/SecurityRoleRefItemProvider.java +++ /dev/null @@ -1,201 +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.common.internal.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.SecurityRoleRef; -import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.SecurityRoleRef}object. - */ -public class SecurityRoleRefItemProvider extends CommonItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public SecurityRoleRefItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns security_role_reference.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("security_role_reference");//$NON-NLS-1$ - } - - /** - * This returns the servlet of the SecurityRoleRef. - */ - public Object getParent(Object object) { - return object == null ? null : ((SecurityRoleRef) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - CommonPackage pkg = CommonPackage.eINSTANCE; - - // This is for the name feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Name_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_name_property_UI_"), //$NON-NLS-1$ - pkg.getSecurityRoleRef_Name())); - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Description_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ - pkg.getSecurityRoleRef_Description())); - - // This is for the link feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), CommonEditResourceHandler.getString("Link_UI_"), //$NON-NLS-1$ - CommonEditResourceHandler.getString("The_link_property_UI_"), //$NON-NLS-1$ - pkg.getSecurityRoleRef_Link(), false)); - - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_SecurityRoleRef_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_SecurityRoleRef_name_feature", "_UI_SecurityRoleRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getSecurityRoleRef_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_SecurityRoleRef_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_SecurityRoleRef_description_feature", "_UI_SecurityRoleRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getSecurityRoleRef_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Link feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLinkPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_SecurityRoleRef_link_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_SecurityRoleRef_link_feature", "_UI_SecurityRoleRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CommonPackage.eINSTANCE.getSecurityRoleRef_Link(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(CommonPackage.eINSTANCE.getSecurityRoleRef_Descriptions()); - } - return childrenReferences; - } - - - public String getText(Object object) { - return "SecurityRoleRef " + ((SecurityRoleRef) object).getName();//$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(SecurityRoleRef.class)) { - case CommonPackage.SECURITY_ROLE_REF__NAME : - case CommonPackage.SECURITY_ROLE_REF__DESCRIPTION : - case CommonPackage.SECURITY_ROLE_REF__LINK : - case CommonPackage.SECURITY_ROLE_REF__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getSecurityRoleRef_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(CommonPackage.eINSTANCE.getSecurityRoleRef_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren}to return the empty - * enumeration, and this to check that enumeration, but we know there can't be any children, so - * this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/UseCallerIdentityItemProvider.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/UseCallerIdentityItemProvider.java deleted file mode 100644 index 28ab991a0..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/common/internal/provider/UseCallerIdentityItemProvider.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.common.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.common.UseCallerIdentity; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a {@link com.ibm.etools.common.UseCallerIdentity}object. - */ -public class UseCallerIdentityItemProvider extends SecurityIdentityItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - */ - public UseCallerIdentityItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } - - /** - * This returns the parent of the UseCallerIdentity. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns UseCallerIdentity.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("security_identity_obj");//$NON-NLS-1$ - } - - public String getText(Object object) { - UseCallerIdentity useCallerIdentity = ((UseCallerIdentity) object); - return "UseCallerIdentity " + useCallerIdentity.getDescription(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/CommonEditResourceHandler.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/CommonEditResourceHandler.java deleted file mode 100644 index b2e308bc8..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/CommonEditResourceHandler.java +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.internal.common; - - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class CommonEditResourceHandler { - - private static ResourceBundle fgResourceBundle; - - /** - * Returns the resource bundle used by all classes in this Project - */ - public static ResourceBundle getResourceBundle() { - try { - return ResourceBundle.getBundle("commonedit");//$NON-NLS-1$ - } catch (MissingResourceException e) { - // does nothing - this method will return null and - // getString(String) will return the key - // it was called with - } - return null; - } - - public static String getString(String key) { - if (fgResourceBundle == null) { - fgResourceBundle = getResourceBundle(); - } - - if (fgResourceBundle != null) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - } - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - - public static String getString(String key, Object[] args) { - - try { - return MessageFormat.format(getString(key), args); - } catch (IllegalArgumentException e) { - return getString(key); - } - - } - - public static String getString(String key, Object[] args, int x) { - - return getString(key); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/IJ2EECommonConstants.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/IJ2EECommonConstants.java deleted file mode 100644 index d6e6f4bfd..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/IJ2EECommonConstants.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.internal.common; - - -/** - * @author jialin - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - */ -public interface IJ2EECommonConstants { - - //J2EE Preferences - // J2EE_NAVIGATOR_LINKING_PREFERENCE specifies whether the J2EE Navigator - // selection should be linked to the active editor. - // It is a boolean value, and the default is true. - final static String J2EE_NAVIGATOR_LINKING_PREFERENCE = "org.eclipse.jst.j2ee.internal.internal.ui.preference.j2eeNavigatorLinking"; //$NON-NLS-1$ - final static String J2EE_VERSION_PREFERENCE = "org.eclipse.jst.j2ee.internal.internal.ui.preference.j2eeVersion";//$NON-NLS-1$ - final static String J2EE_VERSION_1_2 = "J2EE_1_2"; //$NON-NLS-1$ - final static String J2EE_VERSION_1_3 = "J2EE_1_3"; //$NON-NLS-1$ - - final static String J2EE_VERSION_PREF_LABEL = CommonEditResourceHandler.getString("Select_the_highest_J2EE_version_that_is_to_be_used__UI_"); //$NON-NLS-1$ - - final static String SAVE_ON_BINARY_PROJECT_TITLE = CommonEditResourceHandler.getString("SAVE_ON_BINARY_PROJECT_TITLE_UI_"); //$NON-NLS-1$ - final static String SAVE_ON_BINARY_PROJECT_MESSAGE = CommonEditResourceHandler.getString("SAVE_ON_BINARY_PROJECT_MESSAGE_UI_"); //$NON-NLS-1$ -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/IStructuredTextEditingDomain.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/IStructuredTextEditingDomain.java deleted file mode 100644 index b2f988240..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/IStructuredTextEditingDomain.java +++ /dev/null @@ -1,43 +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.internal.common; - - - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager; - -/** - * This is a specialized editing domain that can be used by editors that have one or more design - * pages that view a MOF model and a source page that contains an XML Model. - */ -public interface IStructuredTextEditingDomain extends EditingDomain { - /** - * Execute a command within the editing domain. - */ - public void execute(Command command); - - /** - * Execute a command within the editing domain - */ - public void execute(String label, Command command); - - /** - * This returns the adapter factory used by this domain. - */ - public AdapterFactory getAdapterFactory(); - - public IStructuredTextUndoManager getUndoManager(); - - public void setUndoManager(IStructuredTextUndoManager newUndoManager); -} diff --git a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/StructuredTextEditingDomain.java b/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/StructuredTextEditingDomain.java deleted file mode 100644 index ff54dbe1b..000000000 --- a/plugins/org.eclipse.jst.j2ee/commonedit/org/eclipse/jst/j2ee/internal/common/StructuredTextEditingDomain.java +++ /dev/null @@ -1,88 +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.internal.common; - - - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager; - -/** - * This is a specialized editing domain that can be used by editors that have one or more design - * pages that view a MOF model and a source page that contains an XML Model. - */ -public class StructuredTextEditingDomain extends AdapterFactoryEditingDomain implements IStructuredTextEditingDomain { - protected IStructuredTextUndoManager undoManager; - - /** - * StructuredTextEditingDomain constructor comment. - * - * @param adapterFactory - * org.eclipse.emf.common.notify.AdapterFactory - * @param commandStack - * CommandStack - */ - public StructuredTextEditingDomain(AdapterFactory adapterFactory, CommandStack commandStack) { - super(adapterFactory, commandStack); - } - - public StructuredTextEditingDomain(AdapterFactory adapterFactory, CommandStack commandStack, ResourceSet resourceSet) { - super(adapterFactory, commandStack, resourceSet); - } - - /** - * Execute a command within the editing domain. - */ - public void execute(Command command) { - execute(command.getLabel(), command); - } - - /** - * Execute a command within the editing domain. - */ - public void execute(String label, Command command) { - executeViaUndoManager(label, command); - } - - /** - * Execute a command directly on the command stack - */ - public void executeViaStack(Command command) { - getCommandStack().execute(command); - } - - /** - * Execute a command within the editing domain. - */ - public void executeViaUndoManager(String label, Command command) { - if (command.canExecute()) { - if (undoManager != null) { - undoManager.beginRecording(this, label); - command.execute(); - undoManager.endRecording(this); - } else - executeViaStack(command); - } - } - - public IStructuredTextUndoManager getUndoManager() { - return undoManager; - } - - public void setUndoManager(IStructuredTextUndoManager newUndoManager) { - undoManager = newUndoManager; - undoManager.setCommandStack(commandStack); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/component.xml b/plugins/org.eclipse.jst.j2ee/component.xml deleted file mode 100644 index 39d5499b1..000000000 --- a/plugins/org.eclipse.jst.j2ee/component.xml +++ /dev/null @@ -1 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jst.j2ee"><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jst.j2ee" fragment="false"/><plugin id="org.eclipse.jst.j2ee.navigator.ui" fragment="false"/><plugin id="org.eclipse.jst.j2ee.ui" fragment="false"/></component>
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/contenttype/org/eclipse/jst/j2ee/contenttype/J2EEContentDescriber.java b/plugins/org.eclipse.jst.j2ee/contenttype/org/eclipse/jst/j2ee/contenttype/J2EEContentDescriber.java deleted file mode 100644 index 43425a9f8..000000000 --- a/plugins/org.eclipse.jst.j2ee/contenttype/org/eclipse/jst/j2ee/contenttype/J2EEContentDescriber.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.j2ee.contenttype; - -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.core.runtime.content.IContentDescriber; -import org.eclipse.core.runtime.content.IContentDescription; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; - -/** - * A content describer for detecting a j2ee module - */ -public final class J2EEContentDescriber implements IContentDescriber { - public J2EEContentDescriber() { - super(); - } - - public final static QualifiedName JEEVERSION = new QualifiedName("jee-version", "1.4"); //$NON-NLS-1$ - - public int describe(InputStream contents, IContentDescription description) throws IOException { - - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(contents); - switch (quickPeek.getType()) { - case JavaEEQuickPeek.APPLICATION_CLIENT_TYPE: - case JavaEEQuickPeek.APPLICATION_TYPE: - switch (quickPeek.getVersion()) { - case JavaEEQuickPeek.J2EE_1_2_ID: - case JavaEEQuickPeek.J2EE_1_3_ID: - case JavaEEQuickPeek.J2EE_1_4_ID: - return VALID; - } - return INVALID; - case JavaEEQuickPeek.CONNECTOR_TYPE: - switch (quickPeek.getVersion()) { - case JavaEEQuickPeek.JCA_1_0_ID: - case JavaEEQuickPeek.JCA_1_5_ID: - return VALID; - } - return INVALID; - case JavaEEQuickPeek.EJB_TYPE: - switch (quickPeek.getVersion()) { - case JavaEEQuickPeek.EJB_1_1_ID: - case JavaEEQuickPeek.EJB_2_0_ID: - case JavaEEQuickPeek.EJB_2_1_ID: - return VALID; - } - return INVALID; - case JavaEEQuickPeek.WEB_TYPE: - switch (quickPeek.getVersion()) { - case JavaEEQuickPeek.WEB_2_2_ID: - case JavaEEQuickPeek.WEB_2_3_ID: - case JavaEEQuickPeek.WEB_2_4_ID: - return VALID; - } - return INVALID; - } - - return INVALID; - } - - public QualifiedName[] getSupportedOptions() { - // this is not used - return new QualifiedName[] { JEEVERSION }; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/contenttype/org/eclipse/jst/j2ee/contenttype/J2EESpecFinder.java b/plugins/org.eclipse.jst.j2ee/contenttype/org/eclipse/jst/j2ee/contenttype/J2EESpecFinder.java deleted file mode 100644 index 866708f67..000000000 --- a/plugins/org.eclipse.jst.j2ee/contenttype/org/eclipse/jst/j2ee/contenttype/J2EESpecFinder.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.j2ee.contenttype; - -import java.io.InputStream; - -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; - -/** - * @deprecated use {@link JavaEEQuickPeek} - * @author jasholl - * - */ -public class J2EESpecFinder { - - /** - * - * @deprecated use {@link JavaEEQuickPeek} - * - * @param in - * @return - */ - public static String getFastSpecVersion(InputStream in) { - JavaEEQuickPeek qp = new JavaEEQuickPeek(in); - int version = qp.getVersion(); - return J2EEVersionUtil.convertVersionIntToString(version); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationDataModelProvider.java deleted file mode 100644 index 48817a53d..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationDataModelProvider.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.application.internal.operations; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class AddComponentToEnterpriseApplicationDataModelProvider extends CreateReferenceComponentsDataModelProvider implements IAddComponentToEnterpriseApplicationDataModelProperties { - - public AddComponentToEnterpriseApplicationDataModelProvider() { - super(); - } - - public Object getDefaultProperty(String propertyName) { - if (TARGET_COMPONENTS_TO_URI_MAP.equals(propertyName)) { - Map map = new HashMap(); - List components = (List) getProperty(TARGET_COMPONENT_LIST); - for (int i = 0; i < components.size(); i++) { - IVirtualComponent component = (IVirtualComponent) components.get(i); - IProject project = component.getProject(); - String name = component.getName(); - if(name != null) - name = name.replace(' ','_'); - - if (J2EEProjectUtilities.isDynamicWebProject(project)) { - name += IModuleExtensions.DOT_WAR; - } else if (J2EEProjectUtilities.isJCAProject(project)) { - name += IModuleExtensions.DOT_RAR; - } else { - name += IModuleExtensions.DOT_JAR; - } - map.put(component, name); - } - setProperty(propertyName, map); - return map; - } - return super.getDefaultProperty(propertyName); - } - - - public IDataModelOperation getDefaultOperation() { - return new AddComponentToEnterpriseApplicationOp(model); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationOp.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationOp.java deleted file mode 100644 index 3ebddb1b7..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationOp.java +++ /dev/null @@ -1,296 +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.j2ee.application.internal.operations; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jem.util.UIContextDetermination; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IEARModelProvider; -import org.eclipse.jst.j2ee.model.IModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.jst.j2ee.project.facet.EarFacetRuntimeHandler; -import org.eclipse.jst.javaee.application.ApplicationFactory; -import org.eclipse.jst.javaee.application.Module; -import org.eclipse.jst.javaee.application.Web; -import org.eclipse.jst.jee.application.ICommonApplication; -import org.eclipse.jst.jee.application.ICommonModule; -import org.eclipse.swt.widgets.Display; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.ReferencedComponent; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsOp; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -public class AddComponentToEnterpriseApplicationOp extends CreateReferenceComponentsOp { - public static final String metaInfFolderDeployPath = "/"; //$NON-NLS-1$ - - public AddComponentToEnterpriseApplicationOp(IDataModel model) { - super(model); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - if (monitor != null) { - monitor.beginTask("", 3); - } - try { - J2EEComponentClasspathUpdater.getInstance().pauseUpdates(); - IStatus status = validateEditEAR(); - if( status.isOK() ){ - status = super.execute(submon(monitor, 1), info); - if (!status.isOK()) - return Status.CANCEL_STATUS; - updateEARDD(submon(monitor, 1)); - updateModuleRuntimes(submon(monitor, 1)); - } - return status; - } finally { - if (monitor != null) { - monitor.done(); - } - J2EEComponentClasspathUpdater.getInstance().resumeUpdates(); - } - } - - protected String getArchiveName(IVirtualComponent comp) { - boolean useArchiveURI = true; - IFacetedProject facetedProject = null; - try { - facetedProject = ProjectFacetsManager.create(comp.getProject()); - } catch (CoreException e) { - useArchiveURI = false; - } - - if (useArchiveURI && facetedProject != null && ProjectFacetsManager.isProjectFacetDefined(IModuleConstants.JST_UTILITY_MODULE)) { - IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_UTILITY_MODULE); - useArchiveURI = projectFacet != null && facetedProject.hasProjectFacet(projectFacet); - } - if (useArchiveURI) { - return super.getArchiveName(comp); - } - return ""; //$NON-NLS-1$ - } - - protected void updateEARDD(IProgressMonitor monitor) { - - StructureEdit se = null; - try { - IVirtualComponent sourceComp = (IVirtualComponent) model.getProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT); - final IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(sourceComp.getProject()); - - se = StructureEdit.getStructureEditForWrite(sourceComp.getProject()); - if (earModel != null) { - List list = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - final Map map = (Map) model.getProperty(IAddComponentToEnterpriseApplicationDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - StructureEdit compse = null; - final IVirtualComponent wc = (IVirtualComponent) list.get(i); - WorkbenchComponent earwc = se.getComponent(); - try { - compse = StructureEdit.getStructureEditForWrite(wc.getProject()); - WorkbenchComponent refwc = compse.getComponent(); - final ReferencedComponent ref = se.findReferencedComponent(earwc, refwc); - earModel.modify(new Runnable() { - public void run() { - final ICommonApplication application = (ICommonApplication)earModel.getModelObject(); - if(application != null) { - ICommonModule mod = addModule(application, wc, (String) map.get(wc)); - if (ref!=null) - ref.setDependentObject((EObject)mod); - } - } - }, null); - } finally { - if (compse != null) { - compse.saveIfNecessary(monitor); - compse.dispose(); - } - } - } - } - } - se.saveIfNecessary(monitor); - } catch (Exception e) { - Logger.getLogger().logError(e); - } finally { - if (se != null) - se.dispose(); - } - } - - protected ICommonModule createNewModule(IVirtualComponent wc, String name) { - ICommonModule newModule = null; - final IVirtualComponent ear = (IVirtualComponent) this.model.getProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT); - final IProject earpj = ear.getProject(); - boolean useNewModel = J2EEProjectUtilities.getJ2EEDDProjectVersion(earpj).equals(J2EEVersionConstants.VERSION_5_0_TEXT); - if (J2EEProjectUtilities.isDynamicWebProject(wc.getProject())) { - Properties props = wc.getMetaProperties(); - String contextroot = ""; //$NON-NLS-1$ - if ((props != null) && (props.containsKey(J2EEConstants.CONTEXTROOT))) - contextroot = props.getProperty(J2EEConstants.CONTEXTROOT); - if (useNewModel) { - Web web = ApplicationFactory.eINSTANCE.createWeb(); - web.setContextRoot(contextroot); - web.setWebUri(name); - Module webModule = ApplicationFactory.eINSTANCE.createModule(); - webModule.setWeb(web); - newModule = (ICommonModule)webModule; - } - else { - org.eclipse.jst.j2ee.application.WebModule webModule = org.eclipse.jst.j2ee.application.ApplicationFactory.eINSTANCE.createWebModule(); - webModule.setUri(name); - webModule.setContextRoot(contextroot); - newModule = (ICommonModule)webModule; - } - return newModule; - } else if (J2EEProjectUtilities.isEJBProject(wc.getProject())) { - if (useNewModel) { - Module ejbModule = ApplicationFactory.eINSTANCE.createModule(); - ejbModule.setEjb(name); - newModule = (ICommonModule)ejbModule; - } - else { - org.eclipse.jst.j2ee.application.EjbModule ejbModule = org.eclipse.jst.j2ee.application.ApplicationFactory.eINSTANCE.createEjbModule(); - ejbModule.setUri(name); - newModule = (ICommonModule)ejbModule; - } - return newModule; - } else if (J2EEProjectUtilities.isApplicationClientProject(wc.getProject())) { - if (useNewModel) { - Module appClientModule = ApplicationFactory.eINSTANCE.createModule(); - appClientModule.setJava(name); - newModule = (ICommonModule)appClientModule; - } - else { - org.eclipse.jst.j2ee.application.JavaClientModule appClientModule = org.eclipse.jst.j2ee.application.ApplicationFactory.eINSTANCE.createJavaClientModule(); - appClientModule.setUri(name); - newModule = (ICommonModule)appClientModule; - } - return newModule; - } else if (J2EEProjectUtilities.isJCAProject(wc.getProject())) { - if (useNewModel) { - Module j2cModule = ApplicationFactory.eINSTANCE.createModule(); - j2cModule.setConnector(name); - newModule = (ICommonModule)j2cModule; - } - else { - org.eclipse.jst.j2ee.application.ConnectorModule j2cModule = org.eclipse.jst.j2ee.application.ApplicationFactory.eINSTANCE.createConnectorModule(); - j2cModule.setUri(name); - newModule = (ICommonModule)j2cModule; - } - return newModule; - } - return null; - } - - protected ICommonModule addModule(ICommonApplication application, IVirtualComponent wc, String name) { - ICommonApplication dd = application; - ICommonModule existingModule = dd.getFirstEARModule(name); - if (existingModule == null) { - existingModule = createNewModule(wc, name); - if (existingModule != null) { - existingModule.setUri(name); - dd.getEARModules().add(existingModule); - } - } - return existingModule; - } - - private void updateModuleRuntimes(final IProgressMonitor monitor) { - if (monitor != null) { - monitor.beginTask("", 10); - } - - try { - final IVirtualComponent ear = (IVirtualComponent) this.model.getProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT); - - final IProject earpj = ear.getProject(); - - final List moduleComponents = (List) this.model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - - final Set moduleProjects = new HashSet(); - - for (Iterator itr = moduleComponents.iterator(); itr.hasNext();) { - moduleProjects.add(((IVirtualComponent) itr.next()).getProject()); - } - - if (monitor != null) { - monitor.worked(1); - } - - EarFacetRuntimeHandler.updateModuleProjectRuntime(earpj, moduleProjects, submon(monitor, 9)); - } catch (Exception e) { - Logger.getLogger().logError(e); - } finally { - if (monitor != null) { - monitor.done(); - } - } - } - - private static IProgressMonitor submon(final IProgressMonitor parent, final int ticks) { - return (parent == null ? null : new SubProgressMonitor(parent, ticks)); - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - - protected IStatus validateEditEAR() { - IStatus status = OK_STATUS; - IVirtualComponent sourceComp = (IVirtualComponent) model.getProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT); - IProject project = sourceComp.getProject(); - - if (status.isOK()) { - - IModelProvider provider = ModelProviderManager.getModelProvider( project ); - Object context = null; - if( UIContextDetermination.getCurrentContext() == UIContextDetermination.UI_CONTEXT ){ - Display display = Display.getCurrent(); - if(display != null ) - context = display.getActiveShell(); - } - status = provider.validateEdit(null, context); - } - return status; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddWebComponentToEARDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddWebComponentToEARDataModelProvider.java deleted file mode 100644 index 53dec7223..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddWebComponentToEARDataModelProvider.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.util.Set; -import com.ibm.icu.util.StringTokenizer; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.datamodel.properties.IAddWebComponentToEnterpriseApplicationDataModelProperties; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.ProjectSupportResourceHandler; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - - -/** - * - */ -public class AddWebComponentToEARDataModelProvider extends AddComponentToEnterpriseApplicationDataModelProvider implements IAddWebComponentToEnterpriseApplicationDataModelProperties { - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(CONTEXT_ROOT); - return propertyNames; - } - - /** - * - */ - protected String getDefaultURIExtension() { - return "war"; //$NON-NLS-1$ - } - - /** - * - */ - public boolean isWebModuleArchive() { - return true; - } - - /** - * - */ - public boolean propertySet(String propertyName, Object propertyValue) { - boolean notify = super.propertySet(propertyName, propertyValue); - if (notify && propertyName.equals(CONTEXT_ROOT)) - model.notifyPropertyChange(CONTEXT_ROOT, IDataModel.DEFAULT_CHG); - return notify; - } - - /** - * - */ - public Object getDefaultProperty(String propertyName) { - // if (propertyName.equals(CONTEXT_ROOT)) - // return getDefaultContextRoot(); - return super.getDefaultProperty(propertyName); - } - - - /** - * - */ - public IStatus validate(String propertyName) { - if (CONTEXT_ROOT.equals(propertyName)) { - return validateContextRoot(getStringProperty(CONTEXT_ROOT)); - } - return super.validate(propertyName); - } - - /** - * - * @param contextRoot - * @return - */ - public IStatus validateContextRoot(String contextRoot) { - if (contextRoot.equals("") || contextRoot == null) { //$NON-NLS-1$ - return J2EEPlugin.newErrorStatus(ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.Context_Root_cannot_be_empty_2, new Object[]{contextRoot}), null); - } else if (contextRoot.trim().equals(contextRoot)) { - StringTokenizer stok = new StringTokenizer(contextRoot, "."); //$NON-NLS-1$ - while (stok.hasMoreTokens()) { - String token = stok.nextToken(); - for (int i = 0; i < token.length(); i++) { - if (!(token.charAt(i) == '_') && !(token.charAt(i) == '-') && !(token.charAt(i) == '/') && Character.isLetterOrDigit(token.charAt(i)) == false) { - Object[] invalidChar = new Object[]{(new Character(token.charAt(i))).toString()}; - String errorStatus = ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.The_character_is_invalid_in_a_context_root, invalidChar); - return J2EEPlugin.newErrorStatus(errorStatus, null); - } - } - } - } else - return J2EEPlugin.newErrorStatus(ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.Names_cannot_begin_or_end_with_whitespace_5, new Object[]{contextRoot}), null); - return OK_STATUS; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AppClientComponentExportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AppClientComponentExportDataModelProvider.java deleted file mode 100644 index 8b23858d4..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AppClientComponentExportDataModelProvider.java +++ /dev/null @@ -1,71 +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.application.internal.operations; - -import org.eclipse.jst.j2ee.internal.archive.operations.AppClientComponentExportOperation; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - - -public class AppClientComponentExportDataModelProvider extends J2EEComponentExportDataModelProvider { - - public AppClientComponentExportDataModelProvider() { - super(); - } - - public IDataModelOperation getDefaultOperation() { - return new AppClientComponentExportOperation(model); - } - - protected String getModuleExtension() { - return ".jar"; //$NON-NLS-1$ - } - - protected String getWrongComponentTypeString(String projectName) { - return EARCreationResourceHandler.getString(EARCreationResourceHandler.NOT_AN_APP_CLIENT, new Object[]{projectName}); - } - - protected String getProjectType() { - return J2EEProjectUtilities.APPLICATION_CLIENT; - } - /** - * Exports the specified Application Client Module project to the specified Application Client - * Jar file. - * - * @param appClientProjectName - * The name of the Application Client Module project to export. - * @param appClientJarFileName - * The fully qualified Application Client Jar file location to export the specified - * Application Client Module project. - * @param overwriteExisting - * If this is <code>true</code> then an existing file at the location specified by - * <code>earFileName</code> will be overwritten. - * @param exportSource - * If this is <code>true</code> then all source files in the specified Application - * Client Module will be included in the resulting Application Client Jar file. - * @plannedfor WTP 1.0 - */ -// public static void exportProject(String appClientProjectName, String appClientJarFileName, boolean overwriteExisting, boolean exportSource) { -// AppClientModuleExportDataModel dataModel = new AppClientModuleExportDataModel(); -// dataModel.setProperty(PROJECT_NAME, appClientProjectName); -// dataModel.setBooleanProperty(OVERWRITE_EXISTING, overwriteExisting); -// dataModel.setProperty(ARCHIVE_DESTINATION, appClientJarFileName); -// dataModel.setBooleanProperty(EXPORT_SOURCE_FILES, exportSource); -// try { -// dataModel.getDefaultOperation().run(null); -// } catch (InvocationTargetException e) { -// Logger.getLogger().logError(e); -// } catch (InterruptedException e) { -// Logger.getLogger().logError(e); -// } -// } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/BinaryProjectHelper.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/BinaryProjectHelper.java deleted file mode 100644 index f49390988..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/BinaryProjectHelper.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.emf.workbench.WorkbenchByteArrayOutputStream; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; - -public class BinaryProjectHelper { - - public void importArchiveAsBinary(Archive archive, IProject project, IProgressMonitor monitor) { - try { - - IJavaProject javaProject = JavaCore.create(project); - - IFile savedModuleFile = saveFile(archive, project); - saveEnclosedFile(archive, project, ProjectUtilities.DOT_CLASSPATH); - saveEnclosedFile(archive, project, ProjectUtilities.DOT_PROJECT); - removeImportedClassesFromClasspathIfNecessary(project); - - ensureBinary(javaProject, monitor); - IPath path = savedModuleFile.getFullPath(); - - IClasspathEntry newEntry = JavaCore.newLibraryEntry(path, path, null, true); - - IClasspathEntry[] entries = javaProject.getRawClasspath(); - IClasspathEntry[] newEntries = new IClasspathEntry[entries.length + 1]; - System.arraycopy(entries, 0, newEntries, 1, entries.length); - newEntries[0] = newEntry; - javaProject.setRawClasspath(newEntries, monitor); - - } catch (FileNotFoundException e) { - Logger.getLogger().log(e); - } catch (IOException e) { - Logger.getLogger().log(e); - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - } - - /** - * - */ - public static void removeImportedClassesFromClasspathIfNecessary(IProject project) { - IJavaProject javaProj = JavaCore.create(project); - if (javaProj != null) { - IClasspathEntry[] entries = javaProj.readRawClasspath(); - if (entries != null) { - IClasspathEntry entryToRemove = null; - for (int i = 0; i < entries.length; i++) { - if (entries[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY && entries[i].getPath().toString().endsWith("imported_classes") && !project.getFolder("imported_classes").exists()) { - entryToRemove = entries[i]; - break; - } - } - if (null != entryToRemove) { - IClasspathEntry[] newEntries = new IClasspathEntry[entries.length - 1]; - for (int i = 0, j = 0; i < newEntries.length && j < entries.length; j++) { - if (entryToRemove != entries[j]) { - newEntries[i] = entries[j]; - i++; - } - } - entries = newEntries; - IPath output = javaProj.readOutputLocation(); - if (output != null) - try { - javaProj.setRawClasspath(entries, output, null); - } catch (JavaModelException e) { - } - } - - } - } - } - - protected IFile saveFile(File aFile, IProject p) throws IOException { - IFile iFile = p.getFile(aFile.getURI()); - WorkbenchByteArrayOutputStream out = new WorkbenchByteArrayOutputStream(iFile); - ArchiveUtil.copy(aFile.getInputStream(), out); - return iFile; - } - - protected void saveEnclosedFile(Archive anArchive, IProject p, String uri) throws IOException { - try { - File aFile = anArchive.getFile(uri); - saveFile(aFile, p); - } catch (FileNotFoundException ignore) { - } - } - - protected void ensureBinary(IJavaProject javaProject, IProgressMonitor monitor) { - - if (javaProject == null) - return; - List newCp = new ArrayList(); - try { - IClasspathEntry[] entries = javaProject.getRawClasspath(); - for (int i = 0; i < entries.length; i++) { - if (entries[i].getEntryKind() != IClasspathEntry.CPE_SOURCE) - newCp.add(entries[i]); - } - entries = (IClasspathEntry[]) newCp.toArray(new IClasspathEntry[newCp.size()]); - javaProject.setRawClasspath(entries, monitor); - } catch (JavaModelException ex) { - Logger.getLogger().log(ex); - } - } - -} - diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ClassPathSelection.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ClassPathSelection.java deleted file mode 100644 index 2f0013339..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ClassPathSelection.java +++ /dev/null @@ -1,1203 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.application.internal.operations; - - - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -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.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.emf.common.util.URI; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Container; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ManifestException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipFileLoadStrategyImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.internal.archive.operations.ComponentLoadStrategyImpl; -import org.eclipse.jst.j2ee.internal.archive.operations.EARComponentLoadStrategyImpl; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.jst.javaee.ejb.EJBJar; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.UnresolveableURIException; -import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - - - -public class ClassPathSelection { - protected Archive archive; - protected org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest manifest; - protected IVirtualComponent component; - protected IProject earProject; - protected IVirtualComponent earComponent; - protected List classpathElements; - protected Map urisToElements; - protected boolean modified; - private String targetProjectName; - protected Map ejbToClientJARs = null; - protected Map clientToEJBJARs = null; - public static final int FILTER_EJB_SERVER_JARS = 0; - public static final int FILTER_EJB_CLIENT_JARS = 1; - public static final int FILTER_NONE = 2; - - protected int filterLevel = 2; - - protected static Comparator comparator = new Comparator() { - /** - * @see Comparator#compare(Object, Object) - */ - public int compare(Object o1, Object o2) { - int retVal = 0; - if (o1 instanceof Archive) - { - Archive a1 = (Archive) o1; - Archive a2 = (Archive) o2; - retVal = a1.getURI().compareTo(a2.getURI()); - } - else if (o1 instanceof IVirtualReference) - { - IVirtualReference ref1 = (IVirtualReference) o1; - IVirtualReference ref2 = (IVirtualReference) o2; - retVal = ref1.getArchiveName().compareTo(ref2.getArchiveName()); - } - else - { - retVal = o1.toString().compareTo(o2.toString()); - } - return retVal; - } - }; - - public ClassPathSelection(Archive anArchive, String targetProjectName, EARFile earFile) { - super(); - archive = anArchive; - this.targetProjectName = targetProjectName; - initializeEARProject(earFile); - initializeElements(); - } - - /** - * ClassPathSelection constructor comment. - */ - public ClassPathSelection(Archive anArchive, EARFile earFile) { - super(); - archive = anArchive; - initializeEARProject(earFile); - initializeElements(); - } - - /** - * ClassPathSelection constructor comment. - */ - public ClassPathSelection(IVirtualComponent aComponent, IVirtualComponent anEarComponent) { - super(); - component = aComponent; - earComponent = anEarComponent; - earProject = earComponent.getProject(); - initializeElements(); - } - - /** - * ClassPathSelection constructor comment. - */ - public ClassPathSelection() { - super(); - } - - protected ClasspathElement createElement(Archive referencingArchive, Archive referencedArchive, String cpEntry) { - ClasspathElement element = new ClasspathElement(referencingArchive); - element.setValid(true); - - String uriString = referencedArchive.getURI(); - URI uri = URI.createURI(uriString); - - boolean hasAbsolutePath = uri.hasAbsolutePath(); - if( hasAbsolutePath ){ - uriString = uri.lastSegment(); - } - - //element.setText(referencedArchive.getURI()); - element.setText(uriString); - element.setTargetArchive(referencedArchive); - element.setEarProject(earProject); - if( earComponent != null ){ - IContainer earConentFolder = earComponent.getRootFolder().getUnderlyingFolder(); - if( earConentFolder.getType() == IResource.FOLDER ){ - element.setEarContentFolder( earConentFolder.getName()); - }else { - element.setEarContentFolder( "" ); - } - } - - setProjectValues(element, referencedArchive); - if (cpEntry != null) - element.setValuesSelected(cpEntry); - setType(element, referencedArchive); - return element; - } - - protected ClasspathElement createElement(IVirtualComponent referencingArchive, IVirtualReference referencedArchive, String cpEntry) { - ClasspathElement element = new ClasspathElement(referencingArchive); - element.setValid(true); - - String uriString = referencedArchive.getArchiveName(); - - element.setText(uriString); - element.setTargetComponent(referencedArchive.getReferencedComponent()); - element.setEarProject(earProject); - if( earComponent != null ){ - IContainer earConentFolder = earComponent.getRootFolder().getUnderlyingFolder(); - if( earConentFolder.getType() == IResource.FOLDER ){ - element.setEarContentFolder( earConentFolder.getName()); - }else { - element.setEarContentFolder( "" ); - } - } - - setProjectValues(element, referencedArchive); - if (cpEntry != null) - element.setValuesSelected(cpEntry); - setType(element, referencedArchive); - return element; - } - - protected ClasspathElement createInvalidElement(String cpEntry) { - ClasspathElement element = new ClasspathElement(archive); - element.setValid(false); - element.setSelected(true); - element.setRelativeText(cpEntry); - element.setText(cpEntry); - element.setEarProject(earProject); - setInvalidProject(element); - return element; - } - - public ClasspathElement createProjectElement(IProject project) { - ClasspathElement element = new ClasspathElement(project); - element.setValid(true); - element.setSelected(true); - element.setText(project.getName()); - element.setProject(project); - addClasspathElement(element,element.getProjectName()); - return element; - } - - public ClasspathElement createProjectElement(IProject project, boolean existingEntry ) { - ClasspathElement element = new ClasspathElement(project); - element.setValid(true); - element.setSelected(existingEntry); - element.setText(project.getName()); - element.setProject(project); - addClasspathElement(element,element.getProjectName()); - return element; - } - - - public ClasspathElement createArchiveElement(URI uri, String name, String cpEntry) { - ClasspathElement element = new ClasspathElement(uri); - element.setValid(false); - element.setRelativeText(name); - if (cpEntry != null) - element.setValuesSelected(cpEntry); - element.setText(name); - element.setEarProject(earProject); - return element; - } - - public void buildClasspathComponentDependencyMap(final IVirtualComponent comp, final Map pathToComp) { - if (comp != null && comp instanceof J2EEModuleVirtualComponent) { - J2EEModuleVirtualComponent j2eeComp = (J2EEModuleVirtualComponent) comp; - IVirtualReference[] cpRefs = j2eeComp.getJavaClasspathReferences(); - - for (int i = 0; i < cpRefs.length; i++) { - // only ../ mappings supported at this level - if (!cpRefs[i].getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - continue; - } - - final IVirtualComponent referencedComponent = cpRefs[i].getReferencedComponent(); - final IPath path = ClasspathDependencyUtil.getClasspathVirtualReferenceLocation(cpRefs[i]); - final IVirtualComponent existingComp = (IVirtualComponent) pathToComp.get(path); - if (existingComp != null) { - // replace with a temp VirtualArchiveComponent whose IProject is set to a new pseudo name that is - // the concatenation of all project contributions for that archive - if (existingComp instanceof VirtualArchiveComponent) { - final VirtualArchiveComponent oldComp = (VirtualArchiveComponent) existingComp; - final IVirtualComponent newComp = updateDisplayVirtualArchiveComponent(oldComp, cpRefs[i]); - pathToComp.put(path, newComp); - } - } else { - pathToComp.put(path, referencedComponent); - } - } - } - } - - /** - * Create a new VirtualArchiveComponent (used only for display purposes) whose IProject is set to a dummy value whose - * name is a concatentation of the existing name and the name of the project associated with the new ref. - * This is used to represent the case where a single unique archive is referenced/contributed by multiple dependent projects. - */ - public static VirtualArchiveComponent updateDisplayVirtualArchiveComponent(final VirtualArchiveComponent oldComp, final IVirtualReference newRef) { - final String newProjName = oldComp.getProject().getName() + " " + newRef.getReferencedComponent().getProject().getName(); - final IProject newProj = ResourcesPlugin.getWorkspace().getRoot().getProject(newProjName); - final VirtualArchiveComponent newComponent = (VirtualArchiveComponent) ComponentCore.createArchiveComponent(newProj, oldComp.getName()); - return newComponent; - } - - public ClasspathElement[] createClasspathEntryElements(final IVirtualComponent comp, final IPath targetRuntimePath) throws CoreException { - final List elements = new ArrayList(); - if (comp != null && comp.getProject().isAccessible()) { - final IProject project = comp.getProject(); - if (project.hasNature(JavaCore.NATURE_ID)) { - final IJavaProject javaProject = JavaCore.create(project); - final boolean isWebApp = J2EEProjectUtilities.isDynamicWebProject(project); - final Map taggedEntries = ClasspathDependencyUtil.getRawComponentClasspathDependencies(javaProject); - - Iterator i = taggedEntries.keySet().iterator(); - while (i.hasNext()) { - final IClasspathEntry entry = (IClasspathEntry) i.next(); - final IClasspathAttribute attrib = (IClasspathAttribute) taggedEntries.get(entry); - final IPath runtimePath = ClasspathDependencyUtil.getRuntimePath(attrib, isWebApp); - // if runtime path does not match target runtime path, skip - if (runtimePath != null && !runtimePath.equals(targetRuntimePath)) { - continue; - } - final ClasspathElement element = createClasspathElementForEntry(project, entry); - element.setSelected(true); - addClasspathElement(element, element.getArchiveURI().toString()); - } - - final List potentialEntries = ClasspathDependencyUtil.getPotentialComponentClasspathDependencies(javaProject); - i = potentialEntries.iterator(); - while (i.hasNext()) { - final IClasspathEntry entry = (IClasspathEntry) i.next(); - final ClasspathElement element = createClasspathElementForEntry(project, entry); - element.setSelected(false); - addClasspathElement(element, element.getArchiveURI().toString()); - } - } - } - return (ClasspathElement[]) elements.toArray(new ClasspathElement[elements.size()]); - } - - private ClasspathElement createClasspathElementForEntry(final IProject project, final IClasspathEntry entry) { - final IPath entryPath = entry.getPath(); - final URI archiveURI = URI.createURI(entryPath.toString()); - final int kind = entry.getEntryKind(); - String elementName = entryPath.toString(); - if (kind == IClasspathEntry.CPE_CONTAINER) { - try { - final IClasspathContainer container = JavaCore.getClasspathContainer(entryPath, JavaCore.create(project)); - if (container != null) { - elementName = container.getDescription(); - } - } catch (CoreException ce) { - } - } - - ClasspathElement element = createClasspathEntryElement(project, archiveURI, elementName, entry); - return element; - } - - /** - * @param element - */ - private void setInvalidProject(ClasspathElement element) { - IProject earProj = element.getEarProject(); - //IVirtualComponent[] component = ComponentUtilities.getComponent(earProj.getName()); - IVirtualComponent refEarComponent = ComponentUtilities.getComponent(earProj.getName()); - - IVirtualReference[] references = J2EEProjectUtilities.getComponentReferences(refEarComponent); - String moduleName = element.getRelativeText(); - if(moduleName != null) { - IVirtualComponent modComponent = null; - for (int cnt=0; cnt < references.length; cnt++) - { - if (moduleName.equals(references[cnt].getArchiveName())) - { - modComponent = references[cnt].getReferencedComponent(); - } - } - if(modComponent != null) { - IProject mappedProject = modComponent.getProject(); - element.setProject(mappedProject); - } - } - } - - /** - * Insert the method's description here. Creation date: (8/22/2001 1:17:21 PM) - * - * @return java.util.List - */ - public java.util.List getClasspathElements() { - if(classpathElements == null) - classpathElements = new ArrayList(); - return classpathElements; - } - - public java.util.List getSelectedClasspathElements() { - ArrayList list = new ArrayList(); - Iterator it = getClasspathElements().iterator(); - while(it.hasNext()) { - ClasspathElement element = (ClasspathElement)it.next(); - if( element.isSelected() ){ - list.add(element); - } - } - return list; - } - - /** - * Adapter method to convert the manifest class path entries which map to a project to a list of - * classpath entries for a java build path - */ - protected IClasspathEntry[] getClasspathEntries(boolean filterSelected) { - List result = new ArrayList(); - IClasspathEntry[] array = null; - ClasspathElement element = null; - if(classpathElements != null) { - for (int i = 0; i < classpathElements.size(); i++) { - element = (ClasspathElement) classpathElements.get(i); - if (filterSelected && !element.isSelected()) - continue; - array = ((ClasspathElement) classpathElements.get(i)).newClasspathEntries(); - if (array == null) - continue; - for (int j = 0; j < array.length; j++) { - if (!result.contains(array[j])) - result.add(array[j]); - } - } - return (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]); - } - return null; - } - - /** - * Adapter method to convert the manifest class path entries which map to a project to a list of - * classpath entries for a java build path - */ - public IClasspathEntry[] getClasspathEntriesForAll() { - return getClasspathEntries(false); - } - - /** - * Adapter method to convert the manifest class path entries which map to a project to a list of - * classpath entries for a java build path - */ - public IClasspathEntry[] getClasspathEntriesForSelected() { - return getClasspathEntries(true); - } - - protected EARFile getEARFile() { - if (archive == null) - return null; - - Container parent = archive.getContainer(); - if (parent != null && parent.isEARFile()) - return (EARFile) parent; - return null; - } - - protected static IProject getEARProject(Archive anArchive) { - Container c = anArchive.getContainer(); - if (!c.isEARFile()) - return null; - EARFile ear = (EARFile) c; - LoadStrategy loader = ear.getLoadStrategy(); - if (!(loader instanceof EARComponentLoadStrategyImpl)) - return null; - - return ((EARComponentLoadStrategyImpl) loader).getComponent().getProject(); - } - - public Archive getArchive() { - return archive; - } - - protected IProject getProject(Archive anArchive) { - IVirtualComponent comp = getComponent(anArchive); - if (comp != null) { - return comp.getProject(); - } - return null; - } - - protected IVirtualComponent getComponent(Archive anArchive) { - LoadStrategy loader = anArchive.getLoadStrategy(); - if (loader instanceof ComponentLoadStrategyImpl) - return ((ComponentLoadStrategyImpl) loader).getComponent(); - return null; - } - - public String getText() { - return archive.getURI(); - } - - protected Archive getArchive(String uri, List archives) { - for (int i = 0; i < archives.size(); i++) { - Archive anArchive = (Archive) archives.get(i); - - String archiveURIString = anArchive.getURI(); - URI archiveURI = URI.createURI(archiveURIString); - boolean hasAbsolutePath = archiveURI.hasAbsolutePath(); - if( hasAbsolutePath ){ - archiveURIString = archiveURI.lastSegment(); - } - if (archiveURIString.equals(uri)) - return anArchive; - } - return null; - } - - protected IVirtualReference getVirtualReference(String uri, List archives) { - for (int i = 0; i < archives.size(); i++) { - IVirtualReference anArchive = (IVirtualReference) archives.get(i); - - String archiveURIString = anArchive.getArchiveName(); - if (archiveURIString.equals(uri)) - return anArchive; - } - return null; - } - - public static boolean isValidDependency(IVirtualComponent referencedJAR, IVirtualComponent referencingJAR) { - //No other modules should reference wars - if (J2EEProjectUtilities.isDynamicWebComponent(referencedJAR)) - return false; - - if (referencedJAR == referencingJAR) - return false; - - //Clients can reference all but the WARs, which we've already covered - // above; WARs and EJB JARs - //can reference all but WARs, above, or ApplicationClients - return J2EEProjectUtilities.isApplicationClientComponent(referencingJAR) || !J2EEProjectUtilities.isApplicationClientComponent(referencedJAR); - } - - protected void initializeElements() { -// ejbToClientJARs = J2EEProjectUtilities.collectEJBClientJARs(getEARFile()); - ejbToClientJARs = new HashMap(); - IVirtualReference[] references = earComponent.getReferences(); - IVirtualComponent currentComponent = null; - IVirtualComponent clientComponent = null; - Object rootModelObject = null; - IModelProvider modelProvider = null; - String ejbClientJarName = null; - for (int cnt=0; cnt<references.length; cnt++) - { - clientComponent = null; - modelProvider = null; - rootModelObject = null; - ejbClientJarName = null; - currentComponent = references[cnt].getReferencedComponent(); - if (J2EEProjectUtilities.isEJBComponent(currentComponent)) - { - modelProvider = ModelProviderManager.getModelProvider(currentComponent); - rootModelObject = modelProvider.getModelObject(); - if (rootModelObject instanceof EJBJar) - { - ejbClientJarName = ((EJBJar)rootModelObject).getEjbClientJar(); - } - else if (rootModelObject instanceof org.eclipse.jst.j2ee.ejb.EJBJar) - { - ejbClientJarName = ((org.eclipse.jst.j2ee.ejb.EJBJar)rootModelObject).getEjbClientJar(); - } - if (ejbClientJarName != null) - { - clientComponent = J2EEProjectUtilities.getModule(earComponent, ejbClientJarName); - } - if (clientComponent != null) - { - ejbToClientJARs.put(currentComponent, clientComponent); - } - } - } - clientToEJBJARs = reverse(ejbToClientJARs); - classpathElements = new ArrayList(); - urisToElements = new HashMap(); - - String[] cp = new String[0]; - try { -// cp = archive.getManifest().getClassPathTokenized(); - manifest = J2EEProjectUtilities.readManifest(component.getProject()); - cp = manifest.getClassPathTokenized(); - } catch (ManifestException ex) { - Logger.getLogger().logError(ex); - } - String projectUri = earComponent.getReference(component.getName()).getArchiveName(); -// List archives = getEARFile().getArchiveFiles(); - List archives = new ArrayList(Arrays.asList(earComponent.getReferences())); - ClasspathElement element = null; -// Archive other = null; - IVirtualReference other; - for (int i = 0; i < cp.length; i++) { - String cpEntry = cp[i]; - String uri = ArchiveUtil.deriveEARRelativeURI(cpEntry, projectUri); - - other = getVirtualReference(uri, archives); - if (other != null && isValidDependency(other.getReferencedComponent(), component)) { - element = createElement(component, other, cpEntry); - archives.remove(other); - } else { - element = createInvalidElement(cpEntry); - if (element.representsImportedJar()) { - element.setValid(true); - element.setProject(getProject(archive)); - } - if (other != null) - element.setProject(other.getReferencedComponent().getProject()); - - if( other == null ){ - //making a best guess for the project name - if( element.getProject() == null ){ - int index = cpEntry.indexOf(".jar"); //$NON-NLS-1$ - if( index > 0 ){ - String projectName = cpEntry.substring(0, index); - IProject project = ProjectUtilities.getProject( projectName ); - if( project != null && project.exists() ) - element.setProject( project ); - } - } - } - } - addClasspathElement(element, uri); - } - - // Add resolved contributions from tagged classpath entries -// IVirtualComponent comp = getComponent(archive); - - // XXX Don't show resolved contributions from tagged classpath entries on this project's classpath; we should elements corresponding to the raw entries instead - //createClasspathComponentDependencyElements(comp); - - // Add elements for raw classpath entries (either already tagged or potentially taggable) - try { - createClasspathEntryElements(component, IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH); - } catch (CoreException ce) { - Logger.getLogger(J2EEPlugin.PLUGIN_ID).logError(ce); - } - - Collections.sort(archives, comparator); - //Anything that remains in the list of available archives that is valid should be - //available for selection - for (int i = 0; i < archives.size(); i++) { - other = (IVirtualReference) archives.get(i); - - if (other != archive && isValidDependency(other.getReferencedComponent(), component)) { - IProject project = other.getReferencedComponent().getProject(); - if (null == targetProjectName || null == project || !project.getName().equals(targetProjectName)) { - element = createElement(component, other, null); - element.setProject(other.getReferencedComponent().getProject()); - addClasspathElement(element, other.getArchiveName()); - } - } - } - - if( earComponent!= null){ - IVirtualReference[] newrefs = earComponent.getReferences(); - for( int i=0; i < newrefs.length; i++){ - IVirtualReference ref = newrefs[i]; - IVirtualComponent referencedComponent = ref.getReferencedComponent(); - boolean isBinary = referencedComponent.isBinary(); - if( isBinary ){ - - /** - * Warning clean-up 12/05/2005 - */ - //String uri = J2EEProjectUtilities.getResolvedPathForArchiveComponent(referencedComponent.getName()).toString(); - String unresolvedURI = ref.getArchiveName(); - if(unresolvedURI == null){ - try { - unresolvedURI = ModuleURIUtil.getArchiveName(URI.createURI(ModuleURIUtil.getHandleString(referencedComponent))); - } catch (UnresolveableURIException e) { - e.printStackTrace(); - } - } - - if(unresolvedURI != null){ - URI archiveURI = URI.createURI(unresolvedURI); - - boolean alreadyInList = false; - Iterator iter = getClasspathElements().iterator(); - while(iter.hasNext()){ - ClasspathElement tmpelement = (ClasspathElement)iter.next(); - if(unresolvedURI.endsWith(tmpelement.getText())){ - alreadyInList = true; - break; - } - } - - if( !alreadyInList ){ - if( inManifest(cp, archiveURI.lastSegment())){ - element = createArchiveElement(URI.createURI(ModuleURIUtil.getHandleString(referencedComponent)), archiveURI.lastSegment(), archiveURI.lastSegment()); - addClasspathElement(element, unresolvedURI); - }else{ - element = createArchiveElement(URI.createURI(ModuleURIUtil.getHandleString(referencedComponent)), archiveURI.lastSegment(), null); - addClasspathElement(element, unresolvedURI); - } - } - } - } - } - } - } - - public ClasspathElement createClasspathArchiveElement(final IProject project, URI archiveURI, String unresolvedURI) { - final ClasspathElement element = createArchiveElement(archiveURI, archiveURI.lastSegment(), archiveURI.lastSegment()); - element.setProject(project); - element.setClasspathDependency(true); - return element; - } - - public ClasspathElement createClasspathEntryElement(final IProject project, URI archiveURI, String elementName, IClasspathEntry entry) { - final ClasspathElement element = createArchiveElement(archiveURI, elementName, elementName); - element.setProject(project); - element.setClasspathEntry(true, entry); - element.setValid(true); - return element; - } - - boolean inManifest(String[] cp, String archiveName ){ - boolean result = false; - String cpEntry = ""; - for (int i = 0; i < cp.length; i++) { - cpEntry = cp[i]; - if( archiveName.equals(cpEntry)){ - result = true; - } - } - return result; - } - - protected List loadClassPathArchives(){ - /** - * Warning clean-up 12/05/2005 - */ - //LoadStrategy loadStrat = archive.getLoadStrategy(); - - List archives = new ArrayList(); - - if( earComponent!= null){ - IVirtualReference[] newrefs = earComponent.getReferences(); - for( int i=0; i < newrefs.length; i++){ - IVirtualReference ref = newrefs[i]; - IVirtualComponent referencedComponent = ref.getReferencedComponent(); - boolean isBinary = referencedComponent.isBinary(); - - if( isBinary ){ - String uri = J2EEProjectUtilities.getResolvedPathForArchiveComponent(referencedComponent.getName()).toString(); - - try { - ZipFileLoadStrategyImpl strat = createLoadStrategy(uri); - Archive archive = null; - try { - archive = CommonarchiveFactoryImpl.getActiveFactory().primOpenArchive(strat, uri); - } catch (OpenFailureException e) { - // TODO Auto-generated catch block - Logger.getLogger().logError(e); - } - - archives.add(archive); - - } catch (FileNotFoundException e) { - Logger.getLogger().logError(e); - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - - } - } - return archives; - } - - Archive getClassPathArchive(String uri, List archives){ - for (int i = 0; i < archives.size(); i++) { - Archive anArchive = (Archive) archives.get(i); - - String archiveURIString = anArchive.getURI(); - URI archiveURI = URI.createURI(archiveURIString); - boolean hasAbsolutePath = archiveURI.hasAbsolutePath(); - if( hasAbsolutePath ){ - archiveURIString = archiveURI.lastSegment(); - } - if (archiveURIString.equals(uri)) - return anArchive; - } - return null; - } - - boolean isClassPathArchive(String uri, List archives){ - for (int i = 0; i < archives.size(); i++) { - Archive anArchive = (Archive) archives.get(i); - - String archiveURIString = anArchive.getURI(); - URI archiveURI = URI.createURI(archiveURIString); - /** - * Warning clean-up 12/05/2005 - */ - //boolean hasAbsolutePath = archiveURI.hasAbsolutePath(); - if( archiveURI.lastSegment().equals(uri) ){ - return true; - } - } - return false; - } - - public ZipFileLoadStrategyImpl createLoadStrategy(String uri) throws FileNotFoundException, IOException { - String filename = uri.replace('/', java.io.File.separatorChar); - java.io.File file = new java.io.File(filename); - if (!file.exists()) { - throw new FileNotFoundException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.file_not_found_EXC_, (new Object[]{uri, file.getAbsolutePath()}))); // = "URI Name: {0}; File name: {1}" - } - if (file.isDirectory()) { - throw new FileNotFoundException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.file_not_found_EXC_, (new Object[]{uri, file.getAbsolutePath()}))); // = "URI Name: {0}; File name: {1}" - } - return new org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipFileLoadStrategyImpl(file); - } - - - private void initializeEARProject(EARFile earFile) { - LoadStrategy loadStrat = earFile.getLoadStrategy(); - if (loadStrat instanceof EARComponentLoadStrategyImpl){ - earComponent = ((EARComponentLoadStrategyImpl) loadStrat).getComponent(); - earProject = ((EARComponentLoadStrategyImpl) loadStrat).getComponent().getProject(); - } - } - - private void setType(ClasspathElement element, Archive other) { - if (other == null) - return; - else if (clientToEJBJARs.containsKey(other)) - element.setJarType(ClasspathElement.EJB_CLIENT_JAR); - else if (other.isEJBJarFile()) - element.setJarType(ClasspathElement.EJB_JAR); - } - - private void setType(ClasspathElement element, IVirtualReference other) { - if (other == null) - return; - else if (clientToEJBJARs.containsKey(other)) - element.setJarType(ClasspathElement.EJB_CLIENT_JAR); - else if (J2EEProjectUtilities.isEJBComponent(other.getReferencedComponent())) - element.setJarType(ClasspathElement.EJB_JAR); - } - - /** - * @param localejbToClientJARs - * @return - */ - private Map reverse(Map localejbToClientJARs) { - if (localejbToClientJARs == null || localejbToClientJARs.isEmpty()) - return Collections.EMPTY_MAP; - Map result = new HashMap(); - Iterator iter = localejbToClientJARs.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry entry = (Map.Entry) iter.next(); - result.put(entry.getValue(), entry.getKey()); - } - return result; - } - - public void addClasspathElement(ClasspathElement element, String uri) { - getClasspathElements().add(element); - getUrisToElements().put(uri, element); - element.setParentSelection(this); - } - - /** - * Insert the method's description here. Creation date: (8/22/2001 6:05:11 PM) - * - * @return boolean - */ - public boolean isModified() { - return modified; - } - - /** - * Insert the method's description here. Creation date: (8/22/2001 6:05:11 PM) - * - * @param newModified - * boolean - */ - public void setModified(boolean newModified) { - modified = newModified; - } - - protected void setProjectValues(ClasspathElement element, Archive referencedArchive) { - IProject p = getProject(referencedArchive); - if (p == null) - return; - - element.setProject(p); - //Handle the imported jars in the project - String[] cp = null; - try { - cp = referencedArchive.getManifest().getClassPathTokenized(); - } catch (ManifestException mfEx) { - Logger.getLogger().logError(mfEx); - cp = new String[]{}; - } - List paths = new ArrayList(cp.length); - for (int i = 0; i < cp.length; i++) { - - IFile file = null; - try { - file = p.getFile(cp[i]); - } catch (IllegalArgumentException invalidPath) { - continue; - } - if (file.exists()) - paths.add(file.getFullPath()); - } - if (!paths.isEmpty()) - element.setImportedJarPaths(paths); - } - - protected void setProjectValues(ClasspathElement element, IVirtualReference referencedArchive) { - IProject p = referencedArchive.getReferencedComponent().getProject(); - if (p == null) - return; - - element.setProject(p); - //Handle the imported jars in the project - String[] cp = null; - try { -// cp = referencedArchive.getManifest().getClassPathTokenized(); - ArchiveManifest referencedManifest = J2EEProjectUtilities.readManifest(p); - cp = referencedManifest.getClassPathTokenized(); - } catch (ManifestException mfEx) { - Logger.getLogger().logError(mfEx); - cp = new String[]{}; - } - List paths = new ArrayList(cp.length); - for (int i = 0; i < cp.length; i++) { - - IFile file = null; - try { - file = p.getFile(cp[i]); - } catch (IllegalArgumentException invalidPath) { - continue; - } - if (file.exists()) - paths.add(file.getFullPath()); - } - if (!paths.isEmpty()) - element.setImportedJarPaths(paths); - } - - public String toString() { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < classpathElements.size(); i++) { - ClasspathElement element = (ClasspathElement) classpathElements.get(i); - if (element.isSelected() && !element.isClasspathDependency() && !element.isClasspathEntry()) { - sb.append(element.getRelativeText()); - sb.append(" "); //$NON-NLS-1$ - } - } - //Remove the trailing space - if (sb.length() > 0) - sb.deleteCharAt(sb.length() - 1); - return sb.toString(); - } - - public void setAllSelected(boolean selected) { - setAllSelected(classpathElements, selected); - } - - public void setAllSelected(List elements, boolean selected) { - for (int i = 0; i < elements.size(); i++) { - ClasspathElement elmt = (ClasspathElement) elements.get(i); - elmt.setSelected(selected); - } - } - - /* borrowed code from jdt */ - protected List moveUp(List elements, List move) { - int nElements = elements.size(); - List res = new ArrayList(nElements); - Object floating = null; - for (int i = 0; i < nElements; i++) { - Object curr = elements.get(i); - if (move.contains(curr)) { - res.add(curr); - } else { - if (floating != null) { - res.add(floating); - } - floating = curr; - } - } - if (floating != null) { - res.add(floating); - } - return res; - } - - /* borrowed code from jdt */ - public void moveUp(List toMoveUp) { - setModifiedIfAnySelected(toMoveUp); - if (toMoveUp.size() > 0) - classpathElements = moveUp(classpathElements, toMoveUp); - } - - /* borrowed code from jdt */ - public void moveDown(List toMoveDown) { - setModifiedIfAnySelected(toMoveDown); - if (toMoveDown.size() > 0) - classpathElements = reverse(moveUp(reverse(classpathElements), toMoveDown)); - - } - - /* borrowed code from jdt */ - protected List reverse(List p) { - List reverse = new ArrayList(p.size()); - for (int i = p.size() - 1; i >= 0; i--) { - reverse.add(p.get(i)); - } - return reverse; - } - - public ClasspathElement getClasspathElement(String uri) { - if (urisToElements == null) - return null; - return (ClasspathElement) urisToElements.get(uri); - } - - public ClasspathElement getClasspathElement(IVirtualComponent archiveComponent) { - if (archiveComponent != null) { - for (int i = 0; i < classpathElements.size(); i++) { - ClasspathElement elmnt = (ClasspathElement) classpathElements.get(i); - if (archiveComponent.equals(elmnt.getComponent())) - return elmnt; - } - } - return null; - } - - public ClasspathElement getClasspathElement(IProject archiveProject) { - if (archiveProject != null) { - for (int i = 0; i < classpathElements.size(); i++) { - ClasspathElement elmnt = (ClasspathElement) classpathElements.get(i); - if (archiveProject.equals(elmnt.getProject())) - return elmnt; - } - } - return null; - } - - public boolean hasDirectOrIndirectDependencyTo(IProject archiveProject) { - ClasspathElement element = getClasspathElement(archiveProject); - if (element == null) - return false; - Archive anArchive = null; - if (element.isValid()) { - try { - anArchive = (Archive) getEARFile().getFile(element.getText()); - } catch (FileNotFoundException e) { - } - } - return anArchive != null && archive.hasClasspathVisibilityTo(anArchive); - } - - public boolean hasDirectOrIndirectDependencyTo(String jarName) { - ClasspathElement element = getClasspathElement(jarName); - if (element == null) - return false; - Archive anArchive = null; - if (element.isValid()) { - try { - anArchive = (Archive) getEARFile().getFile(element.getText()); - } catch (FileNotFoundException e) { - } - } - return anArchive != null && archive.hasClasspathVisibilityTo(anArchive); - } - - - public boolean isAnyJarSelected(int type) { - if (classpathElements != null) { - for (int i = 0; i < classpathElements.size(); i++) { - ClasspathElement element = (ClasspathElement) classpathElements.get(i); - if (element.getJarType() == type && element.isSelected()) - return true; - } - } - return false; - } - - - public boolean isAnyEJBJarSelected() { - return isAnyJarSelected(ClasspathElement.EJB_JAR); - } - - - - public boolean isAnyEJBClientJARSelected() { - return isAnyJarSelected(ClasspathElement.EJB_CLIENT_JAR); - - } - - /** - * @return - */ - public int getFilterLevel() { - return filterLevel; - } - - /** - * @param i - */ - public void setFilterLevel(int i) { - filterLevel = i; - } - - /** - * This method selects or deselects indivual elements based on the filter level, and - * additionally sets the filter level. - * - * @param i - */ - public void selectFilterLevel(int level) { - setFilterLevel(level); - switch (level) { - case FILTER_EJB_CLIENT_JARS : - invertClientJARSelections(ClasspathElement.EJB_CLIENT_JAR); - break; - case FILTER_EJB_SERVER_JARS : - invertClientJARSelections(ClasspathElement.EJB_JAR); - break; - default : - break; - } - } - - public void invertClientJARSelection(IProject aProject, IProject opposite) { - ClasspathElement element = getClasspathElement(aProject); - ClasspathElement oppositeElement = (opposite == null ? null : getClasspathElement(opposite)); - if (element.isSelected()) - invertSelectionIfPossible(element, oppositeElement); - } - - private void invertClientJARSelections(int elementType) { - if (classpathElements == null) - return; - - for (int i = 0; i < classpathElements.size(); i++) { - ClasspathElement element = (ClasspathElement) classpathElements.get(i); - if (element.getJarType() == elementType && element.isSelected()) { - invertSelectionIfPossible(element, null); - } - } - } - - /** - * @param element - * @param elementType - */ - private void invertSelectionIfPossible(ClasspathElement element, ClasspathElement opposite) { - if (element == null) - return; - if (opposite == null) - opposite = getOppositeElement(element); - if (opposite != null) { - opposite.setSelected(true); - element.setSelected(false); - } - } - - /** - * If the element represents an EJB client JAR, returns the corresponding server JAR. If the - * element represents an EJB server JAR, returns the corresponding client JAR. - */ - public ClasspathElement getOppositeElement(ClasspathElement element) { - String uri = element.getText(); - IVirtualComponent target = element.getTargetComponent(); - if (uri == null || target == null) - return null; - IVirtualComponent oppositeJAR = null; - switch (element.getJarType()) { - case (ClasspathElement.EJB_CLIENT_JAR) : - oppositeJAR = (IVirtualComponent) clientToEJBJARs.get(target); - break; - case (ClasspathElement.EJB_JAR) : - oppositeJAR = (IVirtualComponent) ejbToClientJARs.get(target); - break; - default : - break; - } - if (oppositeJAR != null) - return getClasspathElement(oppositeJAR); - - return null; - } - - private void setModifiedIfAnySelected(List elements) { - for (int i = 0; i < elements.size(); i++) { - ClasspathElement element = (ClasspathElement) elements.get(i); - if (element.isSelected()) - setModified(true); - } - } - - public boolean isMyClientJAR(ClasspathElement element) { - if (element == null || ejbToClientJARs == null) - return false; - IVirtualComponent myClientJar = (IVirtualComponent) ejbToClientJARs.get(component); - return myClientJar != null && myClientJar == element.getTargetComponent(); - } - - public Map getUrisToElements() { - if(urisToElements == null) - urisToElements = new HashMap(); - return urisToElements; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ClasspathElement.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ClasspathElement.java deleted file mode 100644 index cad66e7f1..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ClasspathElement.java +++ /dev/null @@ -1,572 +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.j2ee.application.internal.operations; - - - -import java.io.FileNotFoundException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.internal.archive.operations.J2EEImportConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.UnresolveableURIException; -import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - - -public class ClasspathElement { - public final static int UTIL_JAR = 0; - public final static int EJB_JAR = 1; - public final static int EJB_CLIENT_JAR = 2; - protected int jarType = UTIL_JAR; - /** The owner archive of this entry */ - protected Archive archive; - - /** The archive this entry references, if it exists */ - protected Archive targetArchive; - - /** The display text for this item */ - protected String text; - /** Indicates if this is selected in the view */ - protected boolean selected; - protected boolean valid; - /** Indicates if this element represents a component dependency associated with a resolved Java classpath entry that is mapped to the virtual component api */ - protected boolean isClasspathDependency = false; - /** Indicates if this element represents a Java classpath entry */ - protected boolean isClasspathEntry= false; - /** For elments that represent a Java classpath entry, holds the entry */ - protected IClasspathEntry classpathEntry = null; - - /** - * The text that is an actual Class-Path entry in the Manifest; in the case of multi-segment - * uris, might look like ../xxx - */ - protected String relativeText; - /** The project that corresponds to the dependent module, when it exists */ - protected IProject project; - /** - * If the project is not null, there may be imported jars in the project List of IPath - */ - protected List importedJarPaths; - protected IProject earProject; - protected ClassPathSelection parentSelection; - protected URI archiveURI; - protected String earContentFolder; - protected IVirtualComponent component; - protected IVirtualComponent targetComponent; - - public ClasspathElement(Archive anArchive) { - super(); - archive = anArchive; - } - - public ClasspathElement(IProject project) { - super(); - this.project = project; - } - - public ClasspathElement(URI aArchiveURI) { - super(); - archiveURI = aArchiveURI; - } - - public ClasspathElement(IVirtualComponent aComponent) { - super(); - this.component = aComponent; - this.project = aComponent.getProject(); - } - - protected void computeRelativeText() { - if (archive != null) { - relativeText = J2EEProjectUtilities.computeRelativeText(archive.getURI(), getText()); - if (relativeText == null) - relativeText = getText(); - } - if (component != null) - { - IVirtualComponent earComponent = ComponentCore.createComponent(earProject); - IVirtualReference[] refs = earComponent.getReferences(); - IVirtualReference reference = null; - String archiveURI = null; - for (int i = 0; i < refs.length; i++) { - reference = refs[i]; - if( component.equals(reference.getReferencedComponent())){ - archiveURI = reference.getArchiveName(); - } - } - if (archiveURI != null) - { - relativeText = J2EEProjectUtilities.computeRelativeText(archiveURI, getText()); - } - if (relativeText == null) - relativeText = getText(); - } - } - - /** - * Insert the method's description here. Creation date: (8/28/2001 5:07:26 PM) - * - * @return org.eclipse.core.resources.IProject - */ - public org.eclipse.core.resources.IProject getEarProject() { - return earProject; - } - - protected IFile getImportedJarAsIFile() { - if (getProject() != null) { - if (getText() != null && getText().endsWith(J2EEImportConstants.IMPORTED_JAR_SUFFIX)) { - IFile file = getProject().getFile(getText()); - if (file != null && file.exists()) - return file; - } - } - return null; - } - - /** - * Insert the method's description here. Creation date: (8/28/2001 4:33:35 PM) - * - * @return java.util.List - */ - public java.util.List getImportedJarPaths() { - return importedJarPaths; - } - - /** - * Insert the method's description here. Creation date: (8/27/2001 1:14:04 PM) - * - * @return int - */ - public int getJarType() { - return jarType; - } - - /** - * Insert the method's description here. Creation date: (8/25/2001 6:21:01 PM) - * - * @return org.eclipse.core.resources.IProject - */ - public org.eclipse.core.resources.IProject getProject() { - return project; - } - - public IVirtualComponent getComponent() { - if(project != null){ - return ComponentCore.createComponent(project); - } else if(relativeText != null){ - IVirtualComponent earComponent = ComponentCore.createComponent(earProject); - IVirtualReference[] refs = earComponent.getReferences(); - for (int i = 0; i < refs.length; i++) { - IVirtualReference reference = refs[i]; - if( reference.getReferencedComponent() != null ){ - String name = reference.getReferencedComponent().getName(); - if(name.lastIndexOf('/') != -1){ - name = name.substring(name.lastIndexOf('/')+1); - } - if (name.equals(relativeText)){ - return reference.getReferencedComponent(); - } - } - } - } - return null; - } - - - public String getProjectName() { - return project == null ? null : project.getName(); - } - - public java.lang.String getRelativeText() { - if (relativeText == null) - computeRelativeText(); - return relativeText; - } - - /** - * Insert the method's description here. Creation date: (8/22/2001 11:00:36 AM) - * - * @return java.lang.String - */ - public java.lang.String getText() { - return text; - } - - /** - * Insert the method's description here. Creation date: (8/22/2001 11:01:46 AM) - * - * @return boolean - */ - public boolean isSelected() { - return selected; - } - - /** - * Determines if this ClasspathElement is associated with a resolved Java classpath entry - * that is tagged as a component dependency. - * @return True if a classpath component dependency. - */ - public boolean isClasspathDependency() { - return isClasspathDependency; - } - - /** - * Sets whether this ClasspathElement is associated with a resolved Java classpath entry - * that is tagged as a component dependency. - * @param classpathDependency True if a classpath component dependency. - */ - public void setClasspathDependency(final boolean classpathDependency) { - this.isClasspathDependency = classpathDependency; - } - - /** - * Determines if this ClasspathElement is associated with a Java classpath entry - * that is either currently tagged or can be tagged as a component dependency. - * @return True if a classpath component dependency. - */ - public boolean isClasspathEntry() { - return isClasspathEntry; - } - - /** - * Sets whether this ClasspathElement is associated with a Java classpath entry - * that is either currently tagged or can be tagged as a component dependency. - * @param isClasspathEntry True if a classpath entry. - * @param entry The associated classpath entry. - */ - public void setClasspathEntry(final boolean isClasspathEntry, final IClasspathEntry entry) { - this.isClasspathEntry= isClasspathEntry; - this.classpathEntry = entry; - } - - /** - * Retrieves any associated classpath entry. - * @return Associated classpath entry, if there is one. - */ - public IClasspathEntry getClasspathEntry() { - return classpathEntry; - } - - /** - * Insert the method's description here. Creation date: (8/27/2001 1:04:35 PM) - * - * @return boolean - */ - public boolean isValid() { - return valid; - } - - public IResource getResource() { - if (project != null) - return project; - return earProject.getFile(getText()); - } - - public IClasspathEntry[] newClasspathEntriesForArchive() { - if( !archiveURI.equals("")){ - String resourcePath = ""; - try { - resourcePath = ModuleURIUtil.getArchiveName(archiveURI); - } catch (UnresolveableURIException e) { - Logger.getLogger().logError(e); - } - IPath resPath = new Path(resourcePath); - if (!resPath.isAbsolute()) - resPath = resPath.makeAbsolute(); - java.io.File file = new java.io.File(resourcePath); - if( file.exists() || J2EEPlugin.getWorkspace().getRoot().exists(new Path(resourcePath))){ - return new IClasspathEntry[]{JavaCore.newLibraryEntry( resPath, null, null, true)}; - }else{ - return new IClasspathEntry[]{JavaCore.newVariableEntry( resPath, null, null)}; - } - } - return new IClasspathEntry[0]; - } - - - /** - * Adapter method to convert this manifest class path element to zero or more classpath entries - * for a java build path - */ - public IClasspathEntry[] newClasspathEntries(Set visited) { - if (visited.contains(this)) - return new IClasspathEntry[0]; - visited.add(this); - if (representsImportedJar()) - return new IClasspathEntry[]{JavaCore.newLibraryEntry(getImportedJarAsIFile().getFullPath(), null, null)}; - - if( archiveURI != null && !archiveURI.equals("") ){ - return newClasspathEntriesForArchive(); - } - if (!valid && isSelected()) - return new IClasspathEntry[0]; - - if (project == null) - return newClasspathEntriesFromEARProject(visited); - - IClasspathEntry projectEntry = JavaCore.newProjectEntry(getProject().getFullPath(), true); - if (importedJarPaths == null || importedJarPaths.isEmpty()) - return new IClasspathEntry[]{projectEntry}; - - List result = new ArrayList(2); - result.add(projectEntry); - for (int i = 0; i < importedJarPaths.size(); i++) { - IPath path = (IPath) importedJarPaths.get(i); - result.add(JavaCore.newLibraryEntry(path, null, null)); - } - return (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]); - } - - public IClasspathEntry[] newClasspathEntries() { - return newClasspathEntries(new HashSet()); - } - - protected IClasspathEntry newClasspathEntryFromEARProj() { - IPath path = earProject.getFullPath().append( getEarContentFolder() + IPath.SEPARATOR + earProject.getFile(getText()).getProjectRelativePath()); - return JavaCore.newLibraryEntry(path, path, null, true); - } - - /** - * The archive is in the EAR and not in a project. - */ - protected IClasspathEntry[] newClasspathEntriesFromEARProject(Set visited) { - List cpEntries = new ArrayList(); - cpEntries.add(newClasspathEntryFromEARProj()); - traverseClasspaths(cpEntries, visited); - return (IClasspathEntry[]) cpEntries.toArray(new IClasspathEntry[cpEntries.size()]); - } - - /* - * If you have a dependency to a JAR in the EAR project, and the JAR depends on another JAR in - * the EAR; you want to compile cleanly after import, so you need both those JARs on your build - * path - */ - protected void traverseClasspaths(List projectCpEntries, Set visited) { - - File aFile = null; - try { - aFile = getEARFile().getFile(getText()); - } catch (FileNotFoundException notThere) { - } - if (aFile == null || !aFile.isArchive()) - return; - - Archive depArchive = (Archive) aFile; - String[] manifestCpEntries = depArchive.getManifest().getClassPathTokenized(); - for (int i = 0; i < manifestCpEntries.length; i++) { - String uri = ArchiveUtil.deriveEARRelativeURI(manifestCpEntries[i], depArchive); - if (uri == null) - continue; - ClasspathElement other = parentSelection.getClasspathElement(uri); - //If the other element is already selected, then - // we don't need to add it again - if (other == null || other.isSelected()) - continue; - IClasspathEntry[] cpEntries = other.newClasspathEntries(visited); - for (int j = 0; j < cpEntries.length; j++) { - if (!projectCpEntries.contains(cpEntries[j])) - projectCpEntries.add(cpEntries[j]); - } - } - } - - - public boolean representsImportedJar() { - return getImportedJarAsIFile() != null; - } - - /** - * Insert the method's description here. Creation date: (8/28/2001 5:07:26 PM) - * - * @param newEarProject - * org.eclipse.core.resources.IProject - */ - public void setEarProject(org.eclipse.core.resources.IProject newEarProject) { - earProject = newEarProject; - } - - /** - * Insert the method's description here. Creation date: (8/28/2001 4:33:35 PM) - * - * @param newImportedJarPaths - * java.util.List - */ - public void setImportedJarPaths(java.util.List newImportedJarPaths) { - importedJarPaths = newImportedJarPaths; - } - - /** - * Insert the method's description here. Creation date: (8/27/2001 1:14:04 PM) - * - * @param newJarType - * int - */ - public void setJarType(int newJarType) { - jarType = newJarType; - } - - /** - * Insert the method's description here. Creation date: (8/25/2001 6:21:01 PM) - * - * @param newProject - * org.eclipse.core.resources.IProject - */ - public void setProject(org.eclipse.core.resources.IProject newProject) { - project = newProject; - } - - /** - * Insert the method's description here. Creation date: (8/22/2001 4:20:55 PM) - * - * @param newRelativeText - * java.lang.String - */ - public void setRelativeText(java.lang.String newRelativeText) { - relativeText = newRelativeText; - } - - public void setSelected(Archive referencingJar, Archive referencedJar, List classPath) { - for (int i = 0; i < classPath.size(); i++) { - String cpEntry = (String) classPath.get(i); - String uri = ArchiveUtil.deriveEARRelativeURI(cpEntry, referencingJar); - if (uri != null && uri.equals(referencedJar.getURI())) { - setSelected(true); - return; - } - } - setSelected(false); - } - - /** - * Insert the method's description here. Creation date: (8/22/2001 11:01:46 AM) - * - * @param newSelected - * boolean - */ - public void setSelected(boolean newSelected) { - boolean oldSelected = selected; - selected = newSelected; - if (oldSelected != newSelected && parentSelection != null) - parentSelection.setModified(true); - } - - /** - * Insert the method's description here. Creation date: (8/22/2001 11:00:36 AM) - * - * @param newText - * java.lang.String - */ - public void setText(java.lang.String newText) { - text = newText; - } - - /** - * Insert the method's description here. Creation date: (8/27/2001 1:04:35 PM) - * - * @param newValid - * boolean - */ - public void setValid(boolean newValid) { - valid = newValid; - } - - public void setValuesSelected(String cpEntry) { - setSelected(true); - setRelativeText(cpEntry); - } - - public String toString() { - return "ClasspatheElement(" + getText() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - protected EARFile getEARFile() { - return (EARFile) archive.getContainer(); - } - - void setParentSelection(ClassPathSelection selection) { - parentSelection = selection; - } - - /** - * Returns the archive. - * - * @return Archive - */ - public Archive getArchive() { - return archive; - } - - public boolean isEJBJar() { - return jarType == EJB_JAR; - } - - public boolean isEJBClientJar() { - return jarType == EJB_CLIENT_JAR; - } - - /** - * @return - */ - public Archive getTargetArchive() { - return targetArchive; - } - - /** - * @return - */ - public IVirtualComponent getTargetComponent() { - return targetComponent; - } - - /** - * @param archive - */ - public void setTargetArchive(Archive archive) { - targetArchive = archive; - } - - public void setTargetComponent(IVirtualComponent aTargetComponent) { - targetComponent = aTargetComponent; - } - - public URI getArchiveURI() { - return archiveURI; - } - - public String getEarContentFolder() { - return earContentFolder; - } - - public void setEarContentFolder(String earContentFolder) { - this.earContentFolder = earContentFolder; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ComputeEARsForContextRootUpdateDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ComputeEARsForContextRootUpdateDataModelProvider.java deleted file mode 100644 index f3313f82c..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ComputeEARsForContextRootUpdateDataModelProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 BEA Systems, Inc - * 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: - * rfrost@bea.com - initial API and impl - *******************************************************************************/ - -package org.eclipse.jst.j2ee.application.internal.operations; - -import java.util.Set; - -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; - -/** - * <code>AbstractDataModelProvider</code> subclass that supports the <code>ComputeEARsForContextRootUpdateOp</code>. - */ -public class ComputeEARsForContextRootUpdateDataModelProvider extends AbstractDataModelProvider implements IUpdateModuleContextRootProperties { - - public Set getPropertyNames() { - final Set propertyNames = super.getPropertyNames(); - propertyNames.add(EARS_TO_UPDATE); - return propertyNames; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ComputeEARsForContextRootUpdateOp.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ComputeEARsForContextRootUpdateOp.java deleted file mode 100644 index 57baa525d..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/ComputeEARsForContextRootUpdateOp.java +++ /dev/null @@ -1,131 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 BEA Systems, Inc - * 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: - * rfrost@bea.com - initial API and impl - *******************************************************************************/ -package org.eclipse.jst.j2ee.application.internal.operations; - -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -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.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * <code>AbstractDataModelOperation</code> subclass that computes the set of referencing EARs - * in which the context-root for a given module will be updated in the application.xml file. - */ -public class ComputeEARsForContextRootUpdateOp extends AbstractDataModelOperation implements IUpdateModuleContextRootProperties { - - public ComputeEARsForContextRootUpdateOp() { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus execute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { - if (monitor != null) { - monitor.beginTask("", 1); - } - - final IProject project = (IProject)model.getProperty(PROJECT); - final List earsToUpdate = new ArrayList(); - try { - // get the set of all referencing EARs - final IProject[] ears = J2EEProjectUtilities.getReferencingEARProjects(project); - - // for each EAR, check if the current context-root value is equal to the old context-root setting - // if it is, update it to reflect the new value - for (int i = 0; i < ears.length; i++) { - // check if the current value of the context-root for the module - // is equal to the value stored in the associated EAR's - // application.xml - if (currentRootEqualsEARRoot(ears[i], project)) { - earsToUpdate.add(ears[i]); - } - } - // Save the list of EARs to update in a nested IDataModel - IDataModel nestedModel = DataModelFactory.createDataModel(new ComputeEARsForContextRootUpdateDataModelProvider()); - nestedModel.setProperty(EARS_TO_UPDATE, earsToUpdate); - model.addNestedModel(NESTED_MODEL_ID, nestedModel); - - } catch (Exception e) { - Logger.getLogger().logError(e); - } finally { - if (monitor != null) { - monitor.done(); - } - } - return OK_STATUS; - } - - /* - * Determines if the current module context-root is equal to the value in the application.xml. - */ - private boolean currentRootEqualsEARRoot(final IProject earProject, final IProject moduleProject) { - EARArtifactEdit earEdit = null; - try { - earEdit = EARArtifactEdit.getEARArtifactEditForRead(earProject); - if (earEdit == null) { - return false; - } - final Application app = earEdit.getApplication(); - final IVirtualComponent comp = ComponentCore.createComponent(moduleProject); - if (app == null || comp == null) { - return false; - } - final String moduleURI = earEdit.getModuleURI(comp); - final Module module = app.getFirstModule(moduleURI); - if (module != null && module instanceof WebModule) { - final Properties props = comp.getMetaProperties(); - if ((props != null) && (props.containsKey(J2EEConstants.CONTEXTROOT))) { - return ((WebModule) module).getContextRoot().equals(props.getProperty(J2EEConstants.CONTEXTROOT)); - } - } - } finally { - if (earEdit != null) { - earEdit.dispose(); - } - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // no-op - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // no-op - return null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CopyArchiveIntoProjectOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CopyArchiveIntoProjectOperation.java deleted file mode 100644 index 246aa579c..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CopyArchiveIntoProjectOperation.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -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.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class CopyArchiveIntoProjectOperation extends J2EEUtilityJarImportAssistantOperation { - - public CopyArchiveIntoProjectOperation(File utilityJar) { - super(NLS.bind(EARCreationResourceHandler.CopyArchiveIntoProjectOperation_Copying_archive_into_selected_proje_, utilityJar.getName()), utilityJar); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - MultiStatus status = new MultiStatus(J2EEPlugin.PLUGIN_ID, 0, NLS.bind(EARCreationResourceHandler.CopyArchiveIntoProjectOperation_Copying_archive_into_selected_proje_, getUtilityJar().getName()), null); - - try { - - IFile copiedJarFile = null; - - IProject associatedEARProject = getWorkspaceRoot().getProject(getAssociatedEARProjectName()); - IVirtualComponent earComponent = ComponentCore.createComponent(associatedEARProject); - - IContainer underlyingFolder = earComponent.getRootFolder().getUnderlyingFolder(); - if(underlyingFolder.isAccessible()) { - copiedJarFile = underlyingFolder.getFile(new Path(getUtilityJar().getName())); - } else { - copiedJarFile = associatedEARProject.getFile(getUtilityJar().getName()); - } - if (copiedJarFile.exists()) { - if (isOverwriteIfNecessary()) - copiedJarFile.delete(true, true, new SubProgressMonitor(monitor, 1)); - else { - status.add(J2EEPlugin.createErrorStatus(0, NLS.bind(EARCreationResourceHandler.CopyArchiveIntoProjectOperation_Found_existing_file_0_, copiedJarFile), null)); - return status; - } - } - - FileInputStream fileInputStream = null; - ByteArrayOutputStream bos = null; - ByteArrayInputStream jarFileInputStream = null; - try { - fileInputStream = new FileInputStream(getUtilityJar()); - bos = new ByteArrayOutputStream(); - byte[] data = new byte[4096]; - try { - int bytesRead = 0; - while ((bytesRead = fileInputStream.read(data)) > 0) - bos.write(data, 0, bytesRead); - // clear space for GC - data = null; - } finally { - if(fileInputStream != null) - fileInputStream.close(); - } - - jarFileInputStream = new ByteArrayInputStream(bos.toByteArray()); - copiedJarFile.create(jarFileInputStream, 0, new SubProgressMonitor(monitor, 1)); - - addLibraryToClasspath(associatedEARProject, copiedJarFile, monitor); - - createVirtualArchiveComponent(associatedEARProject, getUtilityJar().getName(), copiedJarFile, monitor); - - - } catch (FileNotFoundException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } catch (InvocationTargetException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } catch (InterruptedException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } finally { - if (bos != null) - bos.close(); - if (jarFileInputStream != null) - jarFileInputStream.close(); - } - } catch (IOException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } catch (CoreException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } - return status; - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CreateProjectWithExtractedJarOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CreateProjectWithExtractedJarOperation.java deleted file mode 100644 index 8ae372a96..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CreateProjectWithExtractedJarOperation.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.application.internal.operations; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -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.IJavaUtilityJarImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew; - - -public class CreateProjectWithExtractedJarOperation extends J2EEUtilityJarImportAssistantOperation { -// private boolean createBinaryProject = false; - private String newProjectName; - private String projectRoot; -// private boolean createAsBinary; - - public CreateProjectWithExtractedJarOperation(File utilityJar, String overridingProjectRoot) { - super(NLS.bind(EARCreationResourceHandler.CreateProjectWithExtractedJarOperation_Create_project_with_extracted_conte_, utilityJar.getName()), utilityJar); - newProjectName = getUtilityJarProjectName(utilityJar); - projectRoot = findUniqueLocation(overridingProjectRoot, newProjectName); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - MultiStatus status = new MultiStatus(J2EEPlugin.PLUGIN_ID, 0, NLS.bind(EARCreationResourceHandler.CreateProjectWithExtractedJarOperation_Create_project_with_extracted_conte_, getUtilityJar().getName()), null); - Archive archive = null; - try { - archive = CommonarchiveFactory.eINSTANCE.primOpenArchive(getUtilityJar().getAbsolutePath()); - - IDataModel importModel = DataModelFactory.createDataModel(new J2EEUtilityJarImportDataModelProvider()); - - importModel.setProperty(IJavaUtilityJarImportDataModelProperties.FILE, archive); -// importModel.setProperty(IJavaUtilityJarImportDataModelProperties.FILE_NAME, getUtilityJar().getAbsolutePath()); - - if (projectRoot != null && projectRoot.length() > 0) { - importModel.setBooleanProperty(IProjectCreationPropertiesNew.USE_DEFAULT_LOCATION, false); - importModel.setProperty(IProjectCreationPropertiesNew.USER_DEFINED_LOCATION, projectRoot); - } - - // importModel.getJ2eeProjectCreationDataModel().setBooleanProperty(J2EEProjectCreationDataModel.ADD_SERVER_TARGET, true); - if (isOverwriteIfNecessary()) { - // importModel.setBooleanProperty(IJavaUtilityJarImportDataModelProperties.OVERWRITE_HANDLER); - IProject existingProject = getWorkspaceRoot().getProject(newProjectName); - if (existingProject.exists()) { - existingProject.delete(true, true, monitor); - } - } - - importModel.setProperty(IJavaUtilityJarImportDataModelProperties.PROJECT_NAME, newProjectName); - importModel.setProperty(IJavaUtilityJarImportDataModelProperties.EAR_PROJECT_NAME, getAssociatedEARProjectName()); - - status.add(importModel.getDefaultOperation().execute(new SubProgressMonitor(monitor, 1), info)); - - IProject associatedEARProject = getWorkspaceRoot().getProject(getAssociatedEARProjectName()); - IProject utilityJarProject = getWorkspaceRoot().getProject(newProjectName); - linkArchiveToEAR(associatedEARProject, getUtilityJar().getName(), utilityJarProject, new SubProgressMonitor(monitor, 1)); - - } catch (OpenFailureException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } catch (InvocationTargetException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } catch (InterruptedException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } catch (CoreException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } finally { - if(archive != null) - archive.close(); - } - return status; - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - - public void setNewProjectName(String newProjectName) { - this.newProjectName = newProjectName; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CreateProjectWithLinkedJarOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CreateProjectWithLinkedJarOperation.java deleted file mode 100644 index 8b4ab941f..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/CreateProjectWithLinkedJarOperation.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.application.internal.operations; - -import java.io.File; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetProjectCreationDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.UtilityProjectCreationDataModelProvider; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew; - -public class CreateProjectWithLinkedJarOperation extends J2EEUtilityJarImportAssistantOperation { - - private String linkedPathVariable; - private String projectRoot; -// private boolean createAsBinary; - - public CreateProjectWithLinkedJarOperation(File utilityJar, String overridingProjectRoot, String linkedPathVariable) { - super(NLS.bind(EARCreationResourceHandler.CreateProjectWithLinkedJarOperation_Creating_project_with_linked_archiv_, utilityJar.getName()), utilityJar); - this.linkedPathVariable= linkedPathVariable; - projectRoot = findUniqueLocation(overridingProjectRoot, getUtilityJarProjectName(utilityJar)); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - MultiStatus status = new MultiStatus(J2EEPlugin.PLUGIN_ID, 0, NLS.bind(EARCreationResourceHandler.CreateProjectWithLinkedJarOperation_Creating_project_with_linked_archiv_, getUtilityJar().getName()), null); - - try { - IProject project = getWorkspaceRoot().getProject(getUtilityJarProjectName(getUtilityJar())); - - IDataModel createUtilityProject = DataModelFactory.createDataModel(new UtilityProjectCreationDataModelProvider()); - createUtilityProject.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, getUtilityJarProjectName(getUtilityJar())); - - if (projectRoot != null && projectRoot.length() > 0) { - createUtilityProject.setBooleanProperty(IProjectCreationPropertiesNew.USE_DEFAULT_LOCATION, false); - createUtilityProject.setProperty(IProjectCreationPropertiesNew.USER_DEFINED_LOCATION, projectRoot); - } - - createUtilityProject.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, getAssociatedEARProjectName()); - - status.add(createUtilityProject.getDefaultOperation().execute(monitor, info)); - - IProject utilityJarProject = getWorkspaceRoot().getProject(getUtilityJarProjectName(getUtilityJar())); - - /* Remove the default src folder */ - IJavaProject utilityJarJavaProject = JavaCore.create(utilityJarProject); - IPackageFragmentRoot srcFolder = utilityJarJavaProject.getPackageFragmentRoot(utilityJarProject.getFolder("src")); - if(srcFolder.exists()) { - srcFolder.delete(IResource.FORCE, IPackageFragmentRoot.ORIGINATING_PROJECT_CLASSPATH, monitor); - } - status.add(createLinkedArchive(project, getUtilityJar().getName(), getUtilityJar(), linkedPathVariable, monitor)); - - /* Remove the /src mapping */ - IVirtualComponent utilComponent = ComponentCore.createComponent(project); - status.add(removeRootMapping(utilComponent, "/src", monitor)); - - /* Create the /<archive> mapping */ - status.add(createVirtualArchiveComponent(project, getUtilityJar().getName(), project.getFile(getUtilityJar().getName()), monitor)); - - /* Make this project a utility jar project for the EAR */ - IProject associatedEARProject = getWorkspaceRoot().getProject(getAssociatedEARProjectName()); - status.add(linkArchiveToEAR(associatedEARProject, getUtilityJar().getName(), utilityJarProject, new SubProgressMonitor(monitor, 1))); - - } catch (Exception e) { - status.add(J2EEPlugin.createErrorStatus(0, EARCreationResourceHandler.J2EEUtilityJarListImportOperation_UI_2, e)); - } - return status; - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/DefaultJ2EEComponentCreationOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/DefaultJ2EEComponentCreationOperation.java deleted file mode 100644 index b0de18a88..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/DefaultJ2EEComponentCreationOperation.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -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.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.earcreation.IDefaultJ2EEComponentCreationDataModelProperties; -import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider; -import org.eclipse.wst.common.componentcore.internal.operation.FacetProjectCreationOperation; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.activities.WTPActivityBridge; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -public class DefaultJ2EEComponentCreationOperation extends AbstractDataModelOperation implements IDefaultJ2EEComponentCreationDataModelProperties { - - public static final String JCA_DEV_ACTIVITY_ID = "com.ibm.wtp.jca.development"; //$NON-NLS-1$ - - public static final String WEB_DEV_ACTIVITY_ID = "com.ibm.wtp.web.development"; //$NON-NLS-1$ - - public static final String ENTERPRISE_JAVA = "com.ibm.wtp.ejb.development"; //$NON-NLS-1$ - - public DefaultJ2EEComponentCreationOperation(IDataModel model) { - super(model); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - try { - if (model.getBooleanProperty(CREATE_EJB)) { - IDataModel projectModel = model.getNestedModel(NESTED_MODEL_EJB); - createEJBComponent(projectModel, monitor); - } - if (model.getBooleanProperty(CREATE_WEB)) { - IDataModel projectModel = model.getNestedModel(NESTED_MODEL_WEB); - createWebJ2EEComponent(projectModel, monitor); - } - if (model.getBooleanProperty(CREATE_CONNECTOR)) { - IDataModel projectModel = model.getNestedModel(NESTED_MODEL_JCA); - createRarJ2EEComponent(projectModel, monitor); - } - if (model.getBooleanProperty(CREATE_APPCLIENT)) { - IDataModel projectModel = model.getNestedModel(NESTED_MODEL_CLIENT); - createAppClientComponent(projectModel, monitor); - } - } catch (Exception e) { - Logger.getLogger().log(e.getMessage()); - } - return OK_STATUS; - } - - /** - * @param model - */ - private void createEJBComponent(IDataModel model, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException, ExecutionException { - model.getDefaultOperation().execute(monitor, null); - addDefaultFacets(model); - WTPActivityBridge.getInstance().enableActivity(ENTERPRISE_JAVA, true); - } - - /** - * @param model - */ - private void createWebJ2EEComponent(IDataModel model, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException, ExecutionException { - model.getDefaultOperation().execute(monitor, null); - addDefaultFacets(model); - WTPActivityBridge.getInstance().enableActivity(WEB_DEV_ACTIVITY_ID, true); - } - - /** - * @param model - */ - private void createRarJ2EEComponent(IDataModel model, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException, ExecutionException { - model.getDefaultOperation().execute(monitor, null); - addDefaultFacets(model); - WTPActivityBridge.getInstance().enableActivity(ENTERPRISE_JAVA, true); - } - - /** - * @param model - */ - private void createAppClientComponent(IDataModel model, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException, ExecutionException { - model.getDefaultOperation().execute(monitor, null); - addDefaultFacets(model); - WTPActivityBridge.getInstance().enableActivity(ENTERPRISE_JAVA, true); - - } - - private void addDefaultFacets(IDataModel model) throws CoreException{ - IRuntime runtime = (IRuntime) model.getProperty(FacetProjectCreationDataModelProvider.FACET_RUNTIME); - String projectName = model.getStringProperty(FacetProjectCreationDataModelProvider.FACET_PROJECT_NAME); - IProject project = ProjectUtilities.getProject( projectName ); - IFacetedProject facetedProject = null; - try { - facetedProject = ProjectFacetsManager.create(project); - } catch (CoreException e) { - - } - - if( facetedProject != null && runtime != null ){ - try { - FacetProjectCreationOperation.addDefaultFactets( facetedProject, runtime ); - } catch (ExecutionException e) { - Logger.getLogger().logError(e); - } - } - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return null; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/EARComponentExportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/EARComponentExportDataModelProvider.java deleted file mode 100644 index 52037bf23..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/EARComponentExportDataModelProvider.java +++ /dev/null @@ -1,71 +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.application.internal.operations; - -import org.eclipse.jst.j2ee.internal.archive.operations.EARComponentExportOperation; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class EARComponentExportDataModelProvider extends J2EEArtifactExportDataModelProvider { - - public EARComponentExportDataModelProvider() { - super(); - } - - public IDataModelOperation getDefaultOperation() { - return new EARComponentExportOperation(model); - } - - protected String getModuleExtension() { - return ".ear"; //$NON-NLS-1$ - } - - protected String getWrongComponentTypeString(String projectName) { - return EARCreationResourceHandler.getString(EARCreationResourceHandler.NOT_AN_EAR, new Object[]{projectName}); - } - - protected String getProjectType() { - return J2EEProjectUtilities.ENTERPRISE_APPLICATION; - } - /** - * Exports the specified Enterprise Appliction project to the specified EAR file. - * - * @param earProjectName - * The name of the Enterprise Application project to export. - * @param earFileName - * The fully qualified EAR file location to export the specified Enterprise - * Application project. - * @param overwriteExisting - * If this is <code>true</code> then an existing file at the location specified by - * <code>earFileName</code> will be overwritten. - * @param exportSource - * If this is <code>true</code> then all source files in the specified Enterprise - * Application Project and all its modules will be included in the resulting EAR - * file. - * @plannedfor WTP 1.0 - */ -//TODO: can this be done in the new datamodel framework? -// public static void exportProject(String earProjectName, String earFileName, boolean overwriteExisting, boolean exportSource) { -// EnterpriseApplicationExportDataModel dataModel = new EnterpriseApplicationExportDataModel(); -// dataModel.setProperty(PROJECT_NAME, earProjectName); -// dataModel.setBooleanProperty(OVERWRITE_EXISTING, overwriteExisting); -// dataModel.setProperty(ARCHIVE_DESTINATION, earFileName); -// dataModel.setBooleanProperty(EXPORT_SOURCE_FILES, exportSource); -// try { -// dataModel.getDefaultOperation().run(null); -// } catch (InvocationTargetException e) { -// Logger.getLogger().logError(e); -// } catch (InterruptedException e) { -// Logger.getLogger().logError(e); -// } -// } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/EARComponentImportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/EARComponentImportDataModelProvider.java deleted file mode 100644 index 9f7175f7c..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/EARComponentImportDataModelProvider.java +++ /dev/null @@ -1,726 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.application.internal.operations; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.applicationclient.internal.creation.AppClientComponentImportDataModelProvider; -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.IAddWebComponentToEnterpriseApplicationDataModelProperties; -import org.eclipse.jst.j2ee.datamodel.properties.IEARComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEModuleImportDataModelProperties; -import org.eclipse.jst.j2ee.datamodel.properties.IJavaUtilityJarImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper; -import org.eclipse.jst.j2ee.internal.archive.operations.EARComponentImportOperation; -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.moduleextension.EarModuleManager; -import org.eclipse.jst.j2ee.internal.moduleextension.EjbModuleExtension; -import org.eclipse.jst.j2ee.internal.moduleextension.JcaModuleExtension; -import org.eclipse.jst.j2ee.internal.moduleextension.WebModuleExtension; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.project.facet.EARFacetProjectCreationDataModelProvider; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetProjectCreationDataModelProperties; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; -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.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; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; -import org.eclipse.wst.common.frameworks.internal.WTPPlugin; -import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew; -import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModelProviderNew; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -/** - * This dataModel is used for to import Enterprise Applications(from EAR files) into the workspace. - * - * This class (and all its fields and methods) is likely to change during the WTP 1.0 milestones as the new project - * structures are adopted. Use at your own risk. - * - * @plannedfor WTP 1.0 - */ -public final class EARComponentImportDataModelProvider extends J2EEArtifactImportDataModelProvider implements IAnnotationsDataModel, IEARComponentImportDataModelProperties { - - /** - * This is only to force validation for the nested projects; do not set. - */ - public static final String NESTED_PROJECTS_VALIDATION = "EARImportDataModel.NESTED_PROJECTS_VALIDATION"; //$NON-NLS-1$ - - /** - * This is only to force validation for the EAR name against the nested projects; do not set. - */ - public static final String EAR_NAME_VALIDATION = "EARImportDataModel.EAR_NAME_VALIDATION";//$NON-NLS-1$ - - private IDataModelListener nestedListener = new IDataModelListener() { - public void propertyChanged(DataModelEvent event) { - if (event.getPropertyName().equals(PROJECT_NAME)) { - model.notifyPropertyChange(NESTED_PROJECTS_VALIDATION, IDataModel.DEFAULT_CHG); - } - } - }; - - private Hashtable<IDataModel, IDataModel> ejbJarModelsToClientJarModels = new Hashtable<IDataModel, IDataModel>(); - - private Hashtable<IDataModel, IDataModel> clientJarModelsToEjbJarModels = new Hashtable<IDataModel, IDataModel>(); - - private ArchiveWrapper cachedLoadError = null; - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(NESTED_MODULE_ROOT); - propertyNames.add(UTILITY_LIST); - propertyNames.add(MODULE_MODELS_LIST); - propertyNames.add(EJB_CLIENT_LIST); - propertyNames.add(UTILITY_MODELS_LIST); - propertyNames.add(NESTED_PROJECTS_VALIDATION); - propertyNames.add(EAR_NAME_VALIDATION); - propertyNames.add(SELECTED_MODELS_LIST); - propertyNames.add(USE_ANNOTATIONS); - propertyNames.add(ALL_PROJECT_MODELS_LIST); - propertyNames.add(UNHANDLED_PROJECT_MODELS_LIST); - propertyNames.add(HANDLED_PROJECT_MODELS_LIST); - return propertyNames; - } - - public Object getDefaultProperty(String propertyName) { - if (NESTED_MODULE_ROOT.equals(propertyName)) { - return getLocation().toOSString(); - } else if (MODULE_MODELS_LIST.equals(propertyName) || UTILITY_LIST.equals(propertyName) || UTILITY_MODELS_LIST.equals(propertyName) || SELECTED_MODELS_LIST.equals(propertyName) || EJB_CLIENT_LIST.equals(propertyName)) { - return Collections.EMPTY_LIST; - } else if (USE_ANNOTATIONS.equals(propertyName)) { - return Boolean.FALSE; - } else if (ALL_PROJECT_MODELS_LIST.equals(propertyName)) { - return getProjectModels(); - } else if (UNHANDLED_PROJECT_MODELS_LIST.equals(propertyName)) { - return getUnhandledProjectModels(); - } else if (HANDLED_PROJECT_MODELS_LIST.equals(propertyName)) { - return getHandledSelectedModels(); - } - return super.getDefaultProperty(propertyName); - } - - public void propertyChanged(DataModelEvent event) { - super.propertyChanged(event); - if (event.getPropertyName().equals(PROJECT_NAME)) { - changeModuleCreationLocationForNameChange(getProjectModels()); - } else if (event.getPropertyName().equals(IFacetProjectCreationDataModelProperties.FACET_RUNTIME) && event.getDataModel() == model.getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION)) { - Object propertyValue = event.getProperty(); - IDataModel nestedModel = null; - List projectModels = (List) getProperty(ALL_PROJECT_MODELS_LIST); - for (int i = 0; i < projectModels.size(); i++) { - nestedModel = (IDataModel) projectModels.get(i); - nestedModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, propertyValue); - } - fixupJavaFacets(); - } - } - - public boolean propertySet(String propertyName, Object propertyValue) { - if (ALL_PROJECT_MODELS_LIST.equals(propertyName) || UNHANDLED_PROJECT_MODELS_LIST.equals(propertyName) || HANDLED_PROJECT_MODELS_LIST.equals(propertyName) || EAR_NAME_VALIDATION.equals(propertyName)) { - throw new RuntimeException(propertyName + " is an unsettable property"); //$NON-NLS-1$ - } - boolean doSet = super.propertySet(propertyName, propertyValue); - if (NESTED_MODULE_ROOT.equals(propertyName)) { - updateModuleRoot(); - } else if (FILE_NAME.equals(propertyName)) { - List nestedModels = getModuleModels(); - setProperty(MODULE_MODELS_LIST, nestedModels); - updateModuleRoot(); - setProperty(UTILITY_LIST, null); - - IDataModel earProjectModel = model.getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION); - if (getArchiveWrapper() != null) { - FacetDataModelMap map = (FacetDataModelMap) earProjectModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); - IDataModel earFacetDataModel = map.getFacetDataModel(J2EEProjectUtilities.ENTERPRISE_APPLICATION); - - JavaEEQuickPeek quickPeek = getArchiveWrapper().getJavaEEQuickPeek(); - int minimumVersion = quickPeek.getVersion(); - if(nestedModels != null){ - //increase the JavaEE facet version to accommodate the highest module version - for(int i=0;i<nestedModels.size(); i++){ - IDataModel nestedModel = (IDataModel)nestedModels.get(i); - ArchiveWrapper nestedWrapper = (ArchiveWrapper)nestedModel.getProperty(ARCHIVE_WRAPPER); - int nestedEEVersion = nestedWrapper.getJavaEEQuickPeek().getJavaEEVersion(); - if(nestedEEVersion > minimumVersion){ - minimumVersion = nestedEEVersion; - } - } - } - - String versionText = J2EEVersionUtil.getJ2EETextVersion(minimumVersion); - earFacetDataModel.setStringProperty(IFacetDataModelProperties.FACET_VERSION_STR, versionText); - } - - model.notifyPropertyChange(PROJECT_NAME, IDataModel.VALID_VALUES_CHG); - if (getJ2EEVersion() < J2EEVersionConstants.VERSION_1_3) - setBooleanProperty(USE_ANNOTATIONS, false); - model.notifyPropertyChange(USE_ANNOTATIONS, IDataModel.ENABLE_CHG); - fixupJavaFacets(); - } else if (UTILITY_LIST.equals(propertyName)) { - updateUtilityModels((List) propertyValue); - } else if (USE_ANNOTATIONS.equals(propertyName)) { - List projectModels = (List) getProperty(MODULE_MODELS_LIST); - IDataModel nestedModel = null; - for (int i = 0; i < projectModels.size(); i++) { - nestedModel = (IDataModel) projectModels.get(i); - if (nestedModel.isProperty(USE_ANNOTATIONS)) { - nestedModel.setProperty(USE_ANNOTATIONS, propertyValue); - } - } - } else if (MODULE_MODELS_LIST.equals(propertyName)) { - List newList = new ArrayList(); - newList.addAll(getProjectModels()); - setProperty(SELECTED_MODELS_LIST, newList); - } else if (PROJECT_NAME.equals(propertyName)) { - List nestedModels = (List) getProperty(MODULE_MODELS_LIST); - IDataModel nestedModel = null; - for (int i = 0; i < nestedModels.size(); i++) { - nestedModel = (IDataModel) nestedModels.get(i); - nestedModel.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, propertyValue); - } - nestedModels = (List) getProperty(UTILITY_MODELS_LIST); - for (int i = 0; i < nestedModels.size(); i++) { - nestedModel = (IDataModel) nestedModels.get(i); - nestedModel.setProperty(IJavaUtilityJarImportDataModelProperties.EAR_PROJECT_NAME, propertyValue); - } - - if (ProjectCreationDataModelProviderNew.validateProjectName(getStringProperty(PROJECT_NAME)).isOK()) { - IProject project = ProjectUtilities.getProject(getStringProperty(PROJECT_NAME)); - if (null != project && project.exists()) { - - IFacetedProject facetedProject = null; - boolean canContinue = true; - try { - facetedProject = ProjectFacetsManager.create(project); - } catch (CoreException e) { - Logger.getLogger().logError(e); - canContinue = false; - } - - if (canContinue) { - IRuntime runtime = facetedProject.getRuntime(); - if (null != runtime) { - setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, runtime); - } - } - } - } - } - return doSet; - } - - protected boolean forceResetOnPreserveMetaData() { - return false; - } - - protected void fixupJavaFacets() { - List subProjects = getSelectedModels(); - IDataModel subDataModel = null; - for (int i = 0; i < subProjects.size(); i++) { - subDataModel = (IDataModel) subProjects.get(i); - subDataModel.validateProperty(FACET_RUNTIME); - } - } - - public IStatus validate(String propertyName) { - if (propertyName.equals(NESTED_PROJECTS_VALIDATION) || propertyName.equals(EAR_NAME_VALIDATION)) { - boolean checkAgainstEARNameOnly = propertyName.equals(EAR_NAME_VALIDATION); - - String earProjectName = getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - List subProjects = getSelectedModels(); - IDataModel subDataModel = null; - String tempProjectName = null; - ArchiveWrapper tempArchive = null; - IStatus tempStatus = null; - Hashtable<String, ArchiveWrapper> projects = new Hashtable<String, ArchiveWrapper>(4); - for (int i = 0; i < subProjects.size(); i++) { - subDataModel = (IDataModel) subProjects.get(i); - tempProjectName = subDataModel.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - // TODO: add manual validation - // IStatus status = - // ProjectCreationDataModel.validateProjectName(tempProjectName); - // if (!status.isOK()) { - // return status; - // } - tempArchive = (ArchiveWrapper) subDataModel.getProperty(ARCHIVE_WRAPPER); - - if (checkAgainstEARNameOnly) { - if (tempProjectName.equals(earProjectName)) { - return WTPCommonPlugin.createWarningStatus(EARCreationResourceHandler.bind(EARCreationResourceHandler.EARImportDataModel_UI_1, new Object[] { tempProjectName, - tempArchive.getPath() })); - } else if (!WTPPlugin.isPlatformCaseSensitive()) { - if (tempProjectName.toLowerCase().equals(earProjectName.toLowerCase())) { - return WTPCommonPlugin.createWarningStatus(EARCreationResourceHandler.bind(EARCreationResourceHandler.EARImportDataModel_UI_1a, new Object[] { earProjectName, - tempProjectName, tempArchive.getPath() })); - } - } - } else { - // if (!overwrite && subDataModel.getProject().exists()) { - // return - // WTPCommonPlugin.createErrorStatus(EARCreationResourceHandler.getString("EARImportDataModel_UI_0", - // new Object[]{tempProjectName, tempArchive.getURI()})); //$NON-NLS-1$ - // } - tempStatus = subDataModel.validateProperty(IFacetDataModelProperties.FACET_PROJECT_NAME); - if (!tempStatus.isOK()) { - return WTPCommonPlugin.createErrorStatus(EARCreationResourceHandler.bind(EARCreationResourceHandler.EARImportDataModel_UI_0, new Object[] { tempProjectName, - tempArchive.getPath() })); - } - tempStatus = subDataModel.validate(); - if (!tempStatus.isOK()) { - return tempStatus; - } - if (tempProjectName.equals(earProjectName)) { - return WTPCommonPlugin.createErrorStatus(EARCreationResourceHandler.bind(EARCreationResourceHandler.EARImportDataModel_UI_1, new Object[] { tempProjectName, - tempArchive.getPath() })); - } else if (!WTPPlugin.isPlatformCaseSensitive()) { - if (tempProjectName.toLowerCase().equals(earProjectName.toLowerCase())) { - return WTPCommonPlugin.createErrorStatus(EARCreationResourceHandler.bind(EARCreationResourceHandler.EARImportDataModel_UI_1a, new Object[] { earProjectName, - tempProjectName, tempArchive.getPath() })); - } - } - if (projects.containsKey(tempProjectName)) { - return WTPCommonPlugin.createErrorStatus(EARCreationResourceHandler.bind(EARCreationResourceHandler.EARImportDataModel_UI_2, new Object[] { tempProjectName, - tempArchive.getPath(), ((Archive) projects.get(tempProjectName)).getURI() })); - } else if (!WTPPlugin.isPlatformCaseSensitive()) { - String lowerCaseProjectName = tempProjectName.toLowerCase(); - String currentKey = null; - Enumeration keys = projects.keys(); - while (keys.hasMoreElements()) { - currentKey = (String) keys.nextElement(); - if (currentKey.toLowerCase().equals(lowerCaseProjectName)) { - return WTPCommonPlugin.createErrorStatus(EARCreationResourceHandler.bind(EARCreationResourceHandler.EARImportDataModel_UI_2a, new Object[] { tempProjectName, - currentKey, tempArchive.getPath(), projects.get(currentKey).getPath() })); - } - } - } - projects.put(tempProjectName, tempArchive); - } - } - } else if (propertyName.equals(FILE_NAME)) { - IStatus status = super.validate(propertyName); - if (!status.isOK()) { - return status; - } else if (cachedLoadError != null) { - return WTPCommonPlugin - .createWarningStatus(EARCreationResourceHandler.bind(EARCreationResourceHandler.EARImportDataModel_UI_4, new Object[] { cachedLoadError.getPath().toOSString() })); - } - return status; - } - // TODO: check context root is not inside current working - // directory...this is invalid - return super.validate(propertyName); - } - - private void updateModuleRoot() { - List projects = getProjectModels(); - String basePath = isPropertySet(NESTED_MODULE_ROOT) ? getStringProperty(NESTED_MODULE_ROOT) : null; - boolean useDefault = basePath == null; - IDataModel localModel = null; - for (int i = 0; null != projects && i < projects.size(); i++) { - localModel = (IDataModel) projects.get(i); - localModel.setProperty(IProjectCreationPropertiesNew.USER_DEFINED_BASE_LOCATION, basePath); - localModel.setBooleanProperty(IProjectCreationPropertiesNew.USE_DEFAULT_LOCATION, useDefault); - } - } - - private void changeModuleCreationLocationForNameChange(List projects) { - IDataModel localModel = null; - for (int i = 0; null != projects && i < projects.size(); i++) { - localModel = (IDataModel) projects.get(i); - if (isPropertySet(NESTED_MODULE_ROOT)) { - IPath newPath = new Path((String) getProperty(NESTED_MODULE_ROOT)); - newPath = newPath.append((String) localModel.getProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME)); - // model.setProperty(J2EEComponentCreationDataModel.PROJECT_LOCATION, - // newPath.toOSString()); - } else { - // model.setProperty(J2EEComponentCreationDataModel.PROJECT_LOCATION, null); - } - } - } - - private IPath getLocation() { - return ResourcesPlugin.getWorkspace().getRoot().getLocation(); - } - - private void trimSelection() { - boolean modified = false; - List selectedList = getSelectedModels(); - List allList = getProjectModels(); - for (int i = selectedList.size() - 1; i > -1; i--) { - if (!allList.contains(selectedList.get(i))) { - modified = true; - selectedList.remove(i); - } - } - if (modified) { - List newList = new ArrayList(); - newList.addAll(selectedList); - setProperty(SELECTED_MODELS_LIST, newList); - } - } - - private void updateUtilityModels(List<ArchiveWrapper> utilityJars) { - updateUtilityModels(utilityJars, SELECTED_MODELS_LIST, UTILITY_MODELS_LIST); - } - - private void updateUtilityModels(List<ArchiveWrapper> utilityJars, String selectedProperty, String listTypeProperty) { - boolean allSelected = true; - List<IDataModel> selectedList = (List<IDataModel>) getProperty(selectedProperty); - List<IDataModel> allList = getProjectModels(); - if (selectedList.size() == allList.size()) { - for (int i = 0; i < selectedList.size() && allSelected; i++) { - if (!selectedList.contains(allList.get(i)) || !allList.contains(selectedList.get(i))) { - allSelected = false; - } - } - } else { - allSelected = false; - } - List<IDataModel> utilityModels = (List<IDataModel>) getProperty(listTypeProperty); - ArchiveWrapper currentArchive = null; - IDataModel currentUtilityModel = null; - boolean utilityJarsModified = false; - // Add missing - for (int i = 0; null != utilityJars && i < utilityJars.size(); i++) { - currentArchive = utilityJars.get(i); - boolean added = false; - for (int j = 0; utilityModels != null && j < utilityModels.size() && !added; j++) { - currentUtilityModel = (IDataModel) utilityModels.get(j); - if (currentUtilityModel.getProperty(IJavaUtilityJarImportDataModelProperties.ARCHIVE_WRAPPER) == currentArchive) { - added = true; - } - } - if (!added) { - if (!isPropertySet(listTypeProperty)) { - utilityModels = new ArrayList<IDataModel>(); - setProperty(listTypeProperty, utilityModels); - } - IDataModel localModel = DataModelFactory.createDataModel(new J2EEUtilityJarImportDataModelProvider()); - localModel.setProperty(IJavaUtilityJarImportDataModelProperties.ARCHIVE_WRAPPER, currentArchive); - localModel.setProperty(IJavaUtilityJarImportDataModelProperties.EAR_PROJECT_NAME, getStringProperty(PROJECT_NAME)); - localModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME)); - utilityModels.add(localModel); - localModel.addListener(nestedListener); - utilityJarsModified = true; - } - } // Remove extras - for (int i = utilityModels.size() - 1; i >= 0; i--) { - currentUtilityModel = (IDataModel) utilityModels.get(i); - currentArchive = (ArchiveWrapper) currentUtilityModel.getProperty(IJavaUtilityJarImportDataModelProperties.ARCHIVE_WRAPPER); - if (null == utilityJars || !utilityJars.contains(currentArchive)) { - currentUtilityModel.removeListener(nestedListener); - currentUtilityModel.dispose(); - utilityModels.remove(currentUtilityModel); - utilityJarsModified = true; - } - } - allList = getProjectModels(); - if (allSelected) { - List<IDataModel> newList = new ArrayList<IDataModel>(); - newList.addAll(allList); - setProperty(SELECTED_MODELS_LIST, newList); - } else { - trimSelection(); - } - if (utilityJarsModified) { - model.notifyPropertyChange(NESTED_PROJECTS_VALIDATION, IDataModel.VALUE_CHG); - } - } - - private List getModuleModels() { - ArchiveWrapper earWrapper = getArchiveWrapper(); - if (earWrapper == null) - return Collections.EMPTY_LIST; - cachedLoadError = null; - List<ArchiveWrapper> modules = earWrapper.getEarModules(); - List moduleModels = new ArrayList(); - List<ArchiveWrapper> clientJarArchives = new ArrayList(); - IDataModel localModel; - String earProjectName = getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - - List defaultModuleNames = new ArrayList(); - defaultModuleNames.add(earProjectName); - List collidingModuleNames = null; - Hashtable<IDataModel, ArchiveWrapper> ejbJarsWithClients = new Hashtable(); - for (int i = 0; i < modules.size(); i++) { - localModel = null; - ArchiveWrapper temp = modules.get(i); - try { - if (temp.isApplicationClientFile()) { - localModel = DataModelFactory.createDataModel(new AppClientComponentImportDataModelProvider()); - } else if (temp.isWARFile()) { - WebModuleExtension webExt = EarModuleManager.getWebModuleExtension(); - if (webExt != null) { - localModel = webExt.createImportDataModel(); - String ctxRt = temp.getWebContextRoot(); - if (null != ctxRt) { - localModel.setProperty(IAddWebComponentToEnterpriseApplicationDataModelProperties.CONTEXT_ROOT, ctxRt); - } - } - } else if (temp.isEJBJarFile()) { - EjbModuleExtension ejbExt = EarModuleManager.getEJBModuleExtension(); - if (ejbExt != null) { - localModel = ejbExt.createImportDataModel(); - } - try { - ArchiveWrapper clientArch = earWrapper.getEJBClientArchiveWrapper(temp); - if (null != clientArch) { - clientJarArchives.add(clientArch); - ejbJarsWithClients.put(localModel, clientArch); - } - } catch (Exception e) { - Logger.getLogger().logError(e); - } - - } else if (temp.isRARFile()) { - JcaModuleExtension rarExt = EarModuleManager.getJCAModuleExtension(); - if (rarExt != null) { - localModel = rarExt.createImportDataModel(); - } - } - if (localModel != null) { - localModel.setProperty(ARCHIVE_WRAPPER, temp); - localModel.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, earProjectName); - localModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME)); - localModel.addListener(this); - localModel.addListener(nestedListener); - moduleModels.add(localModel); - String moduleName = localModel.getStringProperty(IJ2EEFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - if (defaultModuleNames.contains(moduleName)) { - if (collidingModuleNames == null) { - collidingModuleNames = new ArrayList(); - } - collidingModuleNames.add(moduleName); - } else { - defaultModuleNames.add(moduleName); - } - } - } catch (Exception e) { - Logger.getLogger().logError("Error loading nested archive: " + temp.getPath().toOSString()); //$NON-NLS-1$ - Logger.getLogger().logError(e); - cachedLoadError = temp; - } - } - updateUtilityModels(clientJarArchives, EJB_CLIENT_LIST, EJB_CLIENT_LIST); - List<IDataModel> clientModelList = (List<IDataModel>) getProperty(EJB_CLIENT_LIST); - Enumeration<IDataModel> ejbModels = ejbJarsWithClients.keys(); - ejbJarModelsToClientJarModels.clear(); - clientJarModelsToEjbJarModels.clear(); - while (ejbModels.hasMoreElements()) { - IDataModel ejbModel = ejbModels.nextElement(); - ArchiveWrapper ejbClientArchiveWrapper = ejbJarsWithClients.get(ejbModel); - IDataModel clientModel = null; - for (int i = 0; clientModel == null && i < clientModelList.size(); i++) { - if (((ArchiveWrapper) clientModelList.get(i).getProperty(ARCHIVE_WRAPPER)).getUnderLyingArchive() == ejbClientArchiveWrapper.getUnderLyingArchive()) { - clientModel = clientModelList.get(i); - } - } - ejbJarModelsToClientJarModels.put(ejbModel, clientModel); - clientJarModelsToEjbJarModels.put(clientModel, ejbModel); - } - - for (int i = 0; collidingModuleNames != null && i < moduleModels.size(); i++) { - localModel = (IDataModel) moduleModels.get(i); - String moduleName = localModel.getStringProperty(IJ2EEModuleImportDataModelProperties.PROJECT_NAME); - if (collidingModuleNames.contains(moduleName)) { - ArchiveWrapper module = (ArchiveWrapper) localModel.getProperty(IJ2EEModuleImportDataModelProperties.ARCHIVE_WRAPPER); - String suffix = null; - if (module.isApplicationClientFile()) { - suffix = "_AppClient"; //$NON-NLS-1$ - } else if (module.isWARFile()) { - suffix = "_WEB"; //$NON-NLS-1$ - } else if (module.isEJBJarFile()) { - suffix = "_EJB"; //$NON-NLS-1$ - } else if (module.isRARFile()) { - suffix = "_JCA"; //$NON-NLS-1$ - } - if (defaultModuleNames.contains(moduleName + suffix)) { - int count = 1; - for (; defaultModuleNames.contains(moduleName + suffix + count) && count < 10; count++) - ; - suffix += count; - } - localModel.setProperty(IJ2EEModuleImportDataModelProperties.PROJECT_NAME, moduleName + suffix); - } - } - return moduleModels; - } - - protected int getType() { - return XMLResource.APPLICATION_TYPE; - } - - protected Archive openArchive(String uri) throws OpenFailureException { - return CommonarchiveFactory.eINSTANCE.openEARFile(getArchiveOptions(), uri); - } - - /* - * private EARFile getEARFile() { return (EARFile) getArchiveFile(); } - */ - /* - * public boolean handlesArchive(Archive anArchive) { List temp = new ArrayList(); List tempList = (List) - * getProperty(MODULE_MODELS_LIST); if (null != tempList) { temp.addAll(tempList); } tempList = (List) - * getProperty(EJB_CLIENT_LIST); if (null != tempList) { temp.addAll(tempList); } tempList = getSelectedModels(); - * for (int i = 0; i < tempList.size(); i++) { if (!temp.contains(tempList.get(i))) { temp.add(tempList.get(i)); } } - * IDataModel importDM = null; for (int i = 0; i < temp.size(); i++) { importDM = (IDataModel) temp.get(i); if - * (importDM.getProperty(ARCHIVE_WRAPPER) == anArchive) { return true; } } return false; } - */ - private List<IDataModel> getProjectModels() { - List<IDataModel> temp = new ArrayList<IDataModel>(); - List tempList = (List) getProperty(MODULE_MODELS_LIST); - if (null != tempList) { - temp.addAll(tempList); - } - tempList = (List) getProperty(UTILITY_MODELS_LIST); - if (null != tempList) { - temp.addAll(tempList); - } - tempList = (List) getProperty(EJB_CLIENT_LIST); - if (null != tempList) { - temp.addAll(tempList); - } - return temp; - } - - private List getUnhandledProjectModels() { - List handled = removeHandledModels(getProjectModels(), getProjectModels(), false); - List all = getProjectModels(); - all.removeAll(handled); - return all; - } - - public List getSelectedModels() { - return (List) getProperty(SELECTED_MODELS_LIST); - } - - private List removeHandledModels(List listToPrune, List modelsToCheck, boolean addModels) { - List newList = new ArrayList(); - newList.addAll(listToPrune); - // IDataModel localModel = null; - // for (int i = 0; i < modelsToCheck.size(); i++) { - // localModel = (IDataModel) modelsToCheck.get(i); - // model.extractHandled(newList, addModels); - // } - return newList; - } - - private List getHandledSelectedModels() { - List selectedModels = getSelectedModels(); - return removeHandledModels(selectedModels, selectedModels, true); - } - - /* - * public int getJ2EEVersion() { EARFile ef = getEARFile(); return null == ef ? J2EEVersionConstants.J2EE_1_2_ID : - * ArchiveUtil.getFastSpecVersion(ef); } - */ - - public boolean isPropertyEnabled(String propertyName) { - if (!super.isPropertyEnabled(propertyName)) { - return false; - } - if (propertyName.equals(USE_ANNOTATIONS)) { - if (getJ2EEVersion() < J2EEVersionConstants.VERSION_1_3) - return false; - return true; - } - return true; - } - - public void dispose() { - super.dispose(); - List list = getProjectModels(); - for (int i = 0; i < list.size(); i++) { - ((IDataModel) list.get(i)).dispose(); - } - } - - /** - * Do not use this it will be deleted post 2.0. This method will be moved to a utility class. - * @deprecated - * @param earFile - * @return - */ - public static List getAllUtilities(org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile earFile) { - List files = earFile.getFiles(); - List utilJars = new ArrayList(); - for (int i = 0; i < files.size(); i++) { - org.eclipse.jst.j2ee.commonarchivecore.internal.impl.FileImpl file = (org.eclipse.jst.j2ee.commonarchivecore.internal.impl.FileImpl) files.get(i); - if (file.isArchive() && !file.isModuleFile() && file.getURI().endsWith(".jar")) { //$NON-NLS-1$ - utilJars.add(file); - } - if (file.isWARFile()) { - utilJars.addAll(getWebLibs((org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile) file)); - } - } - return utilJars; - } - - /** - * Do not use this it will be deleted post 2.0 This method will be moved to a utility class. - * @deprecated - * @param warFile - * @return - */ - public static List getWebLibs(org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile warFile) { - return ((org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl) warFile).getLibArchives(); - } - - // TODO: Implement with J2EEArtifactImportDataModelProvider - /* - * public J2EEArtifactImportDataModel getMatchingEJBJarOrClient(J2EEArtifactImportDataModel model) { if - * (clientJarToEjbJarModels.containsKey(model)) { return (J2EEArtifactImportDataModel) - * clientJarToEjbJarModels.get(model); } else if (ejbJarToClientJarModels.containsKey(model)) { return - * (J2EEArtifactImportDataModel) ejbJarToClientJarModels.get(model); } else { return null; } } - */ - - protected IDataModel createJ2EEComponentCreationDataModel() { - return DataModelFactory.createDataModel(new EARFacetProjectCreationDataModelProvider()); - } - - public IDataModelOperation getDefaultOperation() { - return new EARComponentImportOperation(model); - } - - public void init() { - super.init(); - IDataModel componentCreationDM = model.getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION); - FacetDataModelMap map = (FacetDataModelMap) componentCreationDM.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); - IDataModel earFacet = map.getFacetDataModel( IJ2EEFacetConstants.ENTERPRISE_APPLICATION ); - earFacet.setBooleanProperty(IJ2EEFacetInstallDataModelProperties.GENERATE_DD, false); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IAddComponentToEnterpriseApplicationDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IAddComponentToEnterpriseApplicationDataModelProperties.java deleted file mode 100644 index 9b519183d..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IAddComponentToEnterpriseApplicationDataModelProperties.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; - -public interface IAddComponentToEnterpriseApplicationDataModelProperties extends ICreateReferenceComponentsDataModelProperties { - - - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IAnnotationsDataModel.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IAnnotationsDataModel.java deleted file mode 100644 index 8b8a47720..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IAnnotationsDataModel.java +++ /dev/null @@ -1,35 +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.application.internal.operations; - -/** - * The IAnnotationsDataModel is data model interface used by other data models in - * the WTP wizard and operation framework. - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperation - * - * This provides the USE_ANNOTATIONS property which is used to determine whether or - * not artifacts should be created using annotations or not. - * - * Subclasses may extend this interface to add their own properties. - * - * The use of this interface is EXPERIMENTAL and subject to substantial changes. - * - */ -public interface IAnnotationsDataModel { - - /** - * Optional, type Boolean to determine whether an artifact should be created with annotated tags. - * The default is set on the particular data model who implements this interface. - */ - public static final String USE_ANNOTATIONS = "IAnnotationsDataModel.useAnnotations"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IModuleExtensions.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IModuleExtensions.java deleted file mode 100644 index 19136e28a..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IModuleExtensions.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -public interface IModuleExtensions { - - public String DOT_WAR = ".war"; //$NON-NLS-1$ - public String DOT_JAR = ".jar"; //$NON-NLS-1$ - public String DOT_RAR = ".rar"; //$NON-NLS-1$ - public String DOT_EAR = ".ear"; //$NON-NLS-1$ - - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IUpdateModuleContextRootProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IUpdateModuleContextRootProperties.java deleted file mode 100644 index 9df847f4b..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/IUpdateModuleContextRootProperties.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 BEA Systems, Inc - * 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: - * rfrost@bea.com - initial API and impl - *******************************************************************************/ -package org.eclipse.jst.j2ee.application.internal.operations; - -import org.eclipse.wst.web.internal.operation.IWebProjectPropertiesUpdateDataModelProperties; - -/** - * Holds DataModelOperation properties for updating the context-root of modules in associated EAR application.xml files. - */ -public interface IUpdateModuleContextRootProperties extends IWebProjectPropertiesUpdateDataModelProperties { - /** - * ID for nexted IDataModel - */ - public static final String NESTED_MODEL_ID = "UpdateModuleContextRootModel"; //$NON-NLS-1$ - /** - * Name of property (in nested model) that holds a List of EAR IProjects. - */ - public static final String EARS_TO_UPDATE = "IUpdateModuleContextRootProperties.EARS_TO_UPDATE"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEArtifactExportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEArtifactExportDataModelProvider.java deleted file mode 100644 index 40dc35f06..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEArtifactExportDataModelProvider.java +++ /dev/null @@ -1,442 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -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.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.archive.IArchiveExportParticipant; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties; -import org.eclipse.jst.j2ee.internal.archive.ArchiveExportParticipantsExtensionPoint; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonMessages; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; -import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager; - -public abstract class J2EEArtifactExportDataModelProvider extends AbstractDataModelProvider implements IJ2EEComponentExportDataModelProperties { - - private static final class ArchiveExportParticipantData implements IArchiveExportParticipantData - { - private String id = null; - private IArchiveExportParticipant extension = null; - private IDataModel datamodel = null; - - public String getId() - { - return this.id; - } - - public IArchiveExportParticipant getParticipant() - { - return this.extension; - } - - public IDataModel getDataModel() - { - return this.datamodel; - } - } - - public HashMap componentMap; - - public J2EEArtifactExportDataModelProvider() { - super(); - } - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PROJECT_NAME); - propertyNames.add(ARCHIVE_DESTINATION); - propertyNames.add(EXPORT_SOURCE_FILES); - propertyNames.add(OVERWRITE_EXISTING); - propertyNames.add(RUN_BUILD); - propertyNames.add(COMPONENT); - propertyNames.add(OPTIMIZE_FOR_SPECIFIC_RUNTIME); - propertyNames.add(RUNTIME); - propertyNames.add(RUNTIME_SPECIFIC_PARTICIPANTS); - return propertyNames; - } - - protected abstract String getProjectType(); - - protected abstract String getWrongComponentTypeString(String projectName); - - protected abstract String getModuleExtension(); - - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(ARCHIVE_DESTINATION)) { - return ""; //$NON-NLS-1$ - } else if (propertyName.equals(EXPORT_SOURCE_FILES)) { - return Boolean.FALSE; - } else if (propertyName.equals(OVERWRITE_EXISTING)) { - return Boolean.FALSE; - } else if (propertyName.equals(RUN_BUILD)) { - return Boolean.TRUE; - } else if (propertyName.equals(RUNTIME_SPECIFIC_PARTICIPANTS)) { - return new ArrayList<IArchiveExportParticipantData>(); - } - return super.getDefaultProperty(propertyName); - } - - public boolean isPropertyEnabled( final String propertyName ) - { - if( propertyName.equals( OPTIMIZE_FOR_SPECIFIC_RUNTIME ) ) - { - return getDataModel().getValidPropertyDescriptors( RUNTIME ).length > 0; - } - else if( propertyName.equals( RUNTIME ) ) - { - return ( (Boolean) getProperty( OPTIMIZE_FOR_SPECIFIC_RUNTIME ) ).booleanValue(); - } - - return true; - } - - public boolean propertySet(String propertyName, Object propertyValue) - { - boolean set = super.propertySet(propertyName, propertyValue); - final IDataModel dm = getDataModel(); - - if (propertyName.equals(PROJECT_NAME)) { - if (getComponentMap().isEmpty()) - intializeComponentMap(); - IVirtualComponent component = (IVirtualComponent) getComponentMap().get(propertyValue); - if (null != component && component.getName().equals(propertyValue)) { - setProperty(COMPONENT, component); - } else { - setProperty(COMPONENT, null); - } - - dm.notifyPropertyChange( RUNTIME, IDataModel.VALID_VALUES_CHG ); - - IFacetedProject fproj = null; - - if( component != null ) - { - try - { - fproj = ProjectFacetsManager.create( component.getProject() ); - } - catch( CoreException e ) - { - J2EEPlugin.logError( -1, e.getMessage(), e ); - } - } - - boolean optimize = false; - IRuntime runtime = null; - - if( fproj != null ) - { - runtime = fproj.getPrimaryRuntime(); - - if( runtime != null ) - { - optimize = true; - } - else - { - final DataModelPropertyDescriptor[] validValues - = dm.getValidPropertyDescriptors( RUNTIME ); - - if( validValues.length > 0 ) - { - runtime = (IRuntime) validValues[ 0 ].getPropertyValue(); - } - } - } - - setProperty( OPTIMIZE_FOR_SPECIFIC_RUNTIME, optimize); - setProperty( RUNTIME, runtime ); - } - else if( propertyName.equals( OPTIMIZE_FOR_SPECIFIC_RUNTIME ) ) - { - dm.notifyPropertyChange( RUNTIME, IDataModel.ENABLE_CHG ); - } - else if( propertyName.equals( RUNTIME ) ) - { - final List<IArchiveExportParticipantData> currentExtDataList - = (List<IArchiveExportParticipantData>) getProperty( RUNTIME_SPECIFIC_PARTICIPANTS ); - - if( currentExtDataList != null ) - { - for( IArchiveExportParticipantData extData : currentExtDataList ) - { - dm.removeNestedModel( extData.getId() ); - } - } - - final List<IArchiveExportParticipantData> extensions = new ArrayList<IArchiveExportParticipantData>(); - - if( propertyValue != null ) - { - final IProject project = getProject(); - - if( project != null && propertyValue != null ) - { - final IRuntime runtime = (IRuntime) propertyValue; - - for( ArchiveExportParticipantsExtensionPoint.ParticipantInfo partInfo - : ArchiveExportParticipantsExtensionPoint.getExtensions( project, runtime ) ) - { - ArchiveExportParticipantData partData = new ArchiveExportParticipantData(); - partData.id = partInfo.getId(); - partData.extension = partInfo.loadParticipant(); - - if( partData.extension != null ) - { - try - { - partData.datamodel = partData.extension.createDataModel( dm ); - dm.addNestedModel( partData.id, partData.datamodel ); - } - catch( Exception e ) - { - J2EEPlugin.logError( -1, e.getMessage(), e ); - partData = null; - } - } - else - { - partData = null; - } - - if( partData != null ) - { - extensions.add( partData ); - } - } - } - } - - setProperty( RUNTIME_SPECIFIC_PARTICIPANTS, Collections.unmodifiableList( extensions ) ); - } - - return set; - } - - public HashMap getComponentMap() { - if (componentMap == null) - componentMap = new HashMap(); - return componentMap; - } - - public void intializeComponentMap() { - IVirtualComponent[] comps = ComponentUtilities.getAllWorkbenchComponents(); - for (int i = 0; i < comps.length; i++) { - getComponentMap().put(comps[i].getName(), comps[i]); - } - } - - /** - * Populate the resource name combo with projects that are not encrypted. - */ - public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { - // TODO: populate valid components - if (propertyName.equals(PROJECT_NAME)) { - List componentNames = new ArrayList(); - IVirtualComponent[] wbComps = ComponentUtilities.getAllWorkbenchComponents(); - - List relevantComponents = new ArrayList(); - for (int i = 0; i < wbComps.length; i++) { - if (J2EEProjectUtilities.getJ2EEProjectType(wbComps[i].getProject()).equals(getProjectType())) { - relevantComponents.add(wbComps[i]); - getComponentMap().put(wbComps[i].getName(), wbComps[i]); - } - } - - if (relevantComponents == null || relevantComponents.size() == 0) - return null; - - for (int j = 0; j < relevantComponents.size(); j++) { - componentNames.add(((IVirtualComponent) relevantComponents.get(j)).getName()); - } - String[] names = (String[]) componentNames.toArray(new String[componentNames.size()]); - - return DataModelPropertyDescriptor.createDescriptors(names); - } - else if( propertyName.equals( RUNTIME ) ) - { - final List<IRuntime> runtimes = new ArrayList<IRuntime>(); - final IVirtualComponent component = (IVirtualComponent) getProperty( COMPONENT ); - - if( component != null ) - { - if( component != null ) - { - try - { - final IFacetedProject fproj = ProjectFacetsManager.create( component.getProject() ); - - for( IRuntime runtime : RuntimeManager.getRuntimes() ) - { - if( fproj.isTargetable( runtime ) ) - { - runtimes.add( runtime ); - } - } - - final Comparator<IRuntime> comparator = new Comparator<IRuntime>() - { - public int compare( final IRuntime r1, - final IRuntime r2 ) - { - return r1.getName().compareTo( r2.getName() ); - } - }; - - Collections.sort( runtimes, comparator ); - } - catch( CoreException e ) - { - J2EEPlugin.logError( -1, e.getMessage(), e ); - } - } - } - - return DataModelPropertyDescriptor.createDescriptors( runtimes.toArray() ); - } - - return super.getValidPropertyDescriptors(propertyName); - // (ProjectUtilities.getProjectNamesWithoutForwardSlash((String[]) - // projectsWithNature.toArray(new String[projectsWithNature.size()]))); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#doValidateProperty(java.lang.String) - */ - public IStatus validate(String propertyName) { - if (PROJECT_NAME.equals(propertyName)) { - String projectName = (String) model.getProperty(PROJECT_NAME); - if (projectName == null || projectName.equals("")) //$NON-NLS-1$ - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.MODULE_EXISTS_ERROR)); - IVirtualComponent component = (IVirtualComponent) componentMap.get(projectName); - if (component == null) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.MODULE_EXISTS_ERROR)); - } - if (!J2EEProjectUtilities.getJ2EEProjectType(component.getProject()).equals(getProjectType())) { - return WTPCommonPlugin.createErrorStatus(getWrongComponentTypeString(projectName)); - } - } - if (ARCHIVE_DESTINATION.equals(propertyName)) { - String archiveLocation = (String) model.getProperty(ARCHIVE_DESTINATION); - if (!model.isPropertySet(ARCHIVE_DESTINATION) || archiveLocation.equals("")) { //$NON-NLS-1$ - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.DESTINATION_INVALID)); //); - } else if (model.isPropertySet(ARCHIVE_DESTINATION) && !validateModuleType(archiveLocation)) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.DESTINATION_ARCHIVE_SHOULD_END_WITH, new Object[]{getModuleExtension()})); //); - } else if (model.isPropertySet(ARCHIVE_DESTINATION)) { - IStatus tempStatus = validateLocation(archiveLocation); - if (tempStatus != OK_STATUS) - return tempStatus; - } - } - if (ARCHIVE_DESTINATION.equals(propertyName) || OVERWRITE_EXISTING.equals(propertyName)) { - String location = (String) getProperty(ARCHIVE_DESTINATION); - if (checkForExistingFileResource(location)) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.RESOURCE_EXISTS_ERROR, new Object[]{location})); - } - } - return OK_STATUS; - } - - private IStatus validateLocation(String archiveLocation) { - IPath path = null; - try { - path = new Path(archiveLocation); - } catch (IllegalArgumentException ex) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.DESTINATION_INVALID)); - } - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IStatus status = workspace.validateName(path.lastSegment(), IResource.FILE); - if (!status.isOK()) { - return status; - } - String device = path.getDevice(); - if (device == null) - return OK_STATUS; - if (path == null || device.length() == 1 && device.charAt(0) == IPath.DEVICE_SEPARATOR) - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.DESTINATION_INVALID)); - - if (!path.toFile().canWrite()) { - if (path.toFile().exists()) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.IS_READ_ONLY)); - } - boolean OK = false; - path = path.removeLastSegments(1); - for (int i = 1; !OK && i < 20 && path.segmentCount() > 0; i++) { - if (path.toFile().exists()) { - OK = true; - } - status = workspace.validateName(path.lastSegment(), IResource.FOLDER); - if (!status.isOK()) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.DESTINATION_INVALID)); - } - path = path.removeLastSegments(1); - } - } - - return OK_STATUS; - } - - private boolean checkForExistingFileResource(String fileName) { - if (!model.getBooleanProperty(OVERWRITE_EXISTING)) { - java.io.File externalFile = new java.io.File(fileName); - if (externalFile != null && externalFile.exists()) - return true; - } - return false; - } - - private boolean validateModuleType(String archive) { - if ((archive.length() < 4) || (!(archive.substring(archive.length() - 4, archive.length()).equalsIgnoreCase(getModuleExtension())))) { - return false; - } - return true; - } - - private IProject getProject() - { - final IVirtualComponent component = (IVirtualComponent) getProperty( COMPONENT ); - - if( component != null ) - { - return component.getProject(); - } - else - { - return null; - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEArtifactImportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEArtifactImportDataModelProvider.java deleted file mode 100644 index 80e4a9327..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEArtifactImportDataModelProvider.java +++ /dev/null @@ -1,364 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.application.internal.operations; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper; -import org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities; -import org.eclipse.jst.j2ee.internal.project.J2EECreationResourceHandler; -import org.eclipse.jst.jee.archive.ArchiveOpenFailureException; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider; -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.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonMessages; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -public abstract class J2EEArtifactImportDataModelProvider extends AbstractDataModelProvider implements IJ2EEComponentImportDataModelProperties, IDataModelListener { - - private static final String USE_DEFAULT_PROJECT_NAME = "J2EEArtifactImportDataModelProvider.USE_DEFAULT_PROJECT_NAME"; //$NON-NLS-1$ - - public static final String FACET_RUNTIME = "IJ2EEArtifactImportDataModelProperties.FACET_RUNTIME"; //$NON-NLS-1$ - - private IDataModel componentCreationDM; - private Throwable archiveOpenFailure = null; - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(FILE_NAME); - propertyNames.add(FILE); - propertyNames.add(SAVE_FILTER); - propertyNames.add(OVERWRITE_HANDLER); - propertyNames.add(CLOSE_ARCHIVE_ON_DISPOSE); - propertyNames.add(USE_DEFAULT_PROJECT_NAME); - propertyNames.add(PROJECT_NAME); - propertyNames.add(COMPONENT); - propertyNames.add( FACET_RUNTIME ); - propertyNames.add(ARCHIVE_WRAPPER); - return propertyNames; - } - - public void init() { - super.init(); - componentCreationDM = createJ2EEComponentCreationDataModel(); - componentCreationDM.setBooleanProperty(FacetProjectCreationDataModelProvider.FORCE_VERSION_COMPLIANCE, false); - componentCreationDM.addListener(this); - model.addNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION, componentCreationDM); - } - - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(CLOSE_ARCHIVE_ON_DISPOSE)) { - return Boolean.TRUE; - } else if (propertyName.equals(USE_DEFAULT_PROJECT_NAME)) { - return Boolean.TRUE; - }else if( propertyName.equals(COMPONENT)){ - String projectName = getStringProperty(PROJECT_NAME); - IProject project = ProjectUtilities.getProject(projectName); - return ComponentCore.createComponent(project); - } - return super.getDefaultProperty(propertyName); - } - - private boolean settingFileName = false; - - public boolean propertySet(String propertyName, Object propertyValue) { - if (propertyName.equals(ARCHIVE_WRAPPER)) { - if(propertyValue != null){ - if (!settingFileName) { - setProperty(FILE_NAME, null); - } - updateDefaultComponentName(); - } - return true; - } else if(propertyName.equals(FILE)){ - if(propertyValue != null){ - if(!settingFileName) { - ArchiveWrapper archiveWrapper = getArchiveWrapper(); - if(null == archiveWrapper || archiveWrapper.getCommonArchive() != propertyValue){ - archiveWrapper = new ArchiveWrapper((Archive)propertyValue); - setProperty(ARCHIVE_WRAPPER, archiveWrapper); - } - } - } - } else if (propertyName.equals(SAVE_FILTER) && getArchiveWrapper() != null && getArchiveWrapper().getCommonArchive() != null) { - getArchiveWrapper().getCommonArchive().setSaveFilter(getSaveFilter()); - } else if (FILE_NAME.equals(propertyName)) { - try { - archiveOpenFailure = null; - handleArchiveSetup((String) propertyValue); - } catch (OpenFailureException oe) { - archiveOpenFailure = oe; - } catch (ArchiveOpenFailureException e) { - archiveOpenFailure = e; - } - } else if( COMPONENT.equals(propertyName)){ - throw new RuntimeException(propertyName + " should not be set."); //$NON-NLS-1$ - }else if (PROJECT_NAME.equals(propertyName)) { - List nestedModels = new ArrayList(model.getNestedModels()); - IDataModel nestedModel = null; - for (int i = 0; i < nestedModels.size(); i++) { - nestedModel = (IDataModel) nestedModels.get(i); - try { - nestedModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, propertyValue); - } catch (Exception e) { - Logger.getLogger().logError(e); - } - } - } else if( FACET_RUNTIME.equals( propertyName )){ - throw new RuntimeException(propertyName + " should not be set."); //$NON-NLS-1$ - } - return true; - } - - private boolean doingComponentUpdate; - - private void updateDefaultComponentName() { - ArchiveWrapper wrapper = getArchiveWrapper(); - if (null != wrapper && getBooleanProperty(USE_DEFAULT_PROJECT_NAME)) { - try { - doingComponentUpdate = true; - IPath path = wrapper.getPath(); - String defaultProjectName = path.segment(path.segmentCount() - 1); - if (defaultProjectName.indexOf('.') > 0) { - defaultProjectName = defaultProjectName.substring(0, defaultProjectName.lastIndexOf('.')); - } - setProperty(PROJECT_NAME, defaultProjectName); - } finally { - doingComponentUpdate = false; - } - - } - } - - private boolean handleArchiveSetup(String fileName) throws OpenFailureException, ArchiveOpenFailureException { - try { - settingFileName = true; - ArchiveWrapper wrapper = getArchiveWrapper(); - if (wrapper!= null) { - wrapper.close(); - setProperty(FILE, null); - setProperty(ARCHIVE_WRAPPER, null); - } - String uri = getStringProperty(FILE_NAME); - if (!archiveExistsOnFile()) - return false; - wrapper = openArchiveWrapper(uri); - if(wrapper != null){ - setProperty(ARCHIVE_WRAPPER, wrapper); - if(wrapper.getCommonArchive() != null){ - setProperty(FILE, wrapper.getCommonArchive()); - } - } - return wrapper!= null; - } finally { - settingFileName = false; - } - - } - - protected ArchiveWrapper openArchiveWrapper(String uri) throws OpenFailureException, ArchiveOpenFailureException{ - IArchive archive = null; - IPath path = new Path(uri); - archive = JavaEEArchiveUtilities.INSTANCE.openArchive(path); - archive.getArchiveOptions().setOption(JavaEEArchiveUtilities.DISCRIMINATE_EJB_ANNOTATIONS, Boolean.TRUE); - archive.setPath(path); - JavaEEQuickPeek jqp = JavaEEArchiveUtilities.INSTANCE.getJavaEEQuickPeek(archive); - - if(jqp.getJavaEEVersion() == J2EEConstants.UNKNOWN && jqp.getType() == J2EEConstants.UNKNOWN){ - handleUnknownType(jqp); - } - - return new ArchiveWrapper(archive); - } - /** - * This method allows subclasses to handle an unknown archive type. - * @param jqp - */ - protected void handleUnknownType(JavaEEQuickPeek jqp) { - } - - protected abstract Archive openArchive(String uri) throws OpenFailureException; - - private boolean closeArchive() { - if (null != getArchiveWrapper()) { - getArchiveWrapper().close(); - } - return true; - } - - public IStatus validate(String propertyName) { - if (FILE_NAME.equals(propertyName) && !isPropertySet(ARCHIVE_WRAPPER)) { - String fileName = getStringProperty(propertyName); - if (fileName == null || fileName.length() == 0) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.ARCHIVE_FILE_NAME_EMPTY_ERROR, new Object[]{ArchiveUtil.getModuleFileTypeName(getType())})); - } else if (archiveOpenFailure != null) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(archiveOpenFailure.getMessage())); - } else if (fileName != null && !archiveExistsOnFile()) { - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.FILE_DOES_NOT_EXIST_ERROR, new Object[]{ArchiveUtil.getModuleFileTypeName(getType())})); - } - } else if (NESTED_MODEL_J2EE_COMPONENT_CREATION.equals(propertyName) ) { - return getDataModel().getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION).validate(true); - } else if(FACET_RUNTIME.equals(propertyName)){ - return validateVersionSupportedByServer(); - } - return OK_STATUS; - } - - protected int getJ2EEVersion() { - return 0; - } - - protected abstract IDataModel createJ2EEComponentCreationDataModel(); - - /* - * @see XMLResource#APP_CLIENT_TYPE - * @see XMLResource#APPLICATION_TYPE - * @see XMLResource#EJB_TYPE - * @see XMLResource#WEB_APP_TYPE - * @see XMLResource#RAR_TYPE - */ - protected abstract int getType(); - - private boolean archiveExistsOnFile() { - String jarName = (String) getProperty(FILE_NAME); - if (jarName != null && jarName.length() > 0) { - java.io.File file = new java.io.File(jarName); - return file.exists() && !file.isDirectory(); - } - return false; - } - - public void dispose() { - if (getBooleanProperty(CLOSE_ARCHIVE_ON_DISPOSE)) - closeArchive(); - super.dispose(); - } - - protected final void setArchiveFile(Archive archiveFile) { - setProperty(FILE, archiveFile); - } - - protected final ArchiveWrapper getArchiveWrapper(){ - return (ArchiveWrapper)getProperty(ARCHIVE_WRAPPER); - } - - /** - * @deprecated - * @return use ARCHIVE_WRAPPER - */ - protected final Archive getArchiveFile() { - return (Archive) getProperty(FILE); - } - - protected final ArchiveOptions getArchiveOptions() { - ArchiveOptions opts = new ArchiveOptions(); - opts.setIsReadOnly(true); - return opts; - } - - private SaveFilter getSaveFilter() { - return (SaveFilter) getProperty(SAVE_FILTER); - } - - public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { - return super.getValidPropertyDescriptors(propertyName); - } - - public void propertyChanged(DataModelEvent event) { - if (!doingComponentUpdate && event.getDataModel() == componentCreationDM && event.getPropertyName().equals(PROJECT_NAME) && getBooleanProperty(USE_DEFAULT_PROJECT_NAME)) { - setBooleanProperty(USE_DEFAULT_PROJECT_NAME, false); - } - if( event.getDataModel() == componentCreationDM && event.getPropertyName().equals(IFacetProjectCreationDataModelProperties.FACET_RUNTIME)){ - model.notifyPropertyChange(FACET_RUNTIME, IDataModel.DEFAULT_CHG); - } - } - - /** - * Calling this method will fixup the JST facet version if it is incompatible with the selected runtime - * It should be called when the Server Runtime or the Archive properties are set. - * @return - */ - protected IStatus validateVersionSupportedByServer(){ - if( model.isPropertySet(ARCHIVE_WRAPPER) && model.isPropertySet(IFacetProjectCreationDataModelProperties.FACET_RUNTIME)){ - IDataModel projectModel = model.getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION); - FacetDataModelMap map = (FacetDataModelMap) projectModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); - Collection projectFacets = (Collection)getProperty(FacetProjectCreationDataModelProvider.REQUIRED_FACETS_COLLECTION); - - IRuntime runtime = (IRuntime) getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); - if(runtime != null){ - for(Iterator iterator = projectFacets.iterator(); iterator.hasNext();){ - IDataModel facetDataModel = map.getFacetDataModel(((IProjectFacet)iterator.next()).getId()); - IProjectFacetVersion facetVersion = (IProjectFacetVersion)facetDataModel.getProperty(IFacetDataModelProperties.FACET_VERSION); - if(facetVersion.getProjectFacet().getId().equals(IModuleConstants.JST_JAVA)){ - Set set = Collections.singleton(facetVersion.getProjectFacet()); - try { - Set correctSet = runtime.getDefaultFacets(set); - IProjectFacetVersion correctVersion = null; - Iterator correctVersions = correctSet.iterator(); - while(correctVersions.hasNext() && correctVersion == null){ - IProjectFacetVersion version = (IProjectFacetVersion)correctVersions.next(); - if(version.getProjectFacet().getId().equals(IModuleConstants.JST_JAVA)){ - correctVersion = version; - } - } - - if(correctVersion != null){ - if(!facetVersion.equals(correctVersion)){ - facetDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION, correctVersion); - facetVersion = correctVersion; - } - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } - - if(!runtime.supports(facetVersion)){ - return WTPCommonPlugin.createErrorStatus( J2EECreationResourceHandler.VERSION_NOT_SUPPORTED ); //$NON-NLS-1$ - } - } - } - } - return OK_STATUS; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEComponentExportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEComponentExportDataModelProvider.java deleted file mode 100644 index b302081cc..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEComponentExportDataModelProvider.java +++ /dev/null @@ -1,18 +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.application.internal.operations; - -public abstract class J2EEComponentExportDataModelProvider extends J2EEArtifactExportDataModelProvider { - - public J2EEComponentExportDataModelProvider() { - super(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEComponentImportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEComponentImportDataModelProvider.java deleted file mode 100644 index dc57589ab..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEComponentImportDataModelProvider.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.application.internal.operations; - -import java.util.Set; - -import org.eclipse.jst.common.project.facet.JavaFacetUtils; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEModuleImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper; -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.IDataModel; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -/** - * This dataModel is a common super class used to import J2EE Modules. - * - * This class (and all its fields and methods) is likely to change during the WTP 1.0 milestones as - * the new project structures are adopted. Use at your own risk. - * - * @plannedfor WTP 1.0 - */ -public abstract class J2EEComponentImportDataModelProvider extends J2EEArtifactImportDataModelProvider implements IJ2EEModuleImportDataModelProperties { - - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(EXTENDED_IMPORT_FACTORY); - return propertyNames; - } - - protected int getModuleSpecVersion() { - ArchiveWrapper wrapper = getArchiveWrapper(); - return wrapper.getJavaEEQuickPeek().getVersion(); - } - - /** - * @deprecated use #IARCHIVE_WRAPPER - */ - protected ModuleFile getModuleFile() { - return (ModuleFile) getArchiveFile(); - } - - /** - * Updates the Java Facet Version so it is compliant with the Java EE Module version - */ - protected void updateJavaFacetVersion() { - ArchiveWrapper wrapper = getArchiveWrapper(); - int javaEEVersion = wrapper.getJavaEEQuickPeek().getJavaEEVersion(); - IProjectFacetVersion javaFacetVersion = null; - switch (javaEEVersion){ - case J2EEVersionConstants.J2EE_1_2_ID: - case J2EEVersionConstants.J2EE_1_3_ID: - javaFacetVersion = JavaFacetUtils.JAVA_13; - break; - case J2EEVersionConstants.J2EE_1_4_ID: - javaFacetVersion = JavaFacetUtils.JAVA_14; - break; - case J2EEVersionConstants.JEE_5_0_ID: - javaFacetVersion = JavaFacetUtils.JAVA_50; - break; - } - if(javaFacetVersion != null){ - IDataModel moduleDM = model.getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION); - FacetDataModelMap map = (FacetDataModelMap) moduleDM.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); - IDataModel javaFacetDataModel = map.getFacetDataModel( J2EEProjectUtilities.JAVA ); - javaFacetDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION, javaFacetVersion); - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportAssistantOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportAssistantOperation.java deleted file mode 100644 index 641eb6a5a..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportAssistantOperation.java +++ /dev/null @@ -1,197 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.AbstractOperation; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IPathVariableManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -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.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jdt.core.IAccessRule; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public abstract class J2EEUtilityJarImportAssistantOperation extends AbstractOperation { - - private File utilityJar; - - private boolean overwriteIfNecessary = false; - private String associatedEARProjectName; - - public J2EEUtilityJarImportAssistantOperation(String label, File utilityJar) { - super(label); - this.utilityJar = utilityJar; - } - - public void setAssociatedEARProjectName(String associatedEARProjectName) { - this.associatedEARProjectName = associatedEARProjectName; - } - - - public void setOverwriteIfNecessary(boolean overwriteProject) { - this.overwriteIfNecessary = overwriteProject; - } - - protected final void createLinkedPathVariable(String linkedPathVariable, File archiveFile) throws CoreException { - IPathVariableManager manager = ResourcesPlugin.getWorkspace().getPathVariableManager(); - IPath linkedPath = new Path(archiveFile.getAbsolutePath()); - manager.setValue(linkedPathVariable, linkedPath); - - } - - protected final String getUtilityJarProjectName(File utilityJar) { - String name = null; - if (utilityJar != null) { - int len = utilityJar.getName().lastIndexOf('.'); - name = utilityJar.getName().substring(0, len); - } - return name; - } - - protected final IStatus linkArchiveToEAR(IProject earProject, String uriMapping, IProject utilityProject, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException, ExecutionException { - IDataModel addArchiveProjectToEARDataModel = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider()); - - IVirtualComponent earcomponent = ComponentCore.createComponent(earProject); - IVirtualComponent utilcomponent = ComponentCore.createComponent(utilityProject); - - addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earcomponent); - addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, Collections.singletonList(utilcomponent)); - Map uriMap = new HashMap(); - uriMap.put(utilcomponent, uriMapping); - addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, uriMap); - return addArchiveProjectToEARDataModel.getDefaultOperation().execute(monitor, null); - } - - protected final IStatus createVirtualArchiveComponent(IProject targetProject, String uriMapping, IFile utilityJarIFile, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException, ExecutionException { - IDataModel addArchiveProjectToEARDataModel = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider()); - - IVirtualComponent earcomponent = ComponentCore.createComponent(targetProject); - - IVirtualComponent utilcomponent = ComponentCore.createArchiveComponent(targetProject, VirtualArchiveComponent.LIBARCHIVETYPE + IPath.SEPARATOR + utilityJarIFile.getProjectRelativePath().toString()); - - addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earcomponent); - addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, Collections.singletonList(utilcomponent)); - Map uriMap = new HashMap(); - uriMap.put(utilcomponent, uriMapping); - addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, uriMap); - return addArchiveProjectToEARDataModel.getDefaultOperation().execute(monitor, null); - } - - - protected final IStatus removeRootMapping(IVirtualComponent sourceComponent, String uriMapping, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException, ExecutionException { - - try { - sourceComponent.getRootFolder().removeLink(new Path(uriMapping), 0, monitor); - } catch (CoreException e) { - return J2EEPlugin.createErrorStatus(0, e.getMessage(), e); - } - return Status.OK_STATUS; - } - - protected File getUtilityJar() { - return utilityJar; - } - - protected final IWorkspaceRoot getWorkspaceRoot() { - return ResourcesPlugin.getWorkspace().getRoot(); - } - - - protected final String getAssociatedEARProjectName() { - return associatedEARProjectName; - } - - protected final boolean isOverwriteIfNecessary() { - return overwriteIfNecessary; - } - - protected final void addLibraryToClasspath(IProject associatedEARProject, IFile copiedJarFile, IProgressMonitor monitor) throws CoreException, JavaModelException { - if (associatedEARProject.hasNature(JavaCore.NATURE_ID)) { - - IClasspathEntry entry = JavaCore.newLibraryEntry(copiedJarFile.getFullPath().makeAbsolute(), null, // source - // attachment - null, // source attachment root - new IAccessRule[0], // accessRules - new IClasspathAttribute[0], // extraAttributes - false); // isExported - - IJavaProject earJavaProject = JavaCore.create(associatedEARProject); - IClasspathEntry[] rawClasspath = earJavaProject.getRawClasspath(); - IClasspathEntry[] newClasspath = new IClasspathEntry[rawClasspath.length + 1]; - System.arraycopy(rawClasspath, 0, newClasspath, 0, rawClasspath.length); - newClasspath[rawClasspath.length] = entry; - earJavaProject.setRawClasspath(newClasspath, monitor); - - } - } - - protected final IStatus createLinkedArchive(IProject project, String linkedFileName, File archiveFile, String linkedPathVariable, IProgressMonitor monitor) throws CoreException { - IFile linkedJarFile = null; - IPath pathToArchive = getLinkedPath(archiveFile, linkedPathVariable); - - linkedJarFile = project.getFile(linkedFileName); - if (linkedJarFile.exists()) { - if (isOverwriteIfNecessary()) - linkedJarFile.delete(true, true, new SubProgressMonitor(monitor, 1)); - else - return J2EEPlugin.createErrorStatus(0, NLS.bind(EARCreationResourceHandler.CreateProjectWithLinkedJarOperation_File_already_exists_0_, linkedJarFile.getFullPath()), null); - } - linkedJarFile.createLink(pathToArchive, IResource.ALLOW_MISSING_LOCAL, new SubProgressMonitor(monitor, 1)); - - addLibraryToClasspath(project, linkedJarFile, monitor); - return Status.OK_STATUS; - } - - protected final IPath getLinkedPath(File archiveFile, String linkedPathVariable) throws CoreException { - - if (linkedPathVariable == null || linkedPathVariable.length() == 0) - return new Path(archiveFile.getAbsolutePath()); - else { - createLinkedPathVariable(linkedPathVariable, archiveFile.getParentFile()); - return new Path(linkedPathVariable).append(archiveFile.getName()); - } - } - - protected final String findUniqueLocation(String baseLocation, String proposedProjectName) { - - return baseLocation != null ? (baseLocation + File.separator + proposedProjectName) : null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportDataModelProvider.java deleted file mode 100644 index 37ee68a78..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportDataModelProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Dec 15, 2003 - * - * To change the template for this generated file go to Window - Preferences - - * Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.application.internal.operations; - -import java.util.Set; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.datamodel.properties.IJavaUtilityJarImportDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.UtilityProjectCreationDataModelProvider; -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 J2EEUtilityJarImportDataModelProvider extends J2EEArtifactImportDataModelProvider implements IJavaUtilityJarImportDataModelProperties { - - public static String J2EE_UTILITY_JAR_IMPORT_DMP_ID = "j2eeUtilityJarImportDataModelProvider"; - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(EAR_PROJECT_NAME); - return propertyNames; - } - - protected Archive openArchive(String uri) throws OpenFailureException { - return null; - } - - protected int getType() { - return 0; - } - - public IDataModelOperation getDefaultOperation() { - return new J2EEUtilityJarImportOperationNew(model); - } - - protected IDataModel createJ2EEComponentCreationDataModel() { - return DataModelFactory.createDataModel(new UtilityProjectCreationDataModelProvider()); - } - - public String getID() { - - return J2EE_UTILITY_JAR_IMPORT_DMP_ID; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportOperationNew.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportOperationNew.java deleted file mode 100644 index d19a082be..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarImportOperationNew.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.application.internal.operations; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy; -import org.eclipse.jst.j2ee.internal.archive.ComponentArchiveSaveAdapter; -import org.eclipse.jst.j2ee.internal.archive.J2EEJavaComponentArchiveSaveAdapter; -import org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifactImportOperation; -import org.eclipse.jst.j2ee.internal.archive.operations.J2EEJavaComponentSaveStrategyImpl; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * @author jsholl - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class J2EEUtilityJarImportOperationNew extends J2EEArtifactImportOperation { - - public J2EEUtilityJarImportOperationNew(IDataModel dataModel) { - super(dataModel); - } - - protected ComponentArchiveSaveAdapter getArchiveSaveAdapter(IVirtualComponent virtualComponent){ - return new J2EEJavaComponentArchiveSaveAdapter(virtualComponent); - } - - protected SaveStrategy createSaveStrategy(IVirtualComponent virtualComponent) { - J2EEJavaComponentSaveStrategyImpl saveStrat = new J2EEJavaComponentSaveStrategyImpl(virtualComponent); - return saveStrat; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarListImportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarListImportDataModelProvider.java deleted file mode 100644 index 8f42d3014..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarListImportDataModelProvider.java +++ /dev/null @@ -1,348 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IPathVariableManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEUtilityJarListImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.project.facet.EARFacetUtils; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -/** - * @author mdelder - * - */ -public class J2EEUtilityJarListImportDataModelProvider extends AbstractDataModelProvider implements IJ2EEUtilityJarListImportDataModelProperties { - - - - private static final Object[] EMPTY_ARRAY = new Object[0]; - - public J2EEUtilityJarListImportDataModelProvider() { - super(); - } - - public Set getPropertyNames(){ - Set propertyNames = super.getPropertyNames(); - propertyNames.add(EAR_PROJECT_NAME); - propertyNames.add(CREATE_PROJECT); - propertyNames.add(LINK_IMPORT); - propertyNames.add(CREATE_LINKED_PROJECT); - propertyNames.add(COPY); - propertyNames.add(BINARY_IMPORT); - propertyNames.add(UTILITY_JAR_LIST); - propertyNames.add(AVAILABLE_JARS_DIRECTORY); - propertyNames.add(PROJECT_ROOT); - propertyNames.add(OVERRIDE_PROJECT_ROOT); - propertyNames.add(OVERWRITE_IF_NECESSARY); - propertyNames.add(CREATE_LINKED_PATH_VARIABLE); - propertyNames.add(LINKED_PATH_VARIABLE); - return propertyNames; - } - - public boolean propertySet(String propertyName, Object propertyValue) { - - boolean notify = super.propertySet(propertyName, propertyValue); - - if (AVAILABLE_JARS_DIRECTORY.equals(propertyName)) { - setProperty(UTILITY_JAR_LIST, EMPTY_ARRAY); - } else if (UTILITY_JAR_LIST.equals(propertyName)) { - if (propertyValue == null) - setProperty(UTILITY_JAR_LIST, EMPTY_ARRAY); - else - model.setProperty(UTILITY_JAR_LIST, propertyValue); - - } else if (PROJECT_ROOT.equals(propertyName)) { - if (propertyValue == null || ((String) propertyValue).length() == 0) - setBooleanProperty(OVERRIDE_PROJECT_ROOT, false); - else - setBooleanProperty(OVERRIDE_PROJECT_ROOT, true); - - } else if (J2EEUtilityJarListImportDataModelProvider.CREATE_PROJECT.equals(propertyName) && getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_PROJECT)) { - - setBooleanProperty(LINK_IMPORT, false); - setBooleanProperty(CREATE_LINKED_PROJECT, false); - setBooleanProperty(COPY, false); - - model.notifyPropertyChange(BINARY_IMPORT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(OVERRIDE_PROJECT_ROOT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(PROJECT_ROOT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(CREATE_LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - - } else if (J2EEUtilityJarListImportDataModelProvider.LINK_IMPORT.equals(propertyName) && getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.LINK_IMPORT)) { - - setBooleanProperty(CREATE_PROJECT, false); - setBooleanProperty(CREATE_LINKED_PROJECT, false); - setBooleanProperty(COPY, false); - - model.notifyPropertyChange(BINARY_IMPORT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(OVERRIDE_PROJECT_ROOT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(PROJECT_ROOT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(CREATE_LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - - } else if (J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PROJECT.equals(propertyName) && getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PROJECT)) { - - setBooleanProperty(LINK_IMPORT, false); - setBooleanProperty(CREATE_PROJECT, false); - setBooleanProperty(COPY, false); - - model.notifyPropertyChange(BINARY_IMPORT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(OVERRIDE_PROJECT_ROOT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(PROJECT_ROOT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(CREATE_LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - - } else if (J2EEUtilityJarListImportDataModelProvider.COPY.equals(propertyName) && getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.COPY)) { - - setBooleanProperty(CREATE_PROJECT, false); - setBooleanProperty(LINK_IMPORT, false); - setBooleanProperty(CREATE_LINKED_PROJECT, false); - - model.notifyPropertyChange(BINARY_IMPORT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(OVERRIDE_PROJECT_ROOT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(PROJECT_ROOT, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(CREATE_LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - - - } else if (J2EEUtilityJarListImportDataModelProvider.OVERRIDE_PROJECT_ROOT.equals(propertyName)) { - model.notifyPropertyChange(PROJECT_ROOT, IDataModel.ENABLE_CHG); - } else if (J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PATH_VARIABLE.equals(propertyName)) { - - if (isLinkedPathVariableInvalid()) - setProperty(J2EEUtilityJarListImportDataModelProvider.LINKED_PATH_VARIABLE, "TEAM_SHARED_DIRECTORY"); //$NON-NLS-1$ - - model.notifyPropertyChange(J2EEUtilityJarListImportDataModelProvider.LINKED_PATH_VARIABLE, IDataModel.ENABLE_CHG); - model.notifyPropertyChange(AVAILABLE_JARS_DIRECTORY, IDataModel.ENABLE_CHG); - - } else if (J2EEUtilityJarListImportDataModelProvider.LINKED_PATH_VARIABLE.equals(propertyName)) { - // will only set if necessary - setProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PATH_VARIABLE, Boolean.TRUE); - - if (linkedPathExists()) { - String linkedPathVariable = getStringProperty(J2EEUtilityJarListImportDataModelProvider.LINKED_PATH_VARIABLE); - IPathVariableManager manager = ResourcesPlugin.getWorkspace().getPathVariableManager(); - IPath availableJarsPath = manager.getValue(linkedPathVariable); - setProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PATH_VARIABLE, Boolean.valueOf(availableJarsPath != null)); - - String availableJarsPathString = availableJarsPath.toOSString(); - if (availableJarsPathString != null && availableJarsPathString.length() > 0) - setProperty(J2EEUtilityJarListImportDataModelProvider.AVAILABLE_JARS_DIRECTORY, availableJarsPathString); - } - - model.notifyPropertyChange(AVAILABLE_JARS_DIRECTORY, IDataModel.ENABLE_CHG); - } - return notify; - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#basicIsEnabled(java.lang.String) - */ - public boolean isPropertyEnabled(String propertyName) { - if (J2EEUtilityJarListImportDataModelProvider.BINARY_IMPORT.equals(propertyName)) { - return getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_PROJECT) || getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PROJECT); - } else if (J2EEUtilityJarListImportDataModelProvider.OVERRIDE_PROJECT_ROOT.equals(propertyName)) { - return getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_PROJECT) || getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PROJECT); - } else if (J2EEUtilityJarListImportDataModelProvider.PROJECT_ROOT.equals(propertyName)) { - return (getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_PROJECT) || getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PROJECT)) && getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.OVERRIDE_PROJECT_ROOT); - } else if (J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PATH_VARIABLE.equals(propertyName)) { - return (getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.LINK_IMPORT) || getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PROJECT)); - } else if (J2EEUtilityJarListImportDataModelProvider.LINKED_PATH_VARIABLE.equals(propertyName)) { - return getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PATH_VARIABLE); - } else if (J2EEUtilityJarListImportDataModelProvider.AVAILABLE_JARS_DIRECTORY.equals(propertyName)) { - boolean createPath = getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PATH_VARIABLE); - return !createPath || !linkedPathExists(); - } - return super.isPropertyEnabled(propertyName); - } - - private boolean linkedPathExists() { - String linkedPathVariable = getStringProperty(J2EEUtilityJarListImportDataModelProvider.LINKED_PATH_VARIABLE); - if (linkedPathVariable == null || linkedPathVariable.trim().length() == 0) - return false; - - IPathVariableManager manager = ResourcesPlugin.getWorkspace().getPathVariableManager(); - IPath availableJarsPath = manager.getValue(linkedPathVariable); - return availableJarsPath != null; - } - - private boolean isLinkedPathVariableInvalid() { - boolean createPath = getBooleanProperty(J2EEUtilityJarListImportDataModelProvider.CREATE_LINKED_PATH_VARIABLE); - String linkedPathVariable = getStringProperty(J2EEUtilityJarListImportDataModelProvider.LINKED_PATH_VARIABLE); - return (createPath && (linkedPathVariable == null || linkedPathVariable.trim().length() == 0)); - } - - public IDataModelOperation getDefaultOperation() { - return new J2EEUtilityJarListImportOperation(model); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.application.operations.J2EEImportDataModel#getDefaultProperty(java.lang.String) - */ - public Object getDefaultProperty(String propertyName) { - if (CREATE_PROJECT.equals(propertyName)) - return Boolean.TRUE; - else if (LINK_IMPORT.equals(propertyName)) - return Boolean.FALSE; - else if (COPY.equals(propertyName)) - return Boolean.FALSE; - else if (CREATE_LINKED_PROJECT.equals(propertyName)) - return Boolean.FALSE; - else if (CREATE_LINKED_PATH_VARIABLE.equals(propertyName)) - return Boolean.FALSE; - else if (OVERRIDE_PROJECT_ROOT.equals(propertyName)) - return Boolean.FALSE; - else if (BINARY_IMPORT.equals(propertyName)) - return Boolean.FALSE; - else if (PROJECT_ROOT.equals(propertyName)) - return ResourcesPlugin.getWorkspace().getRoot().getRawLocation().toOSString(); - else if (EAR_PROJECT_NAME.equals(propertyName)) - return ""; //$NON-NLS-1$ - else if (AVAILABLE_JARS_DIRECTORY.equals(propertyName)) - return ""; //$NON-NLS-1$ - else if (LINKED_PATH_VARIABLE.equals(propertyName)) - return ""; //$NON-NLS-1$ - else if (UTILITY_JAR_LIST.equals(propertyName)) - return EMPTY_ARRAY; - else - return super.getDefaultProperty(propertyName); - } - - public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { - if (EAR_PROJECT_NAME.equals(propertyName)) { - return DataModelPropertyDescriptor.createDescriptors(getValidProjectNames()); - } else if (LINKED_PATH_VARIABLE.equals(propertyName)) { - IPathVariableManager manager = ResourcesPlugin.getWorkspace().getPathVariableManager(); - return DataModelPropertyDescriptor.createDescriptors(manager.getPathVariableNames()); - } else - return super.getValidPropertyDescriptors(propertyName); - } - - /** - * Populate the resource name combo with connector projects that are not encrypted. - */ - protected Object[] getValidProjectNames() { - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - List projectsWithNature = new ArrayList(); - - IFacetedProject facetedProject = null; - for (int i = 0; i < projects.length; i++) { - if(projects[i].isAccessible()) { - try { - facetedProject = ProjectFacetsManager.create(projects[i]); - if (facetedProject!=null && facetedProject.hasProjectFacet(EARFacetUtils.EAR_FACET)) { - projectsWithNature.add(projects[i].getFullPath().toString()); - } - } catch (CoreException e) { - J2EEPlugin.logError(0, e.getMessage(), e); - } - } - } - - return ProjectUtilities.getProjectNamesWithoutForwardSlash((String[]) projectsWithNature.toArray(new String[projectsWithNature.size()])); - } - - public IStatus validate(String propertyName) { - if (EAR_PROJECT_NAME.equals(propertyName) /* && isSet(EAR_PROJECT_NAME) */) { - String earProjectName = getStringProperty(EAR_PROJECT_NAME); - if (earProjectName != null && earProjectName.length() > 0) { - IProject earProject = ResourcesPlugin.getWorkspace().getRoot().getProject(earProjectName); - try { - if (!earProject.isAccessible()) - return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, 0, EARCreationResourceHandler.J2EEUtilityJarListImportDataModel_Specify_Valid_Project, null); - return Status.OK_STATUS; - } catch (Exception e) { - return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, 0, EARCreationResourceHandler.J2EEUtilityJarListImportDataModel_Specify_Valid_Project, e); - } - } - return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, 0, EARCreationResourceHandler.J2EEUtilityJarListImportDataModel_Specify_Valid_Project, null); - - } else if (UTILITY_JAR_LIST.equals(propertyName) || J2EEUtilityJarListImportDataModelProvider.OVERWRITE_IF_NECESSARY.equals(propertyName)) { - - Object[] list = (Object[]) getProperty(UTILITY_JAR_LIST); - if (list == null || list.length == 0) - return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, 0, EARCreationResourceHandler.J2EEUtilityJarListImportDataModel_Select_Jar, null); - - /* return validateExistingProjects(); */ - - return Status.OK_STATUS; - } else if (LINKED_PATH_VARIABLE.equals(propertyName)) { - if (isLinkedPathVariableInvalid()) - return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, 0, EARCreationResourceHandler.J2EEUtilityJarListImportDataModel_Specify_Linked_Path, null); - else if (linkedPathExists()) - return new Status(IStatus.INFO, J2EEPlugin.PLUGIN_ID, 0, EARCreationResourceHandler.J2EEUtilityJarListImportDataModel_Linked_Path_Exists, null); - } else if (PROJECT_ROOT.equals(propertyName)) { - return validateProjectRoot(); - } - return super.validate(propertyName); - } - - private IStatus validateProjectRoot() { - if (isPropertySet(PROJECT_ROOT) && getBooleanProperty(OVERRIDE_PROJECT_ROOT)) { - String loc = (String) getProperty(PROJECT_ROOT); - File file = new File(loc); - if (!file.canWrite() || !file.isDirectory()) - return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, 0, EARCreationResourceHandler.J2EEUtilityJarListImportDataModel_0, null); - } - return OK_STATUS; - } - - // private IStatus validateExistingProjects() { - // boolean createProject = (getBooleanProperty(J2EEUtilityJarListImportDataModel.CREATE_PROJECT) - // || getBooleanProperty(J2EEUtilityJarListImportDataModel.CREATE_LINKED_PROJECT)); - // boolean overwrite = - // getBooleanProperty(J2EEUtilityJarListImportDataModel.OVERWRITE_IF_NECESSARY); - // if (createProject && !overwrite) { - // File jarFile = null; - // String nameWithoutJar = null; - // Object[] selectedJars = (Object[]) getProperty(UTILITY_JAR_LIST); - // for (int i = 0; i < selectedJars.length; i++) { - // jarFile = (File) selectedJars[i]; - // int start = jarFile.getName().indexOf(".jar"); - // nameWithoutJar = jarFile.getName().substring(0, start); - // if (ProjectUtilities.getProject(nameWithoutJar).exists()) - // return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, 0, "Existing projects with the derived - // names already exist (\"{0}\").", null); // {0} - // // nameWithoutJar - // - // } - // } - // return Status.OK_STATUS; - // } - - - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarListImportOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarListImportOperation.java deleted file mode 100644 index bf7021fdb..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEUtilityJarListImportOperation.java +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.io.File; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.IUndoableOperation; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEUtilityJarListImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class J2EEUtilityJarListImportOperation extends AbstractDataModelOperation implements IUndoableOperation { - - private static final int ASSISTANT_TICKS = 5; - - public J2EEUtilityJarListImportOperation(IDataModel model) { - super(model); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - - MultiStatus status = new MultiStatus(J2EEPlugin.PLUGIN_ID, 0, EARCreationResourceHandler.J2EEUtilityJarListImportOperation_UI_Import_Utility_Jars, null); - - Object[] utilityJars = (Object[]) model.getProperty(IJ2EEUtilityJarListImportDataModelProperties.UTILITY_JAR_LIST); - if (utilityJars == null || utilityJars.length == 0) - return J2EEPlugin.createErrorStatus(0, EARCreationResourceHandler.J2EEUtilityJarListImportOperation_There_were_no_utility_jars_selected, null); - - monitor.beginTask(EARCreationResourceHandler.J2EEUtilityJarListImportOperation_UI_Import_Utility_Jars, utilityJars.length * (1 + ASSISTANT_TICKS)); //$NON-NLS-1$ - -// String earProjectName = model.getStringProperty(IJ2EEUtilityJarListImportDataModelProperties.EAR_PROJECT_NAME); -// boolean isBinary = model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.BINARY_IMPORT); - - // if model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.COPY) then - // isLinked = createProject = false; - boolean toLinkImportedJars = shouldLinkImportedJars(); - boolean toCreateProject = shouldCreateProject(); - boolean toOverrideProjectRoot = shouldOverrideProjectRoot(); - boolean toOverwriteIfNecessary = shouldOverwriteIfNecessary(); - - - String projectRoot = null; - if(toOverrideProjectRoot) - projectRoot = model.getStringProperty(IJ2EEUtilityJarListImportDataModelProperties.PROJECT_ROOT); - - monitor.subTask(EARCreationResourceHandler.J2EEUtilityJarListImportOperation_UI_Preparing_to_import); //$NON-NLS-1$ - - String associatedEARProjectName = model.getStringProperty(IJ2EEUtilityJarListImportDataModelProperties.EAR_PROJECT_NAME); - - J2EEUtilityJarImportAssistantOperation assistantOperation = null; - List utilityJarOperations = new ArrayList(); - File utilityJar = null; - String linkedPathVariable = null; - if(model.isPropertySet(IJ2EEUtilityJarListImportDataModelProperties.LINKED_PATH_VARIABLE)) - linkedPathVariable = model.getStringProperty(IJ2EEUtilityJarListImportDataModelProperties.LINKED_PATH_VARIABLE); - for (int i = 0; i < utilityJars.length && !monitor.isCanceled(); i++) { - utilityJar = (File) utilityJars[i]; - if (toCreateProject) { - if (!toLinkImportedJars) { - assistantOperation = new CreateProjectWithExtractedJarOperation(utilityJar, projectRoot); - - } else { - assistantOperation = new CreateProjectWithLinkedJarOperation(utilityJar, projectRoot, linkedPathVariable); - - } - } else { - if (!toLinkImportedJars) { - assistantOperation = new CopyArchiveIntoProjectOperation(utilityJar); - } else - assistantOperation = new LinkArchiveIntoProjectOperation(utilityJar, linkedPathVariable); - } - assistantOperation.setAssociatedEARProjectName(associatedEARProjectName); - assistantOperation.setOverwriteIfNecessary(toOverwriteIfNecessary); - utilityJarOperations.add(assistantOperation); - - monitor.worked(1); - } - - for (Iterator iter = utilityJarOperations.iterator(); iter.hasNext() && !monitor.isCanceled();) { - try { - assistantOperation = (J2EEUtilityJarImportAssistantOperation) iter.next(); - IProgressMonitor submonitor = new SubProgressMonitor(monitor, ASSISTANT_TICKS); - assistantOperation.execute(submonitor, null); - submonitor.done(); - } catch (Exception e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - J2EEPlugin.logError(0, e.getMessage(), e); - } - } - - monitor.done(); - - return status; - } - - private boolean shouldOverwriteIfNecessary() { - return model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.OVERWRITE_IF_NECESSARY); - } - - protected final boolean shouldImportAsBinary() { - return model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.BINARY_IMPORT); - } - - protected final boolean shouldOverrideProjectRoot() { - return model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.OVERRIDE_PROJECT_ROOT); - } - - protected final boolean shouldCreateProject() { - return (model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.CREATE_PROJECT) || model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.CREATE_LINKED_PROJECT)); - } - - protected final boolean shouldLinkImportedJars() { - return (model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.LINK_IMPORT) || model.getBooleanProperty(IJ2EEUtilityJarListImportDataModelProperties.CREATE_LINKED_PROJECT)); - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - - - - - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/LinkArchiveIntoProjectOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/LinkArchiveIntoProjectOperation.java deleted file mode 100644 index 8f7ba933b..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/LinkArchiveIntoProjectOperation.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.application.internal.operations; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.osgi.util.NLS; - -public class LinkArchiveIntoProjectOperation extends J2EEUtilityJarImportAssistantOperation { - - - private String linkedPathVariable; - - public LinkArchiveIntoProjectOperation(File utilityJar, String linkedPathVariable) { - super(NLS.bind(EARCreationResourceHandler.LinkArchiveIntoProjectOperation_Linking_archive_into_selected_proje_, utilityJar.getName()), utilityJar); - this.linkedPathVariable = linkedPathVariable; - - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - MultiStatus status = new MultiStatus(J2EEPlugin.PLUGIN_ID, 0, NLS.bind(EARCreationResourceHandler.LinkArchiveIntoProjectOperation_Linking_archive_into_selected_proje_, getUtilityJar().getName()), null); - - IProject project = getWorkspaceRoot().getProject(getAssociatedEARProjectName()); - - try { - IFile linkedJarFile = project.getFile(getUtilityJar().getName()); - if (linkedJarFile.exists()) { - if (isOverwriteIfNecessary()) - linkedJarFile.delete(true, true, new SubProgressMonitor(monitor, 1)); - else { - status.add(J2EEPlugin.createErrorStatus(0, NLS.bind(EARCreationResourceHandler.CreateProjectWithLinkedJarOperation_File_already_exists_0_, linkedJarFile.getFullPath()), null)); - return status; - } - } - status.add(createLinkedArchive(project, getUtilityJar().getName(), getUtilityJar(), linkedPathVariable, monitor)); - - addLibraryToClasspath(project, linkedJarFile, monitor); - - createVirtualArchiveComponent(project, getUtilityJar().getName(), linkedJarFile, monitor); - - } catch (CoreException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - } catch (InvocationTargetException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - } catch (InterruptedException e) { - status.add(J2EEPlugin.createErrorStatus(0, e.getMessage(), e)); - } - return status; - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - return Status.CANCEL_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationDataModelProvider.java deleted file mode 100644 index 806c123bf..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationDataModelProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.application.internal.operations; - -import org.eclipse.wst.common.componentcore.internal.operation.RemoveReferenceComponentsDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class RemoveComponentFromEnterpriseApplicationDataModelProvider extends RemoveReferenceComponentsDataModelProvider implements IAddComponentToEnterpriseApplicationDataModelProperties { - - public RemoveComponentFromEnterpriseApplicationDataModelProvider() { - super(); - } - - public IDataModelOperation getDefaultOperation() { - return new RemoveComponentFromEnterpriseApplicationOperation(model); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationOperation.java deleted file mode 100644 index 2c9c8c7b2..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationOperation.java +++ /dev/null @@ -1,97 +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.j2ee.application.internal.operations; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; -import org.eclipse.jst.j2ee.model.IEARModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.jst.jee.application.ICommonApplication; -import org.eclipse.jst.jee.application.ICommonModule; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.operation.RemoveReferenceComponentOperation; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class RemoveComponentFromEnterpriseApplicationOperation extends RemoveReferenceComponentOperation { - - - public RemoveComponentFromEnterpriseApplicationOperation(IDataModel model) { - super(model); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - try { - J2EEComponentClasspathUpdater.getInstance().pauseUpdates(); - updateEARDD(monitor); - super.execute(monitor, info); - return OK_STATUS; - } finally { - J2EEComponentClasspathUpdater.getInstance().resumeUpdates(); - } - } - - protected void updateEARDD(final IProgressMonitor monitor) { - final IVirtualComponent comp = (IVirtualComponent) model.getProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT); - if (!comp.getProject().isAccessible()) - return; - J2EEComponentClasspathUpdater.getInstance().queueUpdateEAR(comp.getProject()); - IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(comp.getProject()); - earModel.modify(new Runnable() { - public void run() { - IEARModelProvider anotherEARModel = (IEARModelProvider)ModelProviderManager.getModelProvider(comp.getProject()); - ICommonApplication application = (ICommonApplication)anotherEARModel.getModelObject(); - if (application == null) - return; - List list = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - IVirtualComponent wc = (IVirtualComponent) list.get(i); - IVirtualComponent moduleComponent = wc.getComponent(); - if(!moduleComponent.isBinary()){ - J2EEComponentClasspathUpdater.getInstance().queueUpdateModule(moduleComponent.getProject()); - } - String moduleURI = getModuleURI(anotherEARModel, wc); - removeModule(application, moduleURI); - IVirtualFile vFile = comp.getRootFolder().getFile(moduleURI); - IFile iFile = vFile.getUnderlyingFile(); - if(iFile.exists()){ - try { - iFile.delete(true, monitor); - } catch (CoreException e) { - e.printStackTrace(); - } - } - } - } - - } - }, null); - } - - protected String getModuleURI(final IEARModelProvider earModule, final IVirtualComponent targetComponent) { - return earModule.getModuleURI(targetComponent); - } - - protected void removeModule(ICommonApplication application, String moduleURI) { - ICommonModule module = application.getFirstEARModule(moduleURI); - application.getEARModules().remove(module); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestDataModelProperties.java deleted file mode 100644 index 36573c508..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestDataModelProperties.java +++ /dev/null @@ -1,46 +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.application.internal.operations; - -public interface UpdateManifestDataModelProperties { - /** - * Project name with manifest to update, type String required. - */ - public static final String PROJECT_NAME = "UpdateManifestDataModel.PROJECT_NAME"; //$NON-NLS-1$ - - /** - * java.util.List of Strings - */ - public static final String JAR_LIST = "UpdateManifestDataModel.CLASSPATH_LIST"; //$NON-NLS-1$ - - /** - * String. This is build from the JAR_LIST property. Never set this property. - */ - public static final String JAR_LIST_TEXT_UI = "UpdateManifestDataModel.CLASSPATH_LIST_TEXT_UI"; //$NON-NLS-1$ - - /** - * Boolean, true merges, false replaces, default is true - */ - public static final String MERGE = "UpdateManifestDataModel.MERGE"; //$NON-NLS-1$ - - /** - * String, no default. - */ - public static final String MAIN_CLASS = "UpdateManifestDataModel.MAIN_CLASS"; //$NON-NLS-1$ - - - /** - * String, no default. - */ - public static final String MANIFEST_FILE = "UpdateManifestDataModel.MANIFEST_FILE"; //$NON-NLS-1$ - - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestDataModelProvider.java deleted file mode 100644 index a4d5e0e6b..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestDataModelProvider.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Nov 13, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.application.internal.operations; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import com.ibm.icu.util.StringTokenizer; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -/** - * @author jsholl - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class UpdateManifestDataModelProvider extends AbstractDataModelProvider implements UpdateManifestDataModelProperties { - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PROJECT_NAME); - propertyNames.add(JAR_LIST); - propertyNames.add(JAR_LIST_TEXT_UI); - propertyNames.add(MERGE); - propertyNames.add(MAIN_CLASS); - propertyNames.add(MANIFEST_FILE); - return propertyNames; - } - - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(MERGE)) { - return Boolean.TRUE; - } else if (propertyName.equals(JAR_LIST)) { - return new ArrayList(); - } else if (propertyName.equals(JAR_LIST_TEXT_UI)) { - return getClasspathAsString(); - } - return super.getDefaultProperty(propertyName); - } - - public boolean propertySet(String propertyName, Object propertyValue) { - boolean set = super.propertySet(propertyName, propertyValue); - if (propertyName.equals(JAR_LIST) && isPropertySet(JAR_LIST_TEXT_UI)) - setProperty(JAR_LIST_TEXT_UI, getClasspathAsString()); - return set; - } - - public IProject getProject() { - String projectName = (String) getProperty(PROJECT_NAME); - return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - } - - public String getClasspathAsString() { - List classpathList = (List) getProperty(JAR_LIST); - return convertClasspathListToString(classpathList); - } - - public static String convertClasspathListToString(List list) { - String classpathString = ""; //$NON-NLS-1$ - for (int i = 0; i < list.size(); i++) { - classpathString += ((String) list.get(i)) + " "; //$NON-NLS-1$ - } - return classpathString.trim(); - } - - public static List convertClasspathStringToList(String string) { - List list = new ArrayList(); - StringTokenizer tokenizer = new StringTokenizer(string, " "); //$NON-NLS-1$ - while (tokenizer.hasMoreTokens()) { - list.add(tokenizer.nextToken()); - } - return list; - } - - public IDataModelOperation getDefaultOperation() { - return new UpdateManifestOperation(model); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestOperation.java deleted file mode 100644 index 7c1ff049e..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateManifestOperation.java +++ /dev/null @@ -1,79 +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 - *******************************************************************************/ -/* - * Created on Nov 13, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.application.internal.operations; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - - -/** - * @author jsholl - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class UpdateManifestOperation extends AbstractDataModelOperation { - - public UpdateManifestOperation(IDataModel dataModel) { - super(dataModel); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable adaptable) throws ExecutionException { - IFile file = (IFile)model.getProperty(UpdateManifestDataModelProperties.MANIFEST_FILE); - - String classPathValue = model.getStringProperty(UpdateManifestDataModelProperties.JAR_LIST_TEXT_UI); - try { - ArchiveManifest mf = J2EEProjectUtilities.readManifest(file); - - if (mf == null) - mf = new ArchiveManifestImpl(); - mf.addVersionIfNecessary(); - if (model.getBooleanProperty(UpdateManifestDataModelProperties.MERGE)) { - mf.mergeClassPath(ArchiveUtil.getTokens(classPathValue)); - } else { - mf.setClassPath(classPathValue); - } - if (model.isPropertySet(UpdateManifestDataModelProperties.MAIN_CLASS)) { - mf.setMainClass(model.getStringProperty(UpdateManifestDataModelProperties.MAIN_CLASS)); - } - - J2EEProjectUtilities.writeManifest(file, mf); - } catch (java.io.IOException ex) { - throw new ExecutionException(ex.getMessage(),ex); - } - return OK_STATUS; - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateModuleContextRootInEAROp.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateModuleContextRootInEAROp.java deleted file mode 100644 index cf16b571d..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/UpdateModuleContextRootInEAROp.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 BEA Systems, Inc - * 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: - * rfrost@bea.com - initial API and impl - *******************************************************************************/ -package org.eclipse.jst.j2ee.application.internal.operations; - -import java.util.List; - -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.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * <code>AbstractDataModelOperation</code> subclass that updates the context-root for a given - * module within the application.xml files of all containing EARs. - */ -public class UpdateModuleContextRootInEAROp extends AbstractDataModelOperation implements IUpdateModuleContextRootProperties { - - public UpdateModuleContextRootInEAROp() { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus execute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { - if(monitor != null) { - monitor.beginTask("", 1); - } - - try { - final String newContextRoot = model.getStringProperty(CONTEXT_ROOT); - final IProject project = (IProject) model.getProperty(PROJECT); - final IDataModel nestedModel = model.getNestedModel(NESTED_MODEL_ID); - if (nestedModel != null) { - List earsToUpdate= (List) nestedModel.getProperty(EARS_TO_UPDATE); - if (newContextRoot != null && earsToUpdate != null && project != null) { - // update each specified EAR - for (int i = 0; i < earsToUpdate.size(); i++) { - updateEARContextRoot((IProject) earsToUpdate.get(i), project, newContextRoot, monitor); - } - } - } - } catch (Exception e) { - Logger.getLogger().logError(e); - } finally { - if (monitor != null) { - monitor.done(); - } - } - return OK_STATUS; - } - - /* - * Updates the context-root element int the application.xml of the specified EAR for the specified - * module project to the new value. - */ - private void updateEARContextRoot(final IProject ear, final IProject project, final String newContextRoot, - final IProgressMonitor monitor) { - EARArtifactEdit earEdit = null; - try { - earEdit = EARArtifactEdit.getEARArtifactEditForWrite(ear); - if (earEdit != null) { - final Application application = earEdit.getApplication(); - final IVirtualComponent comp = ComponentCore.createComponent(project); - if (comp == null) { - return; - } - final String moduleURI = earEdit.getModuleURI(comp); - final Module module = application.getFirstModule(moduleURI); - if (module != null && module instanceof WebModule) { - ((WebModule) module).setContextRoot(newContextRoot); - } - earEdit.saveIfNecessary(monitor); - } - } finally { - if (earEdit != null) { - earEdit.dispose(); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // no-op - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // no-op - return null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java deleted file mode 100644 index 943f98fd9..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java +++ /dev/null @@ -1,671 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.componentcore.util; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.application.ApplicationFactory; -import org.eclipse.jst.j2ee.application.ApplicationResource; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.application.WebModule; -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.EARComponentLoadStrategyImpl; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IEARModelProvider; -import org.eclipse.jst.j2ee.model.IModelProvider; -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.ReferencedComponent; -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.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - -/** - * <p> - * EARArtifactEdit obtains an {@see org.eclipse.jst.j2ee.application.Application} metamodel. - * The {@see org.eclipse.jst.j2ee.application.ApplicationResource} which stores the metamodel - * is retrieved from the {@see org.eclipse.wst.common.modulecore.ArtifactEditModel} using a - * cached constant (@see - * org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants#APPLICATION_DD_URI). The - * defined methods extract data or manipulate the contents of the underlying resource. - * </p> - */ - -public class EARArtifactEdit extends EnterpriseArtifactEdit implements IArtifactEditFactory, IEARModelProvider { - - private static final String EAR_CONTENT_TYPE = "org.eclipse.jst.j2ee.earDD"; - - public static final Class ADAPTER_TYPE = EARArtifactEdit.class; - - private static final IVirtualReference[] NO_REFERENCES = new IVirtualReference[0]; - - /** - * - */ - public EARArtifactEdit() { - super(); - } - - /** - * @param aHandle - * @param toAccessAsReadOnly - * @throws IllegalArgumentException - */ - public EARArtifactEdit(IProject aProject, boolean toAccessAsReadOnly) throws IllegalArgumentException { - super(aProject, toAccessAsReadOnly); - } - - // This should be revereted to protected when 115924 is fixed - public EARArtifactEdit(IProject aProject, boolean toAccessAsReadOnly, boolean forCreate) throws IllegalArgumentException { - super(aProject, toAccessAsReadOnly, forCreate, J2EEProjectUtilities.ENTERPRISE_APPLICATION); - } - - /** - * <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} 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} 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 EARArtifactEdit getEARArtifactEditForRead(IProject aProject) { - EARArtifactEdit artifactEdit = null; - try { - if (isValidEARModule(ComponentCore.createComponent(aProject))) - artifactEdit = new EARArtifactEdit(aProject, true, false); - } catch (Exception iae) { - 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} that - * will be used for editing. - * </p> - * <p> - * <b>The following method may return null. </b> - * </p> - * - * @param aModule - * A valid {@see WorkbenchComponent} 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 EARArtifactEdit getEARArtifactEditForWrite(IProject aProject) { - EARArtifactEdit artifactEdit = null; - try { - if (isValidEARModule(ComponentCore.createComponent(aProject))) - artifactEdit = new EARArtifactEdit(aProject, false, false); - } catch (Exception iae) { - artifactEdit = null; - } - return artifactEdit; - } - - /** - * <p> - * Returns an instance facade to manage the underlying edit model for the given - * {@see WorkbenchComponent}. Instances of EARArtifactEdit that are returned through this - * method must be {@see #dispose()}ed of when no longer in use. - * </p> - * <p> - * Use to acquire an EARArtifactEdit facade for a specific {@see WorkbenchComponent} 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} with a handle that resolves to an - * accessible project in the workspace - * @return An instance of EARArtifactEdit that may only be used to read the underlying content - * model - * @throws UnresolveableURIException - * could not resolve uri. - */ - public static EARArtifactEdit getEARArtifactEditForRead(IVirtualComponent aModule) { - if (aModule == null) - return null; - return getEARArtifactEditForRead(aModule.getProject()); - } - - - /** - * <p> - * Returns an instance facade to manage the underlying edit model for the given - * {@see WorkbenchComponent}. Instances of WebArtifactEdit that are returned through this - * method must be {@see #dispose()}ed of when no longer in use. - * </p> - * <p> - * Use to acquire an EARArtifactEdit facade for a specific {@see WorkbenchComponent} 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} with a handle that resolves to an - * accessible project in the workspace - * @return An instance of EARArtifactEdit that may be used to modify and persist changes to the - * underlying content model - */ - public static EARArtifactEdit getEARArtifactEditForWrite(IVirtualComponent aModule) { - if (aModule == null) - return null; - return getEARArtifactEditForWrite(aModule.getProject()); - } - - /** - * @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 isValidEARModule(IVirtualComponent aModule) throws UnresolveableURIException { - if (!isValidEditableModule(aModule)) - return false; - return J2EEProjectUtilities.isEARProject(aModule.getProject()); - } - - /** - * <p> - * Creates an instance facade for the given {@see ArtifactEditModel}. - * </p> - * - * @param anArtifactEditModel - */ - public EARArtifactEdit(ArtifactEditModel model) { - super(model); - } - - /** - * <p> - * Creates an instance facade for the given {@see ArtifactEditModel} - * </p> - * <p> - * Note: This method is for internal use only. Clients should not call this method. - * </p> - * - * @param aNature - * A non-null {@see ModuleCoreNature}for an accessible project - * @param aModule - * A non-null {@see WorkbenchComponent}pointing to a module from the given - * {@see ModuleCoreNature} - */ - - - protected EARArtifactEdit(ModuleCoreNature aNature, IVirtualComponent aModule, boolean toAccessAsReadOnly) { - super(aNature, aModule, toAccessAsReadOnly); - } - - /** - * <p> - * Retrieves J2EE version information from ApplicationResource. - * </p> - * - * @return an integer representation of a J2EE Spec version - * - */ - public int getJ2EEVersion() { - verifyOperationSupported(); - return getApplicationXmiResource().getJ2EEVersionID(); - } - - /** - * - * @return ApplicationResource from (@link getDeploymentDescriptorResource()) - * - */ - - public ApplicationResource getApplicationXmiResource() { - verifyOperationSupported(); - return (ApplicationResource) getDeploymentDescriptorResource(); - } - - /** - * <p> - * Obtains the Application {@see Application}root object from the {@see ApplicationResource}, - * the root object contains all other resource defined objects. - * </p> - * - * @return Application - * - */ - - public Application getApplication() { - verifyOperationSupported(); - return (Application) getDeploymentDescriptorRoot(); - } - - /** - * <p> - * Retrieves the resource from the {@see ArtifactEditModel} - * </p> - * - * @return Resource - * - */ - - public Resource getDeploymentDescriptorResource() { - verifyOperationSupported(); - return getArtifactEditModel().getResource(J2EEConstants.APPLICATION_DD_URI_OBJ); - } - - - /** - * <p> - * Creates a deployment descriptor root object (Application) 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} - * @param version - * Version to be set on resource....if null default is taken - * - * Note: This method is typically used for JUNIT - move? - * </p> - */ - protected void addApplicationIfNecessary(XMLResource aResource) { - verifyOperationSupported(); - if (aResource != null) { - if (aResource.getContents() == null || aResource.getContents().isEmpty()) { - Application newApp = ApplicationFactory.eINSTANCE.createApplication(); - aResource.getContents().add(newApp); - } - Application application = (Application) aResource.getContents().get(0); - URI moduleURI = getArtifactEditModel().getModuleURI(); - try { - application.setDisplayName(StructureEdit.getDeployedName(moduleURI)); - } catch (UnresolveableURIException e) { - // Ignore - } - aResource.setID(application, J2EEConstants.APPL_ID); - // TODO add more mandatory elements - } - } - - /** - * Checks if the uri mapping already exists. - * - * @param String - * currentURI - The current uri of the module. - * @return boolean - */ - public boolean uriExists(String currentURI) { - StructureEdit edit = null; - try { - edit = StructureEdit.getStructureEditForRead(getProject()); - if (edit!=null && edit.getComponent()!=null) { - List referencedComps = edit.getComponent().getReferencedComponents(); - for (int i=0; i<referencedComps.size(); i++) { - ReferencedComponent ref = (ReferencedComponent) referencedComps.get(i); - Object module = ref.getDependentObject(); - if (module!=null && module instanceof Module) { - String existingURI = ((Module)module).getUri(); - if (existingURI!=null && existingURI.equals(currentURI)) - return true; - } - } - } - } finally { - if (edit != null) - edit.dispose(); - } - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.modulecore.util.EnterpriseArtifactEdit#createModelRoot() - */ - public EObject createModelRoot() { - verifyOperationSupported(); - return createModelRoot(getJ2EEVersion()); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.modulecore.util.EnterpriseArtifactEdit#createModelRoot(java.lang.Integer) - */ - public EObject createModelRoot(int version) { - verifyOperationSupported(); - ApplicationResource res = (ApplicationResource) getDeploymentDescriptorResource(); - res.setModuleVersionID(version); - addApplicationIfNecessary(res); - return ((ApplicationResource) getDeploymentDescriptorResource()).getRootObject(); - } - - /** - * This method will return the list of IVirtualReferences for all of the utility modules - * contained in the EAR application - * - * @return - an array of IVirtualReferences for utility modules in the EAR - */ - public IVirtualReference[] getUtilityModuleReferences() { - verifyOperationSupported(); - List explicitUtilityReferences = - getComponentReferencesAsList(Collections.singletonList(J2EEProjectUtilities.UTILITY)); - - // fetch other Utility Jars attached to the EAR project - List implicitUtilityReferenceTypes = - Arrays.asList(new String[] { IModuleConstants.JST_APPCLIENT_MODULE, - IModuleConstants.JST_WEB_MODULE, - IModuleConstants.JST_EJB_MODULE }); - - List implicitUtilityReferences = - getComponentReferencesAsList(implicitUtilityReferenceTypes); - - - Application application = getApplication(); - Module module = null; - IVirtualReference reference = null; - for (Iterator referenceItr = implicitUtilityReferences.iterator(); referenceItr.hasNext(); ) { - reference = (IVirtualReference) referenceItr.next(); - module = application.getFirstModule(reference.getArchiveName()); - if(module != null) - referenceItr.remove(); - } - - List allUtilityModuleReferences = new ArrayList(); - allUtilityModuleReferences.addAll(explicitUtilityReferences); - allUtilityModuleReferences.addAll(implicitUtilityReferences); - - if(allUtilityModuleReferences.size() > 0) - return (IVirtualReference[]) allUtilityModuleReferences.toArray(new IVirtualReference[allUtilityModuleReferences.size()]); - return NO_REFERENCES; - - } - - public String getModuleURI(IVirtualComponent moduleComp) { - IVirtualReference [] refs = getComponent().getReferences(); - for(int i=0; i<refs.length; i++){ - if(refs[i].getReferencedComponent().equals(moduleComp)){ - return refs[i].getArchiveName(); - } - } - return null; - } - -// private String getJarURI(final ReferencedComponent ref, final IVirtualComponent moduleComp) { -// String uri = ref.getArchiveName(); -// if( uri == null || uri.length() < 0 ){ -// uri = moduleComp.getName()+IJ2EEModuleConstants.JAR_EXT; -// }else{ -// String prefix = ref.getRuntimePath().makeRelative().toString(); -// if(prefix.length() > 0){ -// uri = prefix + "/" + uri; //$NON-NLS-1$ -// } -// } -// return uri; -// } - - public IVirtualComponent getModuleByManifestURI(final String uri) { - IVirtualComponent earComponent = ComponentCore.createComponent(getProject()); - IVirtualReference [] refs = earComponent.getReferences(); - - for(int i=0;i<refs.length; i++){ - if(refs[i].getArchiveName().equals(uri)){ - return refs[i].getReferencedComponent(); - } - } - return null; - } - - /** - * This method will return the an IVirtualComponent for the given module name. The method take - * either moduleName or moduleName + ".module_extension" (module_extension = ".jar" || ".war" || - * ".rar") which allows users to get a IVirtualComponent for a given entry in an application.xml - * - * @return - a IVirtualComponent for module name - * @deprecated - see {@link J2EEProjectUtilities.getModule(IVirtualComponent earComponent, String moduleName)} - */ - public IVirtualComponent getModule(String moduleName) { - if (moduleName == null) - return null; - if (moduleName.endsWith(IJ2EEModuleConstants.JAR_EXT) || moduleName.endsWith(IJ2EEModuleConstants.WAR_EXT) || moduleName.endsWith(IJ2EEModuleConstants.RAR_EXT)) - moduleName = moduleName.substring(0, (moduleName.length() - IJ2EEModuleConstants.JAR_EXT.length())); - IVirtualReference[] references = getComponentReferences(); - for (int i = 0; i < references.length; i++) { - IVirtualComponent component = references[i].getReferencedComponent(); - if (component.getName().equals(moduleName)) { - return component; - } - } - return null; - } - - /** - * This method will return the list of IVirtualReferences for the J2EE module components - * contained in this EAR application. - * - * @return - an array of IVirtualReferences for J2EE modules in the EAR - * @deprecated - see {@link J2EEProjectUtilities.getJ2EEModuleReferences(IVirtualComponent earComponent)} - */ - public IVirtualReference[] getJ2EEModuleReferences() { - return J2EEProjectUtilities.getJ2EEModuleReferences(getComponent()); - } - - /** - * This method will return the list of IVirtualReferences for all of the components contained in - * this EAR application. - * - * @return - an array of IVirtualReferences for components in the EAR - * @deprecated - see {@link J2EEProjectUtilities.getComponentReferences(IVirtualComponent earComponent)} - */ - public IVirtualReference[] getComponentReferences() { - return J2EEProjectUtilities.getComponentReferences(getComponent()); - } - - /** - * This method will return the IVirtualReference to the component of the given name - * - * @return - IVirtualReference or null if not found - * @deprecated - see {@link J2EEProjectUtilities.getComponentReference(IVirtualComponent earComponent, String componentName)} - */ - public IVirtualReference getComponentReference(String componentName) { - return J2EEProjectUtilities.getComponentReference(getComponent(), componentName); - } - - /** - * - * @param componentTypes - * @return A List of {@link IVirtualReference}s. - * - * A copy of this method is now in J2EEProjectUtilities. Any bug fixes should occur in both locations. - */ - private List getComponentReferencesAsList(List componentTypes) { - List components = new ArrayList(); - IVirtualComponent earComponent = getComponent(); - if (earComponent != null && J2EEProjectUtilities.isEARProject(earComponent.getProject())) { - IVirtualReference[] refComponents = earComponent.getReferences(); - for (int i = 0; i < refComponents.length; i++) { - IVirtualComponent module = refComponents[i].getReferencedComponent(); - if (module == null) - continue; - // if component types passed in is null then return all components - if (componentTypes == null || componentTypes.size() == 0) - components.add(refComponents[i]); - else { - if (componentTypes.contains(J2EEProjectUtilities.getJ2EEComponentType(module))) { - components.add(refComponents[i]); - } - } - } - } - return components; - } - - public ArtifactEdit createArtifactEditForRead(IVirtualComponent aComponent) { - - return getEARArtifactEditForRead(aComponent); - } - - public ArtifactEdit createArtifactEditForWrite(IVirtualComponent aComponent) { - - return getEARArtifactEditForWrite(aComponent); - } - - public Archive asArchive(boolean includeSource) throws OpenFailureException { - verifyOperationSupported(); - return asArchive(includeSource, true); - } - - public Archive asArchive(boolean includeSource, boolean includeClasspathComponents) throws OpenFailureException { - verifyOperationSupported(); - EARComponentLoadStrategyImpl loader = new EARComponentLoadStrategyImpl(getComponent(), includeClasspathComponents); - loader.setExportSource(includeSource); - String uri = ModuleURIUtil.getHandleString(getComponent()); - return CommonarchiveFactory.eINSTANCE.openEARFile(loader, uri); - } - - public static void createDeploymentDescriptor(IProject project, int version) { - EnterpriseArtifactEdit earEdit = new EARArtifactEdit(project, false, true); - try { - earEdit.createModelRoot(version); - earEdit.save(null); - } finally { // Make sure new resource is removed - the uri used for creation shouldn't be cached - Resource newRes = earEdit.getDeploymentDescriptorResource(); - WorkbenchResourceHelperBase.getResourceSet(project).getResources().remove(newRes); - newRes.unload(); - earEdit.dispose(); - } - } - - /** - * This method will return the context root in this application for the passed in web project. - * - * @param webProject - * @return contextRoot String - */ - public String getWebContextRoot(IProject webProject) { - verifyOperationSupported(); - if (webProject == null || !J2EEProjectUtilities.isDynamicWebProject(webProject)) - return null; - IVirtualComponent webComp = ComponentCore.createComponent(webProject); - String webModuleURI = getModuleURI(webComp); - if (webModuleURI != null) { - WebModule webModule = (WebModule) getApplication().getModule(webModuleURI, null); - if (webModule != null) - return webModule.getContextRoot(); - } - return null; - } - - /** - * This method will set the context root on the application for the passed in contextRoot. This - * must be called in a write artifact edit and be saved for changes to be saved. - * - * @param webProject - * @param aContextRoot - */ - public void setWebContextRoot(IProject webProject, String aContextRoot) { - verifyOperationSupported(); - if (webProject == null || !J2EEProjectUtilities.isDynamicWebProject(webProject)) - return; - IVirtualComponent webComp = ComponentCore.createComponent(webProject); - String webModuleURI = getModuleURI(webComp); - if (webModuleURI != null) { - WebModule webModule = (WebModule) getApplication().getModule(webModuleURI, null); - if (webModule != null) - webModule.setContextRoot(aContextRoot); - } - } - public IModelProvider create(IProject project) { - return (IModelProvider)getEARArtifactEditForRead(project); - } - - public IModelProvider create(IVirtualComponent component) { - return (IModelProvider)getEARArtifactEditForRead(component); - } - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit#modify(java.lang.Runnable, org.eclipse.core.runtime.IPath) - */ - public void modify(Runnable runnable, IPath modelPath) { - setWritableEdit(getEARArtifactEditForWrite(getProject())); - try { - runnable.run(); - if( getWritableEdit() != null ){ - // Always save regardless of resource path passed - Artifactedits save resources as a unit - getWritableEdit().saveIfNecessary( new NullProgressMonitor() ); - } - - } finally { - getWritableEdit().dispose(); - setWritableEdit(null); - } - } - - - protected String getContentTypeDescriber() { - return EAR_CONTENT_TYPE; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARVirtualComponent.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARVirtualComponent.java deleted file mode 100644 index ff56c4377..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARVirtualComponent.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.componentcore.util; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent; -import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.jee.application.ICommonModule; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.ReferencedComponent; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent; -import org.eclipse.wst.common.componentcore.internal.util.IComponentImplFactory; -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.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.componentcore.resources.IVirtualResource; - -public class EARVirtualComponent extends VirtualComponent implements IComponentImplFactory { - - private IVirtualReference[] cachedReferences; - private long depGraphModStamp; - public EARVirtualComponent() { - super(); - } - - public EARVirtualComponent(IProject aProject, IPath aRuntimePath) { - super(aProject, aRuntimePath); - } - - public IVirtualComponent createArchiveComponent(IProject aProject, String archiveLocation, IPath aRuntimePath) { - return new J2EEModuleVirtualArchiveComponent(aProject, archiveLocation, aRuntimePath); - } - - public IVirtualComponent createComponent(IProject aProject) { - return new EARVirtualComponent(aProject, new Path("/")); //$NON-NLS-1$ - } - - public IVirtualFolder createFolder(IProject aProject, IPath aRuntimePath) { - return new EARVirtualRootFolder(aProject, aRuntimePath); - } - - private static String getJarURI(final ReferencedComponent ref, final IVirtualComponent moduleComp) { - String uri = ref.getArchiveName(); - if (uri == null || uri.length() < 0) { - if(moduleComp.isBinary()){ - uri = new Path(moduleComp.getName()).lastSegment(); - } else { - uri = moduleComp.getName() + IJ2EEModuleConstants.JAR_EXT; - } - } else { - String prefix = ref.getRuntimePath().makeRelative().toString(); - if (prefix.length() > 0) { - uri = prefix + "/" + uri; //$NON-NLS-1$ - } - } - return uri; - } - - private static List getHardReferences(IVirtualComponent earComponent) { - StructureEdit core = null; - List hardReferences = new ArrayList(); - try { - core = StructureEdit.getStructureEditForRead(earComponent.getProject()); - if (core != null && core.getComponent() != null) { - WorkbenchComponent component = core.getComponent(); - if (component != null) { - List referencedComponents = component.getReferencedComponents(); - for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) { - ReferencedComponent referencedComponent = (ReferencedComponent) iter.next(); - if (referencedComponent == null) - continue; - IVirtualReference vReference = StructureEdit.createVirtualReference(earComponent, referencedComponent); - if (vReference != null) { - IVirtualComponent referencedIVirtualComponent = vReference.getReferencedComponent(); - if (referencedIVirtualComponent != null && referencedIVirtualComponent.exists()) { - String archiveName = null; - if (referencedComponent.getDependentObject() != null) { - archiveName = ((ICommonModule) referencedComponent.getDependentObject()).getUri(); - } else { - if (referencedIVirtualComponent.isBinary()) { - archiveName = getJarURI(referencedComponent, referencedIVirtualComponent); - } else if(referencedComponent.getArchiveName() != null){ - archiveName = referencedComponent.getArchiveName(); - } else { - IProject referencedProject = referencedIVirtualComponent.getProject(); - // If dependent object is not set, assume - // compname is module name + proper - // extension - if (J2EEProjectUtilities.isDynamicWebProject(referencedProject) || J2EEProjectUtilities.isStaticWebProject(referencedProject)) { - archiveName = referencedIVirtualComponent.getName() + IJ2EEModuleConstants.WAR_EXT; - } else if (J2EEProjectUtilities.isJCAProject(referencedProject)) { - archiveName = referencedIVirtualComponent.getName() + IJ2EEModuleConstants.RAR_EXT; - } else if (J2EEProjectUtilities.isUtilityProject(referencedProject)) { - archiveName = getJarURI(referencedComponent, referencedIVirtualComponent); - } else { - archiveName = referencedIVirtualComponent.getName() + IJ2EEModuleConstants.JAR_EXT; - } - } - } - vReference.setArchiveName(archiveName); - hardReferences.add(vReference); - } - } - } - } - } - } finally { - if (core != null) - core.dispose(); - } - return hardReferences; - } - - /** - * Returns the resulting list of referenced components based off the hard references and archives mapping to the root folder. - * - * @param earComponent - * @param hardReferences - * @param membersToIgnore - * @return - */ - private static List getLooseArchiveReferences(EARVirtualComponent earComponent, List hardReferences) { - return getLooseArchiveReferences(earComponent, hardReferences, null, (EARVirtualRootFolder)earComponent.getRootFolder()); - } - - private static List getLooseArchiveReferences(EARVirtualComponent earComponent, List hardReferences, List dynamicReferences, EARVirtualRootFolder folder) { - try { - IVirtualResource[] members = folder.superMembers(); - for (int i = 0; i < members.length; i++) { - if (IVirtualResource.FILE == members[i].getType()) { - if(folder.isDynamicComponent((IVirtualFile)members[i])){ - String archiveName = members[i].getRuntimePath().toString().substring(1); - boolean shouldInclude = true; - for (int j = 0; j < hardReferences.size() && shouldInclude; j++) { - String tempArchiveName = ((IVirtualReference) hardReferences.get(j)).getArchiveName(); - if (null != tempArchiveName && tempArchiveName.equals(archiveName)) { - shouldInclude = false; - } - } - if (shouldInclude) { - IResource iResource = members[i].getUnderlyingResource(); - IVirtualComponent dynamicComponent = ComponentCore.createArchiveComponent(earComponent.getProject(), VirtualArchiveComponent.LIBARCHIVETYPE + iResource.getFullPath().toString()); - IVirtualReference dynamicRef = ComponentCore.createReference(earComponent, dynamicComponent); - dynamicRef.setArchiveName(archiveName); - if (null == dynamicReferences) { - dynamicReferences = new ArrayList(); - } - dynamicReferences.add(dynamicRef); - } - } - } else if(IVirtualResource.FOLDER == members[i].getType()){ - dynamicReferences = getLooseArchiveReferences(earComponent, hardReferences, dynamicReferences, (EARVirtualRootFolder)members[i]); - } - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - return dynamicReferences; - } - - public IVirtualReference[] getReferences() { - - IVirtualReference[] cached = getCachedReferences(); - if (cached != null) - return cached; - List hardReferences = getHardReferences(this); - List dynamicReferences = getLooseArchiveReferences(this, hardReferences); - - if (dynamicReferences != null) { - hardReferences.addAll(dynamicReferences); - } - cachedReferences = (IVirtualReference[]) hardReferences.toArray(new IVirtualReference[hardReferences.size()]); - return cachedReferences; - } - // Returns cache if still valid or null - public IVirtualReference[] getCachedReferences() { - if (cachedReferences != null && checkIfStillValid()) - return cachedReferences; - else - depGraphModStamp = DependencyGraphManager.getInstance().getModStamp(); - return null; - } - - private boolean checkIfStillValid() { - return DependencyGraphManager.getInstance().checkIfStillValid(depGraphModStamp); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARVirtualRootFolder.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARVirtualRootFolder.java deleted file mode 100644 index 83ef7cc9c..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARVirtualRootFolder.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.componentcore.util; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualResource; - -//TODO this should be renamed to EARVirtualFolder because it is not used only for the root. -public class EARVirtualRootFolder extends VirtualFolder { - - public EARVirtualRootFolder(IProject aComponentProject, IPath aRuntimePath) { - super(aComponentProject, aRuntimePath); - } - - public static String [] EXTENSIONS_TO_IGNORE = new String [] {".jar", ".zip", ".rar", ".war" }; - - public IVirtualResource[] superMembers() throws CoreException { - return superMembers(IResource.NONE); - } - - public IVirtualResource[] superMembers(int memberFlags) throws CoreException { - return super.members(memberFlags); - } - - public boolean isDynamicComponent(IVirtualFile vFile){ - String archiveName = vFile.getName(); - for(int j = 0; j<EXTENSIONS_TO_IGNORE.length; j++){ - if(J2EEComponentClasspathUpdater.endsWithIgnoreCase(archiveName, EXTENSIONS_TO_IGNORE[j])){ - return true; - } - } - return false; - } - - /** - * For now, just rip out files with .jar, .rar, or .war file extensions, because these are - * the only files automatically added dyamically - */ - public IVirtualResource[] members(int memberFlags) throws CoreException { - IVirtualResource[] members = superMembers(memberFlags); - List virtualResources = new ArrayList(); - boolean shouldAdd = true; - for (int i = 0; i < members.length; i++) { - shouldAdd = true; - if (IVirtualResource.FILE == members[i].getType()) { - if(isDynamicComponent((IVirtualFile)members[i])){ - shouldAdd = false; - } - } - if (shouldAdd) { - virtualResources.add(members[i]); - } - } - return (IVirtualResource[]) virtualResources - .toArray(new IVirtualResource[virtualResources.size()]); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/package.xml b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/package.xml deleted file mode 100644 index aec496d4e..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/package.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<html> - <head> - <meta - name="root" - content="../../../../../../../" /> - <title>EJBArtifactEdit api overview</title> - </head> - - <body> - <abstract> - This package includes the EARArtifactEdit api. This api is used to work with the emf model - of a flexible EAR module. It contains api to read and serialize out the emf model for enterprise applications. - </abstract> - - <a href="#top">top</a> - </body> -</html> -
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/earcreation/IEarFacetInstallDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/earcreation/IEarFacetInstallDataModelProperties.java deleted file mode 100644 index 720a41ed8..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/earcreation/IEarFacetInstallDataModelProperties.java +++ /dev/null @@ -1,28 +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.j2ee.earcreation; - -import org.eclipse.jst.j2ee.internal.project.facet.EARFacetProjectCreationDataModelProvider; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetInstallDataModelProperties; - -public interface IEarFacetInstallDataModelProperties extends IJ2EEFacetInstallDataModelProperties { - - /** - * This field should not be used. It is not part of the API and may be modified in the future. - */ - public static Class _provider_class = EARFacetProjectCreationDataModelProvider.class; - - //TODO what is this??? - public static final String CONTENT_DIR = "IEarFacetInstallDataModelProperties.CONTENT_DIR";//$NON-NLS-1$ - - public static final String J2EE_PROJECTS_LIST = "IEarFacetInstallDataModelProperties.J2EE_PROJECTS_LIST"; //$NON-NLS-1$ - public static final String JAVA_PROJECT_LIST = "IEarFacetInstallDataModelProperties.JAVA_PROJECT_LIST"; //$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/DefaultJ2EEComponentCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/DefaultJ2EEComponentCreationDataModelProvider.java deleted file mode 100644 index f789e56c1..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/DefaultJ2EEComponentCreationDataModelProvider.java +++ /dev/null @@ -1,444 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.earcreation; - -import java.util.ArrayList; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.application.internal.operations.DefaultJ2EEComponentCreationOperation; -import org.eclipse.jst.j2ee.applicationclient.internal.creation.AppClientFacetProjectCreationDataModelProvider; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.moduleextension.EarModuleManager; -import org.eclipse.jst.j2ee.internal.moduleextension.EjbModuleExtension; -import org.eclipse.jst.j2ee.internal.moduleextension.JcaModuleExtension; -import org.eclipse.jst.j2ee.internal.moduleextension.WebModuleExtension; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetProjectCreationDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.J2EEModuleFacetInstallDataModelProvider; -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.AbstractDataModelProvider; -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.frameworks.internal.WTPPlugin; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -public class DefaultJ2EEComponentCreationDataModelProvider extends AbstractDataModelProvider implements IDefaultJ2EEComponentCreationDataModelProperties { - private static String CREATE_BASE = "DefaultJ2EEComponentCreationDataModel.CREATE_"; //$NON-NLS-1$ - - private static final int EJB = 0; - private static final int WEB = 1; - private static final int RAR = 2; - private static final int CLIENT = 3; - - private static final String WEB_SUFFIX = "Web"; //$NON-NLS-1$ - private static final String EJB_SUFFIX = "EJB"; //$NON-NLS-1$ - private static final String CLIENT_SUFFIX = "Client"; //$NON-NLS-1$ - private static final String CONNECTOR_SUFFIX = "Connector"; //$NON-NLS-1$ - - private IDataModel ejbModel; - private IDataModel ejbFacetModel; - private IDataModel webModel; - private IDataModel webFacetModel; - private IDataModel jcaModel; - private IDataModel jcaFacetModel; - private IDataModel clientModel; - private IDataModel clientFacetModel; - - public DefaultJ2EEComponentCreationDataModelProvider() { - super(); - } - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PROJECT_NAME); - propertyNames.add(EAR_COMPONENT_NAME); - propertyNames.add(APPCLIENT_COMPONENT_NAME); - propertyNames.add(WEB_COMPONENT_NAME); - propertyNames.add(EJB_COMPONENT_NAME); - propertyNames.add(CONNECTOR_COMPONENT_NAME); - propertyNames.add(J2EE_VERSION); - propertyNames.add(CREATE_EJB); - propertyNames.add(CREATE_WEB); - propertyNames.add(CREATE_APPCLIENT); - propertyNames.add(CREATE_CONNECTOR); - propertyNames.add(MODULE_NAME_COLLISIONS_VALIDATION); - propertyNames.add(ENABLED); - propertyNames.add(NESTED_MODEL_CLIENT); - propertyNames.add(NESTED_MODEL_EJB); - propertyNames.add(NESTED_MODEL_JCA); - propertyNames.add(NESTED_MODEL_WEB); - propertyNames.add(FACET_RUNTIME); - return propertyNames; - } - - - public IDataModelOperation getDefaultOperation() { - return new DefaultJ2EEComponentCreationOperation(model); - } - - public void init() { - initNestedCreationModels(); - super.init(); - } - - protected void initNestedCreationModels() { - clientModel = DataModelFactory.createDataModel(new AppClientFacetProjectCreationDataModelProvider()); - model.addNestedModel(NESTED_MODEL_CLIENT, clientModel); - clientFacetModel = ((FacetDataModelMap)clientModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP)).getFacetDataModel(J2EEProjectUtilities.APPLICATION_CLIENT); - clientFacetModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, false); - clientFacetModel.setBooleanProperty(J2EEModuleFacetInstallDataModelProvider.PROHIBIT_ADD_TO_EAR, true); - - EjbModuleExtension ejbExt = EarModuleManager.getEJBModuleExtension(); - if (ejbExt != null) { - ejbModel = ejbExt.createProjectDataModel(); - if (ejbModel != null){ - model.addNestedModel(NESTED_MODEL_EJB, ejbModel); - ejbFacetModel = ((FacetDataModelMap)ejbModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP)).getFacetDataModel(J2EEProjectUtilities.EJB); - ejbFacetModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, false); - ejbFacetModel.setBooleanProperty(J2EEModuleFacetInstallDataModelProvider.PROHIBIT_ADD_TO_EAR, true); - } - } - WebModuleExtension webExt = EarModuleManager.getWebModuleExtension(); - if (webExt != null) { - webModel = webExt.createProjectDataModel(); - if (webModel != null){ - model.addNestedModel(NESTED_MODEL_WEB, webModel); - webFacetModel = ((FacetDataModelMap)webModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP)).getFacetDataModel(J2EEProjectUtilities.DYNAMIC_WEB); - webFacetModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, false); - webFacetModel.setBooleanProperty(J2EEModuleFacetInstallDataModelProvider.PROHIBIT_ADD_TO_EAR, true); - } - } - JcaModuleExtension rarExt = EarModuleManager.getJCAModuleExtension(); - if (rarExt != null) { - jcaModel = rarExt.createProjectDataModel(); - if (jcaModel != null){ - model.addNestedModel(NESTED_MODEL_JCA, jcaModel); - jcaFacetModel = ((FacetDataModelMap)jcaModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP)).getFacetDataModel(J2EEProjectUtilities.JCA); - jcaFacetModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, false); - jcaFacetModel.setBooleanProperty(J2EEModuleFacetInstallDataModelProvider.PROHIBIT_ADD_TO_EAR, true); - } - } - } - - public Object getDefaultProperty(String propertyName) { - if (propertyName.startsWith(CREATE_BASE)) - return getDefaultCreateValue(propertyName); - if (propertyName.equals(ENABLED)) - return Boolean.TRUE; - return super.getDefaultProperty(propertyName); - } - - - private Object getDefaultCreateValue(String propertyName) { - if (propertyName.equals(CREATE_CONNECTOR)) { - int version = getIntProperty(J2EE_VERSION); - if (version < J2EEVersionConstants.J2EE_1_3_ID) - return Boolean.FALSE; - } - return Boolean.TRUE; - } - - private int convertPropertyNameToInt(String propertyName) { - if (propertyName.equals(CREATE_WEB)) { - return WEB; - } else if (propertyName.equals(CREATE_EJB)) { - return EJB; - } else if (propertyName.equals(CREATE_CONNECTOR)) { - return RAR; - } else if (propertyName.equals(CREATE_APPCLIENT)) { - return CLIENT; - } - return -1; - } - - private String ensureUniqueProjectName(String projectName) { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - String newName = projectName; - int index = 0; - IProject proj = root.getProject(newName); - while (proj.exists()) { - index++; - newName = projectName + index; - proj = root.getProject(newName); - } - return newName; - } - - public boolean propertySet(String propertyName, Object propertyValue) { - boolean notify = super.propertySet(propertyName, propertyValue); - if (propertyName.equals(J2EE_VERSION)) { - updatedJ2EEVersion((Integer) propertyValue); - return true; - }else if (propertyName.startsWith(CREATE_BASE)){ - notifyEnablement(convertPropertyNameToInt(propertyName)); - }else if (propertyName.equals(EAR_COMPONENT_NAME)) { - setDefaultComponentNames((String) propertyValue); - }else if(webModel != null && propertyName.equals(WEB_COMPONENT_NAME)){ - webModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, propertyValue); - }else if(clientModel != null && propertyName.equals(APPCLIENT_COMPONENT_NAME)){ - clientModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, propertyValue); - }else if(ejbModel != null && propertyName.equals(EJB_COMPONENT_NAME)){ - ejbModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, propertyValue); - }else if(jcaModel != null && propertyName.equals(CONNECTOR_COMPONENT_NAME)){ - jcaModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, propertyValue); - } - else if(FACET_RUNTIME.equals(propertyName)){ - if(webModel != null){ - webModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, propertyValue); - } - if(clientModel != null){ - clientModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, propertyValue); - } - if(ejbModel != null){ - ejbModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, propertyValue); - } - if(jcaModel != null){ - jcaModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, propertyValue); - } - } - return notify; - } - - private void notifyEnablement(int flag) { - String propertyName = null; - switch (flag) { - case EJB : - propertyName = EJB_COMPONENT_NAME; - break; - case WEB : - propertyName = WEB_COMPONENT_NAME; - break; - case CLIENT : - propertyName = APPCLIENT_COMPONENT_NAME; - break; - case RAR : - propertyName = CONNECTOR_COMPONENT_NAME; - } - if (propertyName != null) - model.notifyPropertyChange(propertyName, IDataModel.ENABLE_CHG); - } - - private void updatedJ2EEVersion(Integer version) { - setNestedJ2EEVersion(version); - if (version.intValue() < J2EEVersionConstants.J2EE_1_3_ID && model.isPropertySet(CREATE_CONNECTOR)) { - model.setProperty(CREATE_CONNECTOR, Boolean.FALSE); - } - } - - public IStatus validateModuleNameCollisions() { - if (getBooleanProperty(ENABLED)) { - ArrayList list = new ArrayList(); - String projectName = null; - String actualProjectName = null; - boolean errorCollision = false; - boolean errorNoSelection = true; - if (getBooleanProperty(CREATE_APPCLIENT)) { - actualProjectName = clientModel.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - projectName = WTPPlugin.isPlatformCaseSensitive() ? actualProjectName : actualProjectName.toLowerCase(); - list.add(projectName); - errorNoSelection = false; - } - if (getBooleanProperty(CREATE_EJB)) { - actualProjectName = ejbModel.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - projectName = WTPPlugin.isPlatformCaseSensitive() ? actualProjectName : actualProjectName.toLowerCase(); - if (!list.contains(projectName)) { - list.add(projectName); - } else { - errorCollision = true; - } - errorNoSelection = false; - } - if (!errorCollision && getBooleanProperty(CREATE_WEB)) { - actualProjectName = webModel.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - projectName = WTPPlugin.isPlatformCaseSensitive() ? actualProjectName : actualProjectName.toLowerCase(); - if (!list.contains(projectName)) { - list.add(projectName); - } else { - errorCollision = true; - } - errorNoSelection = false; - } - if (!errorCollision && getBooleanProperty(CREATE_CONNECTOR)) { - actualProjectName = jcaModel.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - projectName = WTPPlugin.isPlatformCaseSensitive() ? actualProjectName : actualProjectName.toLowerCase(); - if (!list.contains(projectName)) { - list.add(projectName); - } else { - errorCollision = true; - } - errorNoSelection = false; - } - if (errorCollision) { - return J2EEPlugin.newErrorStatus(EARCreationResourceHandler.getString("DuplicateModuleNames", new Object[]{actualProjectName}), null); //$NON-NLS-1$ - } else if (errorNoSelection) { - return J2EEPlugin.newErrorStatus(EARCreationResourceHandler.NoModulesSelected, null); - } - } - - return OK_STATUS; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#doValidateProperty(java.lang.String) - */ - public IStatus validate(String propertyName) { - - if (getBooleanProperty(CREATE_APPCLIENT) && propertyName.equals(APPCLIENT_COMPONENT_NAME)) { - return clientModel.validateProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - } - - if (getBooleanProperty(CREATE_WEB) && propertyName.equals(WEB_COMPONENT_NAME)) { - return webModel.validateProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - } - - if (getBooleanProperty(CREATE_EJB) && propertyName.equals(EJB_COMPONENT_NAME)) { - return ejbModel.validateProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - } - - if (getBooleanProperty(CREATE_CONNECTOR) && propertyName.equals(CONNECTOR_COMPONENT_NAME)) { - return jcaModel.validateProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME); - } - return super.validate(propertyName); - } - -// private IStatus validateComponentName(String componentName) { -// IStatus status = OK_STATUS; -// if (status.isOK()) { -// if (componentName.indexOf("#") != -1) { //$NON-NLS-1$ -// String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.ERR_INVALID_CHARS); -// return WTPCommonPlugin.createErrorStatus(errorMessage); -// } else if (componentName == null || componentName.equals("")) { //$NON-NLS-1$ -// String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.ERR_EMPTY_MODULE_NAME); -// return WTPCommonPlugin.createErrorStatus(errorMessage); -// } -// } -// return status; -// } - - private void setDefaultNestedComponentName(String name, int flag) { - IDataModel modModule = getNestedModel(flag); - if (modModule != null) { - String compName = ensureUniqueProjectName(name); - modModule.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, compName); - } - } - - private void setDefaultComponentNames(String base) { - String componentName; - if (base.endsWith(EJB_SUFFIX)) - componentName = base; - else - componentName = base + EJB_SUFFIX; - setDefaultNestedComponentName(componentName, EJB); - setProperty(EJB_COMPONENT_NAME, componentName); - if (base.endsWith(WEB_SUFFIX)) - componentName = base; - else - componentName = base + WEB_SUFFIX; - setDefaultNestedComponentName(componentName, WEB); - setProperty(WEB_COMPONENT_NAME, componentName); - if (base.endsWith(CLIENT_SUFFIX)) - componentName = base; - else - componentName = base + CLIENT_SUFFIX; - setDefaultNestedComponentName(componentName, CLIENT); - setProperty(APPCLIENT_COMPONENT_NAME, componentName); - if (base.endsWith(CONNECTOR_SUFFIX)) - componentName = base; - else - componentName = base + CONNECTOR_SUFFIX; - setDefaultNestedComponentName(componentName, RAR); - setProperty(CONNECTOR_COMPONENT_NAME, componentName); - - - // update the EAR Project Name field as well - if(webModel != null){ - webModel.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, base); - } - if(clientModel != null){ - clientModel.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, base); - } - if(ejbModel != null){ - ejbModel.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, base); - } - if(jcaModel != null){ - jcaModel.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, base); - } - } - - private void setNestedJ2EEVersion(Object j2eeVersion) { - int j2eeVer = ((Integer) j2eeVersion).intValue(); - if (ejbFacetModel != null) { - String facetVersionString = J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToEJBVersionID(j2eeVer)); - IProjectFacetVersion facetVersion = ProjectFacetsManager.getProjectFacet(ejbFacetModel.getStringProperty(IFacetDataModelProperties.FACET_ID)).getVersion(facetVersionString); - ejbFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, facetVersion); - } - if (webFacetModel != null) { - String facetVersionString = J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToWebVersionID(j2eeVer)); - IProjectFacetVersion facetVersion = ProjectFacetsManager.getProjectFacet(webFacetModel.getStringProperty(IFacetDataModelProperties.FACET_ID)).getVersion(facetVersionString); - webFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, facetVersion); - } - if (jcaFacetModel != null) { - String facetVersionString = J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToConnectorVersionID(j2eeVer)); - IProjectFacetVersion facetVersion = ProjectFacetsManager.getProjectFacet(jcaFacetModel.getStringProperty(IFacetDataModelProperties.FACET_ID)).getVersion(facetVersionString); - jcaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, facetVersion); - } - if (clientFacetModel != null){ - String facetVersionString = J2EEVersionUtil.convertVersionIntToString(j2eeVer); - IProjectFacetVersion facetVersion = ProjectFacetsManager.getProjectFacet(clientFacetModel.getStringProperty(IFacetDataModelProperties.FACET_ID)).getVersion(facetVersionString); - clientFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, facetVersion); - } - } - - private IDataModel getNestedModel(int flag) { - switch (flag) { - case EJB : - return ejbModel; - case WEB : - return webModel; - case RAR : - return jcaModel; - case CLIENT : - return clientModel; - } - return null; - } - - public boolean isPropertyEnabled(String propertyName) { - if (propertyName.equals(CREATE_CONNECTOR)) { - int version = getIntProperty(J2EE_VERSION); - return version > J2EEVersionConstants.J2EE_1_2_ID; - } - if( propertyName.equals(CONNECTOR_COMPONENT_NAME)){ - return getBooleanProperty(CREATE_CONNECTOR); - } - if (propertyName.equals(APPCLIENT_COMPONENT_NAME)) - return getBooleanProperty(CREATE_APPCLIENT); - if (propertyName.equals(EJB_COMPONENT_NAME)) - return getBooleanProperty(CREATE_EJB); - if (propertyName.equals(WEB_COMPONENT_NAME)) - return getBooleanProperty(CREATE_WEB); - return super.isPropertyEnabled(propertyName); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/EARCreationResourceHandler.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/EARCreationResourceHandler.java deleted file mode 100644 index 64e6e194e..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/EARCreationResourceHandler.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.earcreation; - - - -import org.eclipse.osgi.util.NLS; - -public class EARCreationResourceHandler extends NLS { - - private static final String BUNDLE_NAME = "earcreation";//$NON-NLS-1$ - - private EARCreationResourceHandler() { - // Do not instantiate - } - - public static String Error_occured_getting_appl_ERROR_; - public static String Error_occured_getting_appl1_ERROR_; - public static String Creating__UI_; - public static String Creating_EAR_Project_UI_; - public static String The_project_already_exist_ERROR_; - public static String EARProjectCreationOperatio_ERROR_; - public static String ABS_PATH_CHANGED_UI_; - public static String UNSAVED_CHANGES_WARN_; - public static String PROJECT_MAP_PROBLEMS_ERROR_; - public static String MODULE_PROJECTS_CLOSED_WARN_; - public static String Add_Module_Command_Label_UI_; - public static String Remove_Module_Command_Label_UI_; - - public static String Set_project_UI_; - public static String Add_Utility_JAR_UI; - public static String REM_UTIL_JAR_UI; - public static String PROJ_DESC_UPDATE_ERROR_UI_; - public static String Not_an_ear_project_UI_; - public static String EAR_PROJECT_MUST_BE_OPEN_UI_; - public static String Updating_absolute_paths_UI_; - public static String DuplicateModuleNames; - public static String NoModulesSelected; - - public static String KEY_1; - public static String KEY_2; - public static String KEY_3; - public static String KEY_4; - public static String KEY_5; - public static String KEY_6; - public static String KEY_7; - public static String KEY_8; - public static String KEY_9; - public static String KEY_10; - public static String KEY_11; - public static String KEY_12; - public static String KEY_13; - public static String KEY_14; - public static String KEY_15; - public static String KEY_16; - - public static String J2EEUtilityJarListImportOperation_UI_Import_Utility_Jars; - public static String J2EEUtilityJarListImportOperation_UI_Preparing_to_import; - public static String J2EEUtilityJarListImportOperation_UI_2; - public static String J2EEUtilityJarListImportDataModel_0; - public static String J2EEUtilityJarListImportDataModel_Specify_Valid_Project; - public static String J2EEUtilityJarListImportDataModel_Select_Jar; - public static String J2EEUtilityJarListImportDataModel_Specify_Linked_Path; - public static String J2EEUtilityJarListImportOperation_There_were_no_utility_jars_selected; - public static String J2EEUtilityJarListImportDataModel_Linked_Path_Exists; - - - public static String CreateProjectWithExtractedJarOperation_Create_project_with_extracted_conte_; - public static String CopyArchiveIntoProjectOperation_Copying_archive_into_selected_proje_; - public static String CopyArchiveIntoProjectOperation_Found_existing_file_0_; - public static String CreateProjectWithLinkedJarOperation_Creating_project_with_linked_archiv_; - public static String CreateProjectWithLinkedJarOperation_Cannot_link_utility_jar_into_a_clos_; - public static String CreateProjectWithLinkedJarOperation_File_already_exists_0_; - public static String LinkArchiveIntoProjectOperation_Linking_archive_into_selected_proje_; - - public static String EARImportDataModel_UI_0; - public static String EARImportDataModel_UI_1; - public static String EARImportDataModel_UI_1a; - public static String EARImportDataModel_UI_2; - public static String EARImportDataModel_UI_2a; - public static String EARImportDataModel_UI_3; - public static String EARImportDataModel_UI_4; - public static String ModuleMappingImpl_UI_0; - public static String UtilityJARMappingImpl_UI_0; - public static String importWrongType; - public static String importWrongVersion; - public static String EAR_PROJECTNAME_SAMEAS_MODULE; - - static { - NLS.initializeMessages(BUNDLE_NAME, EARCreationResourceHandler.class); - } - - public static String getString(String key, Object[] args) { - return NLS.bind(key, args); - } - - public static final String ADD_MODULE_MODULE_TYPE = KEY_1; - public static final String ADD_MODULE_MODULE_EXISTS = KEY_2; - public static final String ADD_MODULE_MODULE_CLOSED = KEY_3; - public static final String ADD_MODULE_MODULE_NULL = KEY_4; - public static final String ADD_PROJECT_URI_EXISTS = KEY_5; - public static final String ADD_PROJECT_NOT_JAVA = KEY_6; - public static final String ADD_PROJECT_UTIL_URI = KEY_7; - public static final String ADD_PROJECT_UTIL_MAPPED = KEY_8; - public static final String ADD_PROJECT_NOT_EAR = KEY_9; - public static final String ADD_PROJECT_URI_EMPTY = KEY_10; - public static final String NOT_AN_APP_CLIENT = KEY_11; - public static final String NOT_AN_EAR = KEY_12; - public static final String NOT_AN_EJB = KEY_13; - public static final String NOT_A_RAR = KEY_14; - public static final String NOT_A_WAR = KEY_15; - public static final String SERVER_TARGET_NOT_SUPPORT_EAR = KEY_16; -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/EarFacetInstallDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/EarFacetInstallDataModelProvider.java deleted file mode 100644 index a7a961fdf..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/EarFacetInstallDataModelProvider.java +++ /dev/null @@ -1,83 +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.j2ee.internal.earcreation; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPreferences; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants; -import org.eclipse.jst.j2ee.project.facet.J2EEFacetInstallDataModelProvider; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -public class EarFacetInstallDataModelProvider extends J2EEFacetInstallDataModelProvider implements IEarFacetInstallDataModelProperties { - - public Set getPropertyNames() { - Set names = super.getPropertyNames(); - names.add(CONTENT_DIR); - names.add(J2EE_PROJECTS_LIST); - names.add(JAVA_PROJECT_LIST); - return names; - } - - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(FACET_ID)) { - return ENTERPRISE_APPLICATION; - } else if (propertyName.equals(CONTENT_DIR)) { - return J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.APPLICATION_CONTENT_FOLDER); - } else if (propertyName.equals(J2EE_PROJECTS_LIST) || propertyName.equals(JAVA_PROJECT_LIST)) { - return Collections.EMPTY_LIST; - } else if(propertyName.equals(GENERATE_DD)){ - IProjectFacetVersion facetVersion = (IProjectFacetVersion)getProperty(FACET_VERSION); - if(facetVersion == IJ2EEFacetConstants.ENTERPRISE_APPLICATION_50){ - return Boolean.valueOf(J2EEPlugin.getDefault().getJ2EEPreferences().getBoolean(J2EEPreferences.Keys.APPLICATION_GENERATE_DD)); - } - return Boolean.TRUE; - } - return super.getDefaultProperty(propertyName); - } - - public IStatus validate(String name) { - if (name.equals(J2EE_PROJECTS_LIST)) { - return validateTargetComponentVersion((List) model.getProperty(J2EE_PROJECTS_LIST)); - } else if (name.equals(CONTENT_DIR)) { - return validateFolderName(getStringProperty(CONTENT_DIR)); - } - return super.validate(name); - } - - private IStatus validateTargetComponentVersion(List list) { - int earVersion = getJ2EEVersion(); - for (Iterator iter = list.iterator(); iter.hasNext();) { - IProject handle = (IProject) iter.next(); - IVirtualComponent comp = ComponentCore.createComponent(handle.getProject()); - if (comp == null) return OK_STATUS; //Not a faceted project, so version not relevant - int compVersion = J2EEVersionUtil.convertVersionStringToInt(comp); - if (earVersion < compVersion) { - String errorStatus = "The Module specification level of " + handle.getName() + ", is incompatible with the containing EAR version"; //$NON-NLS-1$ - return J2EEPlugin.newErrorStatus(errorStatus, null); - } - } - return OK_STATUS; - } - - protected int convertFacetVersionToJ2EEVersion(IProjectFacetVersion version) { - return J2EEVersionUtil.convertVersionStringToInt(version.getVersionString()); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/IDefaultJ2EEComponentCreationDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/IDefaultJ2EEComponentCreationDataModelProperties.java deleted file mode 100644 index 5fc021a25..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/IDefaultJ2EEComponentCreationDataModelProperties.java +++ /dev/null @@ -1,75 +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.internal.earcreation; - -public interface IDefaultJ2EEComponentCreationDataModelProperties { - /** - * Required - This is the name of the project. type String - */ - public static final String PROJECT_NAME = "DefaultJ2EEComponentCreationDataModel.PROJECT_NAME"; //$NON-NLS-1$ - /** - * Required - This is the name of the ear. type String - */ - public static final String EAR_COMPONENT_NAME = "DefaultJ2EEComponentCreationDataModel.EAR_NAME"; //$NON-NLS-1$ - /** - * Required - This is the name of the app client. type String - */ - public static final String APPCLIENT_COMPONENT_NAME = "DefaultJ2EEComponentCreationDataModel.APPCLIENT_NAME"; //$NON-NLS-1$ - /** - * Required - This is the name of the WEB. type String - */ - public static final String WEB_COMPONENT_NAME = "DefaultJ2EEComponentCreationDataModel.WEB_COMPONENT_NAME"; //$NON-NLS-1$ - /** - * Required - This is the name of the EJB. type String - */ - public static final String EJB_COMPONENT_NAME = "DefaultJ2EEComponentCreationDataModel.EJB_COMPONENT_NAME"; //$NON-NLS-1$ - /** - * Required - This is the name of the connector. type String - */ - public static final String CONNECTOR_COMPONENT_NAME = "DefaultJ2EEComponentCreationDataModel.CONNECTOR_COMPONENT_NAME"; //$NON-NLS-1$ - - public static final String J2EE_VERSION = "DefaultJ2EEComponentCreationDataModel.J2EE_VERSION"; //$NON-NLS-1$ - /** - * Default is true. type Boolean - */ - public static final String CREATE_EJB = "DefaultJ2EEComponentCreationDataModel.CREATE_EJB"; - /** - * Default is true. type Boolean - */ - public static final String CREATE_WEB = "DefaultJ2EEComponentCreationDataModel.CREATE_WEB"; - /** - * Default is true. type Boolean - */ - public static final String CREATE_APPCLIENT = "DefaultJ2EEComponentCreationDataModel.CREATE_CLIENT"; - /** - * Default is true. type Boolean - */ - public static final String CREATE_CONNECTOR = "DefaultJ2EEComponentCreationDataModel.CREATE_CONNECTOR"; - - /** - * Used for validation only; validates no collsions between various module names. Do not set - * this value. - */ - public static final String MODULE_NAME_COLLISIONS_VALIDATION = "DefaultJ2EEComponentCreationDataModel.MODULE_NAME_COLLISIONS_VALIDATION"; //$NON-NLS-1$ - - /** - * Default is true. type Boolean - */ - public static final String ENABLED = "DefaultJ2EEComponentCreationDataModel.ENABLED"; //$NON-NLS-1$ - - public static final String NESTED_MODEL_EJB = "DefaultJ2EEComponentCreationDataModel.NESTED_MODEL_EJB"; //$NON-NLS-1$ - public static final String NESTED_MODEL_WEB = "DefaultJ2EEComponentCreationDataModel.NESTED_MODEL_WEB"; //$NON-NLS-1$ - public static final String NESTED_MODEL_JCA = "DefaultJ2EEComponentCreationDataModel.NESTED_MODEL_JCA"; //$NON-NLS-1$ - public static final String NESTED_MODEL_CLIENT = "DefaultJ2EEComponentCreationDataModel.NESTED_MODEL_CLIENT"; //$NON-NLS-1$ - - public static final String FACET_RUNTIME = "DefaultJ2EEComponentCreationDataModel.FACET_RUNTIME";//$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/IEarFacetInstallDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/IEarFacetInstallDataModelProperties.java deleted file mode 100644 index 53e754ed6..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/IEarFacetInstallDataModelProperties.java +++ /dev/null @@ -1,21 +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.j2ee.internal.earcreation; - -/** - * This interface is being made public. Please use {@link org.eclipse.jst.j2ee.earcreation.IEarFacetInstallDataModelProperties} - * - * @deprecated - * @see org.eclipse.jst.j2ee.earcreation.IEarFacetInstallDataModelProperties - */ -public interface IEarFacetInstallDataModelProperties extends org.eclipse.jst.j2ee.earcreation.IEarFacetInstallDataModelProperties { - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/ILooseConfigConstants.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/ILooseConfigConstants.java deleted file mode 100644 index fd059de77..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/ILooseConfigConstants.java +++ /dev/null @@ -1,29 +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.internal.earcreation; - - -import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfigRegister; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -public interface ILooseConfigConstants { - /** - * The short name of the loose configuration file; will most often need to use - * {@link #CONFIG_PATH} - */ - String CONFIG_FILE_NAME = "looseconfig.xmi"; //$NON-NLS-1$ - /** The absolute path to the loose configuration file */ - String CONFIG_PATH = J2EEPlugin.getDefault().getStateLocation().append(CONFIG_FILE_NAME).toOSString(); - /** The property name used by WebSphere to lookup the loose configuration location to load */ - String WAS_PROPERTY = LooseConfigRegister.LOOSE_CONFIG_PROPERTY; - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/EARProjectMap.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/EARProjectMap.java deleted file mode 100644 index 49d57deec..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/EARProjectMap.java +++ /dev/null @@ -1,40 +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.internal.earcreation.modulemap; - - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - - -/** - * @lastgen interface EARProjectMap extends EObject {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public interface EARProjectMap extends EObject { - /** - * @generated This field/method will be replaced during code generation - * @return The list of Mappings references - */ - EList getMappings(); - - /** - * @generated This field/method will be replaced during code generation - * @return The list of UtilityJARMappings references - */ - EList getUtilityJARMappings(); - -} //EARProjectMap diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/EARProjectMapImpl.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/EARProjectMapImpl.java deleted file mode 100644 index ed53a879c..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/EARProjectMapImpl.java +++ /dev/null @@ -1,171 +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.internal.earcreation.modulemap; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - - - -/** - * @lastgen class EARProjectMapImpl extends EObjectImpl implements EARProjectMap, EObject {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public class EARProjectMapImpl extends EObjectImpl implements EARProjectMap { - /** - * @generated This field/method will be replaced during code generation. - */ - /** - * @generated This field/method will be replaced during code generation. - */ - protected EList mappings = null; - /** - * @generated This field/method will be replaced during code generation. - */ - protected EList utilityJARMappings = null; - - - - /** - * @generated This field/method will be replaced during code generation. - */ - protected EARProjectMapImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return ModulemapPackage.eINSTANCE.getEARProjectMap(); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public EList getMappings() { - if (mappings == null) { - mappings = new EObjectContainmentEList(ModuleMapping.class, this, ModulemapPackage.EAR_PROJECT_MAP__MAPPINGS); - } - return mappings; - } - - /** - * @generated This field/method will be replaced during code generation - */ - public EList getUtilityJARMappings() { - if (utilityJARMappings == null) { - utilityJARMappings = new EObjectContainmentEList(UtilityJARMapping.class, this, ModulemapPackage.EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS); - } - return utilityJARMappings; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) { - case ModulemapPackage.EAR_PROJECT_MAP__MAPPINGS : - return ((InternalEList) getMappings()).basicRemove(otherEnd, msgs); - case ModulemapPackage.EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS : - return ((InternalEList) getUtilityJARMappings()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.EAR_PROJECT_MAP__MAPPINGS : - return getMappings(); - case ModulemapPackage.EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS : - return getUtilityJARMappings(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.EAR_PROJECT_MAP__MAPPINGS : - getMappings().clear(); - getMappings().addAll((Collection) newValue); - return; - case ModulemapPackage.EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS : - getUtilityJARMappings().clear(); - getUtilityJARMappings().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.EAR_PROJECT_MAP__MAPPINGS : - getMappings().clear(); - return; - case ModulemapPackage.EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS : - getUtilityJARMappings().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.EAR_PROJECT_MAP__MAPPINGS : - return mappings != null && !mappings.isEmpty(); - case ModulemapPackage.EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS : - return utilityJARMappings != null && !utilityJARMappings.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - -} //EARProjectMapImpl diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModuleMapping.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModuleMapping.java deleted file mode 100644 index cee99ee07..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModuleMapping.java +++ /dev/null @@ -1,55 +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.internal.earcreation.modulemap; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.application.Module; - - - -/** - * @lastgen interface ModuleMapping extends EObject {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - * </p> - */ -public interface ModuleMapping extends EObject { - /** - * @generated This field/method will be replaced during code generation - * @return The value of the ProjectName attribute - */ - String getProjectName(); - - /** - * @generated This field/method will be replaced during code generation - * @param value - * The new value of the ProjectName attribute - */ - void setProjectName(String value); - - /** - * @generated This field/method will be replaced during code generation - * @return The Module reference - */ - Module getModule(); - - /** - * @generated This field/method will be replaced during code generation - * @param l - * The new value of the Module reference - */ - void setModule(Module value); - -} //ModuleMapping diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModuleMappingImpl.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModuleMappingImpl.java deleted file mode 100644 index 333f8d9b7..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModuleMappingImpl.java +++ /dev/null @@ -1,194 +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.internal.earcreation.modulemap; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; - - -/** - * @lastgen class ModuleMappingImpl extends EObjectImpl implements ModuleMapping, EObject {} - * * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public class ModuleMappingImpl extends EObjectImpl implements ModuleMapping { - /** - * The default value of the '{@link #getProjectName() <em>Project Name</em>}' attribute. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @see #getProjectName() - * @generated - * @ordered - */ - protected static final String PROJECT_NAME_EDEFAULT = null; - - /** - * @generated This field/method will be replaced during code generation. - */ - /** - * @generated This field/method will be replaced during code generation. - */ - protected String projectName = PROJECT_NAME_EDEFAULT; - /** - * @generated This field/method will be replaced during code generation. - */ - protected Module module = null; - - /** - * @generated This field/method will be replaced during code generation. - */ - protected ModuleMappingImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return ModulemapPackage.eINSTANCE.getModuleMapping(); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public String getProjectName() { - return projectName; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void setProjectName(String newProjectName) { - String oldProjectName = projectName; - projectName = newProjectName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ModulemapPackage.MODULE_MAPPING__PROJECT_NAME, oldProjectName, projectName)); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public Module getModule() { - if (module != null && module.eIsProxy()) { - Module oldModule = module; - module = (Module) EcoreUtil.resolve(module, this); - if (module != oldModule) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModulemapPackage.MODULE_MAPPING__MODULE, oldModule, module)); - } - } - return module; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Module basicGetModule() { - return module; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void setModule(Module newModule) { - Module oldModule = module; - module = newModule; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ModulemapPackage.MODULE_MAPPING__MODULE, oldModule, module)); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.MODULE_MAPPING__PROJECT_NAME : - return getProjectName(); - case ModulemapPackage.MODULE_MAPPING__MODULE : - if (resolve) - return getModule(); - return basicGetModule(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.MODULE_MAPPING__PROJECT_NAME : - return PROJECT_NAME_EDEFAULT == null ? projectName != null : !PROJECT_NAME_EDEFAULT.equals(projectName); - case ModulemapPackage.MODULE_MAPPING__MODULE : - return module != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.MODULE_MAPPING__PROJECT_NAME : - setProjectName((String) newValue); - return; - case ModulemapPackage.MODULE_MAPPING__MODULE : - setModule((Module) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.MODULE_MAPPING__PROJECT_NAME : - setProjectName(PROJECT_NAME_EDEFAULT); - return; - case ModulemapPackage.MODULE_MAPPING__MODULE : - setModule((Module) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public String toString() { - if (eIsProxy()) - return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(EARCreationResourceHandler.getString("ModuleMappingImpl_UI_0", new Object[]{projectName})); //$NON-NLS-1$ - return result.toString(); - } - -} //ModuleMappingImpl diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapAdapterFactory.java deleted file mode 100644 index ae34dbb68..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapAdapterFactory.java +++ /dev/null @@ -1,130 +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.internal.earcreation.modulemap; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; - - - -/** - * @lastgen class ModulemapAdapterFactory extends AdapterFactoryImpl {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public class ModulemapAdapterFactory extends AdapterFactoryImpl { - /** - * @generated This field/method will be replaced during code generation. - */ - - /** - * @generated This field/method will be replaced during code generation. - */ - protected static ModulemapPackage modelPackage; - - /** - * @generated This field/method will be replaced during code generation. - */ - public ModulemapAdapterFactory() { - if (modelPackage == null) { - modelPackage = ModulemapPackage.eINSTANCE; - } - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the <code>createXXX</code> methods. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected ModulemapSwitch modelSwitch = new ModulemapSwitch() { - public Object caseModuleMapping(ModuleMapping object) { - return createModuleMappingAdapter(); - } - - public Object caseEARProjectMap(EARProjectMap object) { - return createEARProjectMapAdapter(); - } - - public Object caseUtilityJARMapping(UtilityJARMapping object) { - return createUtilityJARMappingAdapter(); - } - - public Object defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * @generated This field/method will be replaced during code generation. - */ - public Adapter createAdapter(Notifier target) { - return (Adapter) modelSwitch.doSwitch((EObject) target); - } - - - /** - * By default create methods return null so that we can easily ignore cases. It's useful to - * ignore a case when inheritance will catch all the cases anyway. - */ - - /** - * @generated This field/method will be replaced during code generation. - */ - public Adapter createEARProjectMapAdapter() { - return null; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public Adapter createModuleMappingAdapter() { - return null; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public Adapter createUtilityJARMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. <!-- begin-user-doc --> This default - * implementation returns null. <!-- end-user-doc --> - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} //ModulemapAdapterFactory diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapFactory.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapFactory.java deleted file mode 100644 index 33a1f779e..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapFactory.java +++ /dev/null @@ -1,56 +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.internal.earcreation.modulemap; - -import org.eclipse.emf.ecore.EFactory; - - -/** - * @lastgen interface ModulemapFactory extends EFactory {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public interface ModulemapFactory extends EFactory { - /** - * The singleton instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - ModulemapFactory eINSTANCE = new org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapFactoryImpl(); - - /** - * @generated This field/method will be replaced during code generation - * @return EARProjectMap value - */ - EARProjectMap createEARProjectMap(); - - /** - * @generated This field/method will be replaced during code generation - * @return ModuleMapping value - */ - ModuleMapping createModuleMapping(); - - /** - * @generated This field/method will be replaced during code generation - * @return UtilityJARMapping value - */ - UtilityJARMapping createUtilityJARMapping(); - - /** - * @generated This field/method will be replaced during code generation. - */ - ModulemapPackage getModulemapPackage(); - -} //ModulemapFactory diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapFactoryImpl.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapFactoryImpl.java deleted file mode 100644 index 1f132f364..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapFactoryImpl.java +++ /dev/null @@ -1,92 +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.internal.earcreation.modulemap; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EFactoryImpl; - - - -/** - * @lastgen class ModulemapFactoryImpl extends EFactoryImpl implements ModulemapFactory, EFactory {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public class ModulemapFactoryImpl extends EFactoryImpl implements ModulemapFactory { - - /** - * @generated This field/method will be replaced during code generation. - */ - public ModulemapFactoryImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case ModulemapPackage.MODULE_MAPPING : - return createModuleMapping(); - case ModulemapPackage.EAR_PROJECT_MAP : - return createEARProjectMap(); - case ModulemapPackage.UTILITY_JAR_MAPPING : - return createUtilityJARMapping(); - } - return null; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EARProjectMap createEARProjectMap() { - EARProjectMapImpl earProjectMap = new EARProjectMapImpl(); - return earProjectMap; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public ModuleMapping createModuleMapping() { - ModuleMappingImpl moduleMapping = new ModuleMappingImpl(); - return moduleMapping; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public UtilityJARMapping createUtilityJARMapping() { - UtilityJARMappingImpl utilityJARMapping = new UtilityJARMappingImpl(); - return utilityJARMapping; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public ModulemapPackage getModulemapPackage() { - return (ModulemapPackage) getEPackage(); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public static ModulemapPackage getPackage() { - return ModulemapPackage.eINSTANCE; - } - -} //ModulemapFactoryImpl diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapInit.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapInit.java deleted file mode 100644 index 78a5aed32..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapInit.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.earcreation.modulemap; - - -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil; - -//import com.ibm.etools.j2ee.internal.project.EAREditModel; -/** -* @deprecated -* Use -* <p> -* Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules -* as with the Flexible project changes a .modulemaps file will not exist in an EAR module and -* all the info that was captured in .modulemaps file will is now captured in the .component file -*/ - -public class ModulemapInit { - protected static boolean initialized = false; - - public static void init() { - init(true); - } - - public static void init(boolean shouldPreRegisterPackages) { - if (!initialized) { - initialized = true; - invokePrereqInits(shouldPreRegisterPackages); - if (shouldPreRegisterPackages) { - ExtendedEcoreUtil.preRegisterPackage("modulemap.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return ModulemapPackage.eINSTANCE; - } - public EFactory getEFactory() { - return ModulemapFactory.eINSTANCE; - } - }); - } - //ResourceDependencyRegister.registerDependency(J2EEConstants.APPLICATION_DD_URI_OBJ, EAREditModel.MODULE_MAP_URI_OBJ); - } - } - - public static void invokePrereqInits(boolean shouldPreRegisterPackages) { - //TODO Should remove.... - //com.ibm.ejs.models.base.extensions.init.ExtensionsInit.init(shouldPreRegisterPackages); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapPackage.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapPackage.java deleted file mode 100644 index 638f73a11..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapPackage.java +++ /dev/null @@ -1,181 +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.internal.earcreation.modulemap; - - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - - -/** - * @lastgen interface ModulemapPackage extends EPackage {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public interface ModulemapPackage extends EPackage { - /** - * The package name. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - String eNAME = "modulemap"; //$NON-NLS-1$ - - /** - * @generated This field/method will be replaced during code generation. - */ - - - /** - * @generated This field/method will be replaced during code generation. - */ - int EAR_PROJECT_MAP = 1; - /** - * @generated This field/method will be replaced during code generation. - */ - int MODULE_MAPPING = 0; - /** - * @generated This field/method will be replaced during code generation. - */ - int MODULE_MAPPING__PROJECT_NAME = 0; - /** - * @generated This field/method will be replaced during code generation. - */ - int MODULE_MAPPING__MODULE = 1; - - /** - * The number of structural features of the the '<em>Module Mapping</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int MODULE_MAPPING_FEATURE_COUNT = 2; - - /** - * @generated This field/method will be replaced during code generation. - */ - int EAR_PROJECT_MAP__MAPPINGS = 0; - /** - * @generated This field/method will be replaced during code generation. - */ - int EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS = 1; - - /** - * The number of structural features of the the '<em>EAR Project Map</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int EAR_PROJECT_MAP_FEATURE_COUNT = 2; - - /** - * @generated This field/method will be replaced during code generation. - */ - int UTILITY_JAR_MAPPING = 2; - /** - * @generated This field/method will be replaced during code generation. - */ - int UTILITY_JAR_MAPPING__PROJECT_NAME = 0; - /** - * @generated This field/method will be replaced during code generation. - */ - int UTILITY_JAR_MAPPING__URI = 1; - - - /** - * The number of structural features of the the '<em>Utility JAR Mapping</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int UTILITY_JAR_MAPPING_FEATURE_COUNT = 2; - - - /** - * @generated This field/method will be replaced during code generation. - */ - String eNS_URI = "modulemap.xmi"; //$NON-NLS-1$ - /** - * The package namespace name. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - String eNS_PREFIX = "modulemap"; //$NON-NLS-1$ - - /** - * The singleton instance of the package. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - ModulemapPackage eINSTANCE = org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackageImpl.init(); - - /** - * @generated This field/method will be replaced during code generation - * @return EARProjectMap object - */ - EClass getEARProjectMap(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EReference getEARProjectMap_Mappings(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EReference getEARProjectMap_UtilityJARMappings(); - - /** - * @generated This field/method will be replaced during code generation - * @return ModuleMapping object - */ - EClass getModuleMapping(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EAttribute getModuleMapping_ProjectName(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EReference getModuleMapping_Module(); - - /** - * @generated This field/method will be replaced during code generation - * @return UtilityJARMapping object - */ - EClass getUtilityJARMapping(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EAttribute getUtilityJARMapping_ProjectName(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EAttribute getUtilityJARMapping_Uri(); - - /** - * @generated This field/method will be replaced during code generation. - */ - ModulemapFactory getModulemapFactory(); - -} //ModulemapPackage diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapPackageImpl.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapPackageImpl.java deleted file mode 100644 index a4178da44..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapPackageImpl.java +++ /dev/null @@ -1,238 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.earcreation.modulemap; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.emf.ecore.impl.EcorePackageImpl; -import org.eclipse.jem.java.internal.impl.JavaRefPackageImpl; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.internal.impl.ApplicationPackageImpl; -import org.eclipse.jst.j2ee.common.internal.impl.CommonPackageImpl; - - - -/** - * @lastgen class ModulemapPackageImpl extends EPackageImpl implements ModulemapPackage, EPackage {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public class ModulemapPackageImpl extends EPackageImpl implements ModulemapPackage { - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - private EClass moduleMappingEClass = null; - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - private EClass earProjectMapEClass = null; - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - private EClass utilityJARMappingEClass = null; - - /** - * @generated This field/method will be replaced during code generation. - */ - private ModulemapPackageImpl() { - super(eNS_URI, ModulemapFactory.eINSTANCE); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public static ModulemapPackage init() { - // Initialize simple dependencies - CommonPackageImpl.init(); - JavaRefPackageImpl.init(); - ApplicationPackageImpl.init(); - EcorePackageImpl.init(); - - // Obtain or create and register package and interdependencies - ModulemapPackageImpl theModulemapPackage = (ModulemapPackageImpl) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ModulemapPackageImpl()); - - // Step 1: create meta-model objects - theModulemapPackage.createPackageContents(); - - // Step 2: complete initialization - theModulemapPackage.initializePackageContents(); - - return theModulemapPackage; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EClass getEARProjectMap() { - return earProjectMapEClass; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EReference getEARProjectMap_Mappings() { - return (EReference) earProjectMapEClass.getEReferences().get(0); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EReference getEARProjectMap_UtilityJARMappings() { - return (EReference) earProjectMapEClass.getEReferences().get(1); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EClass getModuleMapping() { - return moduleMappingEClass; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EAttribute getModuleMapping_ProjectName() { - return (EAttribute) moduleMappingEClass.getEAttributes().get(0); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EReference getModuleMapping_Module() { - return (EReference) moduleMappingEClass.getEReferences().get(0); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EClass getUtilityJARMapping() { - return utilityJARMappingEClass; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EAttribute getUtilityJARMapping_ProjectName() { - return (EAttribute) utilityJARMappingEClass.getEAttributes().get(0); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EAttribute getUtilityJARMapping_Uri() { - return (EAttribute) utilityJARMappingEClass.getEAttributes().get(1); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public ModulemapFactory getModulemapFactory() { - return (ModulemapFactory) getEFactoryInstance(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is guarded to have no affect on - * any invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void createPackageContents() { - if (isCreated) - return; - isCreated = true; - - // Create classes and their features - moduleMappingEClass = createEClass(MODULE_MAPPING); - createEAttribute(moduleMappingEClass, MODULE_MAPPING__PROJECT_NAME); - createEReference(moduleMappingEClass, MODULE_MAPPING__MODULE); - - earProjectMapEClass = createEClass(EAR_PROJECT_MAP); - createEReference(earProjectMapEClass, EAR_PROJECT_MAP__MAPPINGS); - createEReference(earProjectMapEClass, EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS); - - utilityJARMappingEClass = createEClass(UTILITY_JAR_MAPPING); - createEAttribute(utilityJARMappingEClass, UTILITY_JAR_MAPPING__PROJECT_NAME); - createEAttribute(utilityJARMappingEClass, UTILITY_JAR_MAPPING__URI); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This method is guarded to have - * no affect on any invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) - return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - // CommonPackageImpl theCommonPackage = - // (CommonPackageImpl)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI); - // JavaRefPackageImpl theJavaRefPackage = - // (JavaRefPackageImpl)EPackage.Registry.INSTANCE.getEPackage(JavaRefPackage.eNS_URI); - ApplicationPackageImpl theApplicationPackage = (ApplicationPackageImpl) EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI); - // EcorePackageImpl theEcorePackage = - // (EcorePackageImpl)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); - - // Add supertypes to classes - - // Initialize classes and features; add operations and parameters - initEClass(moduleMappingEClass, ModuleMapping.class, "ModuleMapping", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEAttribute(getModuleMapping_ProjectName(), ecorePackage.getEString(), "projectName", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, true, false); //$NON-NLS-1$ - initEReference(getModuleMapping_Module(), theApplicationPackage.getModule(), null, "module", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, true, false); //$NON-NLS-1$ - - initEClass(earProjectMapEClass, EARProjectMap.class, "EARProjectMap", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getEARProjectMap_Mappings(), this.getModuleMapping(), null, "mappings", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, true, false); //$NON-NLS-1$ - initEReference(getEARProjectMap_UtilityJARMappings(), this.getUtilityJARMapping(), null, "utilityJARMappings", null, 1, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, true, false); //$NON-NLS-1$ - - initEClass(utilityJARMappingEClass, UtilityJARMapping.class, "UtilityJARMapping", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEAttribute(getUtilityJARMapping_ProjectName(), ecorePackage.getEString(), "projectName", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, true, false); //$NON-NLS-1$ - initEAttribute(getUtilityJARMapping_Uri(), ecorePackage.getEString(), "uri", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, true, false); //$NON-NLS-1$ - - // Create resource - createResource(eNS_URI); - } -} //ModulemapPackageImpl diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapSwitch.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapSwitch.java deleted file mode 100644 index ff5df4d72..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/ModulemapSwitch.java +++ /dev/null @@ -1,107 +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.internal.earcreation.modulemap; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; - - - -/** - * @lastgen class ModulemapSwitch {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public class ModulemapSwitch { - /** - * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected static ModulemapPackage modelPackage; - - /** - * @generated This field/method will be replaced during code generation. - */ - public ModulemapSwitch() { - if (modelPackage == null) { - modelPackage = ModulemapPackage.eINSTANCE; - } - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public Object doSwitch(EObject theEObject) { - EClass theEClass = theEObject.eClass(); - if (theEClass.eContainer() == modelPackage) { - switch (theEClass.getClassifierID()) { - case ModulemapPackage.MODULE_MAPPING : { - ModuleMapping moduleMapping = (ModuleMapping) theEObject; - Object result = caseModuleMapping(moduleMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case ModulemapPackage.EAR_PROJECT_MAP : { - EARProjectMap earProjectMap = (EARProjectMap) theEObject; - Object result = caseEARProjectMap(earProjectMap); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case ModulemapPackage.UTILITY_JAR_MAPPING : { - UtilityJARMapping utilityJARMapping = (UtilityJARMapping) theEObject; - Object result = caseUtilityJARMapping(utilityJARMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - return defaultCase(theEObject); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public Object caseEARProjectMap(EARProjectMap object) { - return null; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public Object caseModuleMapping(ModuleMapping object) { - return null; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public Object caseUtilityJARMapping(UtilityJARMapping object) { - return null; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public Object defaultCase(EObject object) { - return null; - } - -} //ModulemapSwitch diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/UtilityJARMapping.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/UtilityJARMapping.java deleted file mode 100644 index e52356154..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/UtilityJARMapping.java +++ /dev/null @@ -1,53 +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.internal.earcreation.modulemap; - - -import org.eclipse.emf.ecore.EObject; - - -/** - * @lastgen interface UtilityJARMapping extends EObject {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public interface UtilityJARMapping extends EObject { - /** - * @generated This field/method will be replaced during code generation - * @return The value of the ProjectName attribute - */ - String getProjectName(); - - /** - * @generated This field/method will be replaced during code generation - * @param value - * The new value of the ProjectName attribute - */ - void setProjectName(String value); - - /** - * @generated This field/method will be replaced during code generation - * @return The value of the Uri attribute - */ - String getUri(); - - /** - * @generated This field/method will be replaced during code generation - * @param value - * The new value of the Uri attribute - */ - void setUri(String value); - -} //UtilityJARMapping diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/UtilityJARMappingImpl.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/UtilityJARMappingImpl.java deleted file mode 100644 index d935451e0..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/earcreation/modulemap/UtilityJARMappingImpl.java +++ /dev/null @@ -1,183 +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.internal.earcreation.modulemap; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; - - -/** - * @lastgen class UtilityJARMappingImpl extends EObjectImpl implements UtilityJARMapping, EObject {} - * @deprecated - * Use - * <p> - * Need to use the ModuleCore and WorkbenchComponent Api to get to the referenced modules - * as with the Flexible project changes a .modulemaps file will not exist in an EAR module and - * all the info that was captured in .modulemaps file will is now captured in the .component file - */ -public class UtilityJARMappingImpl extends EObjectImpl implements UtilityJARMapping { - /** - * The default value of the '{@link #getProjectName() <em>Project Name</em>}' attribute. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @see #getProjectName() - * @generated - * @ordered - */ - protected static final String PROJECT_NAME_EDEFAULT = null; - - /** - * @generated This field/method will be replaced during code generation. - */ - /** - * @generated This field/method will be replaced during code generation. - */ - protected String projectName = PROJECT_NAME_EDEFAULT; - /** - * The default value of the '{@link #getUri() <em>Uri</em>}' attribute. <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @see #getUri() - * @generated - * @ordered - */ - protected static final String URI_EDEFAULT = null; - - /** - * @generated This field/method will be replaced during code generation. - */ - protected String uri = URI_EDEFAULT; - - /** - * @generated This field/method will be replaced during code generation. - */ - protected UtilityJARMappingImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return ModulemapPackage.eINSTANCE.getUtilityJARMapping(); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public String getProjectName() { - return projectName; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void setProjectName(String newProjectName) { - String oldProjectName = projectName; - projectName = newProjectName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ModulemapPackage.UTILITY_JAR_MAPPING__PROJECT_NAME, oldProjectName, projectName)); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public String getUri() { - return uri; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void setUri(String newUri) { - String oldUri = uri; - uri = newUri; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ModulemapPackage.UTILITY_JAR_MAPPING__URI, oldUri, uri)); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.UTILITY_JAR_MAPPING__PROJECT_NAME : - return getProjectName(); - case ModulemapPackage.UTILITY_JAR_MAPPING__URI : - return getUri(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.UTILITY_JAR_MAPPING__PROJECT_NAME : - return PROJECT_NAME_EDEFAULT == null ? projectName != null : !PROJECT_NAME_EDEFAULT.equals(projectName); - case ModulemapPackage.UTILITY_JAR_MAPPING__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.UTILITY_JAR_MAPPING__PROJECT_NAME : - setProjectName((String) newValue); - return; - case ModulemapPackage.UTILITY_JAR_MAPPING__URI : - setUri((String) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) { - case ModulemapPackage.UTILITY_JAR_MAPPING__PROJECT_NAME : - setProjectName(PROJECT_NAME_EDEFAULT); - return; - case ModulemapPackage.UTILITY_JAR_MAPPING__URI : - setUri(URI_EDEFAULT); - return; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public String toString() { - if (eIsProxy()) - return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(EARCreationResourceHandler.getString("UtilityJARMappingImpl_UI_0", new Object[]{projectName, uri})); //$NON-NLS-1$ - return result.toString(); - } - -} //UtilityJARMappingImpl diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/modulecore/util/EarEditAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/modulecore/util/EarEditAdapterFactory.java deleted file mode 100644 index 889db8005..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/modulecore/util/EarEditAdapterFactory.java +++ /dev/null @@ -1,54 +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.internal.modulecore.util; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel; - - -/** - * <p> - * Adapts {@see org.eclipse.wst.common.modulecore.ArtifactEditModel}s to - * {@see org.eclipse.jst.j2ee.internal.modulecore.util.EARArtifactEdit} facades. - * </p> - */ -public class EarEditAdapterFactory implements IAdapterFactory { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) - */ - public Object getAdapter(Object adaptableObject, Class adapterType) { - - if (adapterType == EARArtifactEdit.ADAPTER_TYPE || adapterType == ArtifactEdit.ADAPTER_TYPE) { - ArtifactEditModel editModel = (ArtifactEditModel) adaptableObject; - if (J2EEProjectUtilities.isEARProject(editModel.getProject())) - return new EARArtifactEdit((ArtifactEditModel) adaptableObject); - } - return null; - - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() - */ - public Class[] getAdapterList() { - - return new Class[]{ArtifactEdit.class, EARArtifactEdit.class}; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtension.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtension.java deleted file mode 100644 index 71c0defc1..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtension.java +++ /dev/null @@ -1,45 +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 - *******************************************************************************/ -/* - * Created on Sep 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.moduleextension; - -import org.eclipse.jst.j2ee.internal.archive.operations.ImportOption; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public interface EarModuleExtension { - - /** - * Return a default instance of the J2EEModuleCreationDataModel. - * - * @return - */ - IDataModel createProjectDataModel(); - - IDataModel createImportDataModel(); - - IDataModelOperation createProjectCreationOperation(IDataModel dataModel); - - IDataModelOperation createProjectCreationOperation(ImportOption option); -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtensionImpl.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtensionImpl.java deleted file mode 100644 index d67120d17..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtensionImpl.java +++ /dev/null @@ -1,48 +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 - *******************************************************************************/ -/* - * Created on Sep 29, 2003 - * - * To change the template for this generated file go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.moduleextension; - -import org.eclipse.jst.j2ee.internal.archive.operations.ImportOption; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - - -public abstract class EarModuleExtensionImpl implements EarModuleExtension { - /** - * - */ - public EarModuleExtensionImpl() { - super(); - // TODO Auto-generated constructor stub - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.EarModuleExtension#createProjectCreationOperation(com.ibm.etools.archive.ear.operations.ImportOption) - */ - public IDataModelOperation createProjectCreationOperation(ImportOption option) { - if (option.getArchiveType() == ImportOption.MODULE) - return option.getModel().getDefaultOperation(); - return null; - } - - public IDataModelOperation createProjectCreationOperation(IDataModel dataModel) { - return dataModel.getDefaultOperation(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtensionRegistry.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtensionRegistry.java deleted file mode 100644 index 3a9ed1419..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleExtensionRegistry.java +++ /dev/null @@ -1,72 +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 - *******************************************************************************/ -/* - * Created on Oct 29, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.moduleextension; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - -/** - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class EarModuleExtensionRegistry extends RegistryReader { - - static final String EXTENSION_NAME = "EARModuleExtension"; //$NON-NLS-1$ - static final String ELEMENT_EARMODULE_EXTENSION = "earModuleExtension"; //$NON-NLS-1$ - static final String MODULE_EXTENSION_CLASS = "extensionClass"; //$NON-NLS-1$ - private static EarModuleExtensionRegistry INSTANCE = null; - - public EarModuleExtensionRegistry() { - super(J2EEPlugin.PLUGIN_ID, EXTENSION_NAME); - } - - public static EarModuleExtensionRegistry getInstance() { - if (INSTANCE == null) { - INSTANCE = new EarModuleExtensionRegistry(); - INSTANCE.readRegistry(); - } - return INSTANCE; - } - - /** - * readElement() - parse and deal w/ an extension like: <earModuleExtension extensionClass = - * "com.ibm.etools.web.plugin.WebModuleExtensionImpl"/> - */ - public boolean readElement(IConfigurationElement element) { - if (!element.getName().equals(ELEMENT_EARMODULE_EXTENSION)) - return false; - - EarModuleExtension extension = null; - try { - extension = (EarModuleExtension) element.createExecutableExtension(MODULE_EXTENSION_CLASS); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (extension != null) - addModuleExtension(extension); - return true; - } - - - private static void addModuleExtension(EarModuleExtension ext) { - EarModuleManager.registerModuleExtension(ext); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleManager.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleManager.java deleted file mode 100644 index 14d2cfb6f..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EarModuleManager.java +++ /dev/null @@ -1,94 +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 - *******************************************************************************/ -/* - * Created on Sep 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.moduleextension; - -import java.util.HashMap; - -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public class EarModuleManager { - static HashMap moduleExtensions = new HashMap(); - - - /** - * @return - */ - public static HashMap getModuleExtensions() { - return moduleExtensions; - } - - public static EarModuleExtension getModuleExtension(String key) { - //Make sure the registry is loaded - EarModuleExtensionRegistry.getInstance(); - return (EarModuleExtension) moduleExtensions.get(key); - } - - /** - * @return - */ - public static EjbModuleExtension getEJBModuleExtension() { - return (EjbModuleExtension) getModuleExtension(J2EEProjectUtilities.EJB); - } - - /** - * @return - */ - public static JcaModuleExtension getJCAModuleExtension() { - return (JcaModuleExtension) getModuleExtension(J2EEProjectUtilities.JCA); - } - - /** - * @return - */ - public static WebModuleExtension getWebModuleExtension() { - return (WebModuleExtension) getModuleExtension(J2EEProjectUtilities.DYNAMIC_WEB); - } - - public static boolean hasEJBModuleExtension() { - return (EjbModuleExtension) getModuleExtension(J2EEProjectUtilities.EJB) != null; - } - - public static boolean hasJCAModuleExtension() { - return (JcaModuleExtension) getModuleExtension(J2EEProjectUtilities.JCA) != null; - } - - public static boolean hasWebModuleExtension() { - return getModuleExtension(J2EEProjectUtilities.DYNAMIC_WEB) != null; - } - - public static void registerModuleExtension(EarModuleExtension ext) { - if (ext instanceof WebModuleExtension) - moduleExtensions.put(J2EEProjectUtilities.DYNAMIC_WEB, ext); - else if (ext instanceof EjbModuleExtension) - moduleExtensions.put(J2EEProjectUtilities.EJB, ext); - else if (ext instanceof JcaModuleExtension) - moduleExtensions.put(J2EEProjectUtilities.JCA, ext); - else - moduleExtensions.put(J2EEProjectUtilities.ENTERPRISE_APPLICATION, ext); - } - - public static void removeModuleExtension(String key) { - moduleExtensions.remove(key); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EjbModuleExtension.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EjbModuleExtension.java deleted file mode 100644 index fba78ee72..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/EjbModuleExtension.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Sep 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.moduleextension; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public interface EjbModuleExtension extends EarModuleExtension { - - //void initializeEjbReferencesToModule(J2EENature nature, UpdateModuleReferencesInEARProjectCommand cmd); - - //J2EEJavaProjectInfo createProjectInfo(); - - //J2EEImportOperationOLD createImportOperation(IProject proj, EJBJarFile ejbJarFile); - - EJBJar getEJBJar(IProject aProject); - - IProject getDefinedEJBClientJARProject(IProject anEJBProject); - - IDataModelOperation createEJBClientJARProject( - final String clientProjectName, - final String srcFolderName, - final String ejbProjectName, - final String earProjectName, - final org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime); - - IDataModelOperation createEJBClientJARProject(IProject ejbProject); - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/JcaModuleExtension.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/JcaModuleExtension.java deleted file mode 100644 index 92ca9ca7f..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/JcaModuleExtension.java +++ /dev/null @@ -1,36 +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 - *******************************************************************************/ -/* - * Created on Sep 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.moduleextension; - -//import org.eclipse.jst.j2ee.internal.earcreation.UpdateModuleReferencesInEARProjectCommand; -//import org.eclipse.jst.j2ee.internal.project.J2EENature; - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public interface JcaModuleExtension extends EarModuleExtension { - - //void initializeEjbReferencesToModule(J2EENature nature, UpdateModuleReferencesInEARProjectCommand cmd); - - //J2EEJavaProjectInfo createProjectInfo(); - - //J2EEImportOperation createImportOperation(IProject proj, RARFile rarFile); -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/WebModuleExtension.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/WebModuleExtension.java deleted file mode 100644 index cf9a5d031..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/moduleextension/WebModuleExtension.java +++ /dev/null @@ -1,58 +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 - *******************************************************************************/ -/* - * Created on Sep 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.moduleextension; - -import java.util.Set; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.internal.project.J2EEJavaProjectInfo; -//import org.eclipse.jst.j2ee.internal.project.J2EENature; - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public interface WebModuleExtension extends EarModuleExtension { - - static final String WEBSETTINGS_FILE_URI = ".j2ee"; //$NON-NLS-1$ - -// void initializeEjbReferencesToModule(J2EENature nature, UpdateModuleReferencesInEARProjectCommand command); - - void addWLPProjects(IProject aProject, Set projectsToBuild); - - - void setContextRootForModuleMapping(WebModule m, IProject nestedProject) throws CoreException; - - //J2EEImportOperationOLD createImportOperation(IProject nestedProject, WARFile warFile, - // EARImportConfiguration importConfig); - - String getContentFolder(IProject project, IFile webSettingsFile); - - J2EEJavaProjectInfo createProjectInfo(); - - boolean compareWebContextRoot(Module module, IProject project) throws CoreException; - - boolean hasRuntime(IProject project); - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/project/facet/EARFacetProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/project/facet/EARFacetProjectCreationDataModelProvider.java deleted file mode 100644 index 919012b07..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/project/facet/EARFacetProjectCreationDataModelProvider.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.project.facet; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants; -import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; - -public class EARFacetProjectCreationDataModelProvider extends FacetProjectCreationDataModelProvider { - - public EARFacetProjectCreationDataModelProvider() { - super(); - } - - public void init() { - super.init(); - - Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>(); - requiredFacets.add(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET); - setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/project/facet/UtilityFacetInstallDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/project/facet/UtilityFacetInstallDataModelProvider.java deleted file mode 100644 index 85c5d2b39..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/internal/project/facet/UtilityFacetInstallDataModelProvider.java +++ /dev/null @@ -1,37 +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.j2ee.internal.project.facet; - -import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants; -import org.eclipse.jst.j2ee.project.facet.IUtilityFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.J2EEModuleFacetInstallDataModelProvider; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -public class UtilityFacetInstallDataModelProvider extends J2EEModuleFacetInstallDataModelProvider implements IUtilityFacetInstallDataModelProperties { - public UtilityFacetInstallDataModelProvider() - { - super(); - } - - public Object getDefaultProperty(String propertyName) { - if (FACET_ID.equals(propertyName)) { - return UTILITY; - } else if (propertyName.equals(MODULE_URI)) { - String projectName = model.getStringProperty(FACET_PROJECT_NAME).replace(' ', '_'); - return projectName + IJ2EEModuleConstants.JAR_EXT; - } - return super.getDefaultProperty(propertyName); - } - - protected int convertFacetVersionToJ2EEVersion(IProjectFacetVersion version) { - return 0; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EARFacetProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EARFacetProjectCreationDataModelProvider.java deleted file mode 100644 index ccca86779..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EARFacetProjectCreationDataModelProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.project.facet; - -/** - * This class was not intended to be public API. Please use {@link org.eclipse.jst.j2ee.earcreation.IEarFacetInstallDataModelProperties} - * - * @deprecated - * @see org.eclipse.jst.j2ee.internal.project.facet.EARFacetProjectCreationDataModelProvider - */ -public class EARFacetProjectCreationDataModelProvider extends org.eclipse.jst.j2ee.internal.project.facet.EARFacetProjectCreationDataModelProvider { - - public EARFacetProjectCreationDataModelProvider() { - super(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EARFacetUtils.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EARFacetUtils.java deleted file mode 100644 index 924a50bed..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EARFacetUtils.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -public class EARFacetUtils { - - public static final IProjectFacet EAR_FACET = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EAR_MODULE); - public static final IProjectFacetVersion EAR_12 = EAR_FACET.getVersion("1.2"); //$NON-NLS-1$ - public static final IProjectFacetVersion EAR_13 = EAR_FACET.getVersion("1.3"); //$NON-NLS-1$ - public static final IProjectFacetVersion EAR_14 = EAR_FACET.getVersion("1.4"); //$NON-NLS-1$ - - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetInstallDelegate.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetInstallDelegate.java deleted file mode 100644 index 46c617a03..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetInstallDelegate.java +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - initial API and implementation - ******************************************************************************/ - -package org.eclipse.jst.j2ee.project.facet; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.project.facet.WtpUtils; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.earcreation.IEarFacetInstallDataModelProperties; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.FacetDataModelProvider; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -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; - -public final class EarFacetInstallDelegate implements IDelegate { - - public void execute(final IProject project, final IProjectFacetVersion fv, final Object cfg, final IProgressMonitor monitor) throws CoreException { - if (monitor != null) { - monitor.beginTask("", 1); //$NON-NLS-1$ - } - - try { - IDataModel model = (IDataModel) cfg; - - if (monitor != null) { - monitor.worked(1); - } - // Add WTP natures. - - WtpUtils.addNaturestoEAR(project); - - final IVirtualComponent c = ComponentCore.createComponent(project); - c.create(0, null); - - final IVirtualFolder earroot = c.getRootFolder(); - earroot.createLink(new Path("/" + model.getStringProperty(IEarFacetInstallDataModelProperties.CONTENT_DIR)), 0, null); //$NON-NLS-1$ - - if (!project.getFile(J2EEConstants.APPLICATION_DD_URI).exists()) { - String ver = fv.getVersionString(); - int nVer = J2EEVersionUtil.convertVersionStringToInt(ver); - EARArtifactEdit.createDeploymentDescriptor(project, nVer); - } - - try { - ((IDataModelOperation) model.getProperty(FacetDataModelProvider.NOTIFICATION_OPERATION)).execute(monitor, null); - } catch (ExecutionException e) { - Logger.getLogger().logError(e); - } - } - - finally { - if (monitor != null) { - monitor.done(); - } - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetPostInstallDelegate.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetPostInstallDelegate.java deleted file mode 100644 index fee5cac65..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetPostInstallDelegate.java +++ /dev/null @@ -1,90 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - initial API and implementation - ******************************************************************************/ - -package org.eclipse.jst.j2ee.project.facet; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.commands.ExecutionException; -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.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider; -import org.eclipse.jst.j2ee.internal.earcreation.IEarFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -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; - -public final class EarFacetPostInstallDelegate implements IDelegate { - - public void execute(final IProject project, final IProjectFacetVersion fv, final Object cfg, final IProgressMonitor monitor) throws CoreException { - if (monitor != null) { - monitor.beginTask("", 1); //$NON-NLS-1$ - } - - try { - IDataModel model = (IDataModel) cfg; - - if (monitor != null) { - monitor.worked(1); - } - - final IVirtualComponent c = ComponentCore.createComponent(project); - - Set dependentProjects = new HashSet(); - dependentProjects.addAll((List) model.getProperty(IEarFacetInstallDataModelProperties.J2EE_PROJECTS_LIST)); - dependentProjects.addAll((List) model.getProperty(IEarFacetInstallDataModelProperties.JAVA_PROJECT_LIST)); - if (!dependentProjects.isEmpty()) { - List dependentComponents = new ArrayList(dependentProjects.size()); - for (Iterator iterator = dependentProjects.iterator(); iterator.hasNext();) { - IProject depProject = (IProject) iterator.next(); - IVirtualComponent depComp = ComponentCore.createComponent(depProject); - if (depComp == null) { - JavaProjectMigrationOperation utilOp = J2EEProjectUtilities.createFlexJavaProjectForProjectOperation(depProject); - utilOp.execute(null, null); - depComp = ComponentCore.createComponent(depProject); - } - - dependentComponents.add(depComp); - } - - final IDataModel dataModel = DataModelFactory.createDataModel(new AddComponentToEnterpriseApplicationDataModelProvider()); - dataModel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, c); - List modList = (List) dataModel.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - modList.addAll(dependentComponents); - dataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modList); - try { - dataModel.getDefaultOperation().execute(null, null); - } catch (ExecutionException e) { - Logger.getLogger().logError(e); - } - } - - } - - finally { - if (monitor != null) { - monitor.done(); - } - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetRuntimeHandler.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetRuntimeHandler.java deleted file mode 100644 index 4dd10c7b8..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetRuntimeHandler.java +++ /dev/null @@ -1,214 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2006 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - initial API and implementation - ******************************************************************************/ - -package org.eclipse.jst.j2ee.project.facet; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.project.facet.core.IDelegate; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public final class EarFacetRuntimeHandler -{ - /** - * Private constructor. This class is not meant to be instantiated. - */ - - private EarFacetRuntimeHandler() {} - - public static void updateModuleProjectRuntime( final IProject earProject, - final IProject moduleProject, - final IProgressMonitor monitor ) - - throws CoreException - - { - if( monitor != null ) - { - monitor.beginTask( "", 1 ); - } - - try - { - final IFacetedProject earFacetedProject - = ProjectFacetsManager.create( earProject ); - - final IRuntime earRuntime = earFacetedProject.getRuntime(); - - final IFacetedProject moduleFacetedProject - = ProjectFacetsManager.create( moduleProject ); - - if( moduleFacetedProject != null && - ! equals( earRuntime, moduleFacetedProject.getRuntime() ) ) - { - boolean supports = true; - - if( earRuntime != null ) - { - for( Iterator itr = moduleFacetedProject.getProjectFacets().iterator(); - itr.hasNext(); ) - { - final IProjectFacetVersion fver - = (IProjectFacetVersion) itr.next(); - - if( ! earRuntime.supports( fver ) ) - { - supports = false; - break; - } - } - } - - if( supports ) - { - moduleFacetedProject.setRuntime( earRuntime, submon( monitor, 1 ) ); - } - } - } - finally - { - if( monitor != null ) - { - monitor.done(); - } - } - } - - public static void updateModuleProjectRuntime( final IProject earProject, - final Set moduleProjects, - final IProgressMonitor monitor ) - - throws CoreException - - { - if( monitor != null ) - { - monitor.beginTask( "", moduleProjects.size() ); - } - - try - { - for( Iterator itr = moduleProjects.iterator(); itr.hasNext(); ) - { - final IProject moduleProject = (IProject) itr.next(); - - updateModuleProjectRuntime( earProject, moduleProject, - submon( monitor, 1 ) ); - } - } - finally - { - if( monitor != null ) - { - monitor.done(); - } - } - } - - public static final class RuntimeChangedDelegate - - implements IDelegate - - { - public void execute( final IProject project, - final IProjectFacetVersion fv, - final Object cfg, - final IProgressMonitor monitor ) - - throws CoreException - - { - if( monitor != null ) - { - monitor.beginTask( "", 10 ); //$NON-NLS-1$ - } - - try - { - // Compile the list of projects referenced by this ear project. - - final Set moduleProjects = new HashSet(); - - final IVirtualComponent earvc - = ComponentCore.createComponent( project ); - - final IVirtualReference[] vrefs = earvc.getReferences(); - - for( int i = 0; i < vrefs.length; i++ ) - { - final IVirtualReference vref = vrefs[ i ]; - final IVirtualComponent vc = vref.getReferencedComponent(); - - moduleProjects.add( vc.getProject() ); - } - - if( monitor != null ) - { - monitor.worked( 1 ); - } - - // Attempt to change the runtime for each of the referenced projects. - - updateModuleProjectRuntime( project, moduleProjects, - submon( monitor, 9 ) ); - } - finally - { - if( monitor != null ) - { - monitor.done(); - } - } - } - } - - private static IProgressMonitor submon( final IProgressMonitor parent, - final int ticks ) - { - return ( parent == null ? null : new SubProgressMonitor( parent, ticks ) ); - } - - private static boolean equals( final Object obj1, - final Object obj2 ) - { - if( obj1 == obj2 ) - { - return true; - } - else if( obj1 == null || obj2 == null ) - { - return false; - } - else - { - return obj1.equals( obj2 ); - } - } - - - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetValidator.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetValidator.java deleted file mode 100644 index 024ec3e3d..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetValidator.java +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - initial API and implementation - ******************************************************************************/ - -package org.eclipse.jst.j2ee.project.facet; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IFacetedProjectValidator; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public final class EarFacetValidator - - implements IFacetedProjectValidator - -{ - private static final String MARKER_ID - = J2EEPlugin.PLUGIN_ID + ".differentRuntimesDetected"; - - public void validate( final IFacetedProject fproj ) - - throws CoreException - - { - final IVirtualComponent vc - = ComponentCore.createComponent( fproj.getProject() ); - - if( vc == null ) - { - return; - } - - if( fproj.hasProjectFacet( EARFacetUtils.EAR_FACET ) ) - { - fproj.getProject().deleteMarkers( MARKER_ID, false, - IResource.DEPTH_ZERO ); - - final IVirtualReference[] refs = vc.getReferences(); - - for( int i = 0; i < refs.length; i++ ) - { - final IVirtualReference ref = refs[ i ]; - final IVirtualComponent refvc = ref.getReferencedComponent(); - - if( refvc != null && !refvc.isBinary()) - { - final IProject refpj = refvc.getProject(); - validate( fproj, ProjectFacetsManager.create( refpj ) ); - } - } - } - else - { - final IVirtualComponent[] referencing - = vc.getReferencingComponents(); - - for( int i = 0; i < referencing.length; i++ ) - { - final IVirtualComponent refvc = referencing[ i ]; - - final IFacetedProject reffpj - = ProjectFacetsManager.create( refvc.getProject() ); - - if( reffpj.hasProjectFacet( EARFacetUtils.EAR_FACET ) ) - { - validate( reffpj ); - } - } - } - } - - private void validate( final IFacetedProject ear, - final IFacetedProject module ) - - throws CoreException - - { - final IRuntime earRuntime = ear.getRuntime(); - final IRuntime moduleRuntime = module.getRuntime(); - - if( earRuntime == null && moduleRuntime != null ) - { - // Should this also be a warning? - } - else if( earRuntime != null && moduleRuntime == null ) - { - // Should this also be a warning? - } - else if( earRuntime != null && moduleRuntime != null && - ! earRuntime.equals( moduleRuntime ) ) - { - final String msg - = NLS.bind( Resources.targetingDifferentRuntimes, - module.getProject().getName() ); - - final IMarker m = ear.createWarningMarker( MARKER_ID, msg ); - - m.setAttribute( "moduleProject", module.getProject().getName() ); - m.setAttribute( "runtime1", ear.getRuntime().getName() ); - m.setAttribute( "runtime2", module.getRuntime().getName() ); - } - } - - private static final class Resources - - extends NLS - - { - public static String targetingDifferentRuntimes; - - static - { - initializeMessages( EarFacetValidator.class.getName(), - Resources.class ); - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetValidator.properties b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetValidator.properties deleted file mode 100644 index edb3d0d3d..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetValidator.properties +++ /dev/null @@ -1,11 +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 -############################################################################### -targetingDifferentRuntimes = Referenced module project {0} is targeting a different runtime. diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetVersionChangeDelegate.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetVersionChangeDelegate.java deleted file mode 100644 index e121e6b05..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/EarFacetVersionChangeDelegate.java +++ /dev/null @@ -1,92 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - 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; -/** - * Warning clean-up 12/05/2005 - */ -//import org.eclipse.wst.common.componentcore.ComponentCore; -//import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.project.facet.core.IDelegate; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public final class EarFacetVersionChangeDelegate - - implements IDelegate - -{ - public void execute( final IProject project, - final IProjectFacetVersion fv, - final Object cfg, - final IProgressMonitor monitor ) - - throws CoreException - - { - if( monitor != null ) - { - monitor.beginTask( "", 1 ); - } - - try - { - /** - * Warning clean-up 12/05/2005 - */ - //final IVirtualComponent c = ComponentCore.createComponent(project); - -// final StructureEdit edit -// = StructureEdit.getStructureEditForWrite( project ); -// -// try -// { -// final ComponentType oldctype -// = StructureEdit.getComponentType( c ); -// -// final ComponentType newctype -// = ComponentcoreFactory.eINSTANCE.createComponentType(); -// -// newctype.setComponentTypeId( oldctype.getComponentTypeId() ); -// newctype.setVersion( fv.getVersionString() ); -// newctype.getProperties().addAll( oldctype.getProperties() ); -// -// StructureEdit.setComponentType( c, newctype ); -// -// edit.saveIfNecessary( null ); -// } -// finally -// { -// edit.dispose(); -// } - - if( monitor != null ) - { - monitor.worked( 1 ); - } - } - finally - { - if( monitor != null ) - { - monitor.done(); - } - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IJavaProjectMigrationDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IJavaProjectMigrationDataModelProperties.java deleted file mode 100644 index 34bd30d3c..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IJavaProjectMigrationDataModelProperties.java +++ /dev/null @@ -1,26 +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.project.facet; - - -public interface IJavaProjectMigrationDataModelProperties { - - /** - * Required - */ - public static final String PROJECT_NAME = "IJavaProjectMigrationDataModelProperties.PROJECT_NAME"; //$NON-NLS-1$ - - /** - * Optional - */ - public static final String ADD_TO_EAR = "IJavaProjectMigrationDataModelProperties.ADD_TO_EAR"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IJavaUtilityProjectCreationDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IJavaUtilityProjectCreationDataModelProperties.java deleted file mode 100644 index 73344f2ee..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IJavaUtilityProjectCreationDataModelProperties.java +++ /dev/null @@ -1,30 +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.j2ee.project.facet; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties; - -public interface IJavaUtilityProjectCreationDataModelProperties extends IDataModelProperties { - /** - * This field should not be used. It is not part of the API and may be modified in the future. - */ - public static Class _provider_class = JavaUtilityProjectCreationDataModelProvider.class; - - public static final String PROJECT_NAME = "IJavaUtilityProjectCreationDataModelProperties.PROJECT_NAME"; //$NON-NLS-1$ - -// public static final String PROJECT_LOCATION = "IJavaUtilityProjectCreationDataModelProperties.PROJECT_LOCATION"; //$NON-NLS-1$ - - public static final String EAR_PROJECT_NAME = "IJavaUtilityProjectCreationDataModelProperties.EAR_PROJECT_NAME"; //$NON-NLS-1$ - - public static final String RUNTIME = "IJavaUtilityProjectCreationDataModelProperties.RUNTIME"; //$NON-NLS-1$ - - public static final String SOURCE_FOLDER = "IJavaUtilityProjectCreationDataModelProperties.SOURCE_FOLDER"; //$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IUtilityFacetInstallDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IUtilityFacetInstallDataModelProperties.java deleted file mode 100644 index 2f1520755..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/IUtilityFacetInstallDataModelProperties.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.project.facet; - -public interface IUtilityFacetInstallDataModelProperties extends IJ2EEModuleFacetInstallDataModelProperties { - - /** - * This field should not be used. It is not part of the API and may be modified in the future. - */ - public static Class _provider_class = org.eclipse.jst.j2ee.internal.project.facet.UtilityFacetInstallDataModelProvider.class; -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaProjectMigrationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaProjectMigrationDataModelProvider.java deleted file mode 100644 index a60d0cc99..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaProjectMigrationDataModelProvider.java +++ /dev/null @@ -1,64 +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.project.facet; - -import java.util.Set; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -/** - * This dataModel is a common super class used for creation of WTP Components. - * - * This class (and all its fields and methods) is likely to change during the WTP 1.0 milestones as - * the new project structures are adopted. Use at your own risk. - * - * @plannedfor WTP 1.0 - */ -public class JavaProjectMigrationDataModelProvider extends AbstractDataModelProvider implements IJavaProjectMigrationDataModelProperties { - - public void init() { - super.init(); - } - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PROJECT_NAME); - propertyNames.add(ADD_TO_EAR); - return propertyNames; - } - - public void propertyChanged(DataModelEvent event) { - if (event.getFlag() == DataModelEvent.VALUE_CHG) { - event.getDataModel(); - } - } - - public boolean propertySet(String propertyName, Object propertyValue) { - return true; - } - - public Object getDefaultProperty(String propertyName) { - return super.getDefaultProperty(propertyName); - } - - public IStatus validate(String propertyName) { - - return OK_STATUS; - } - - public IDataModelOperation getDefaultOperation() { - return new JavaProjectMigrationOperation(model); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaProjectMigrationOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaProjectMigrationOperation.java deleted file mode 100644 index e6fcb8d08..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaProjectMigrationOperation.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.project.facet; - -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.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.JavaFacetInstallDataModelProvider; -import org.eclipse.jst.common.project.facet.JavaFacetUtils; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider; -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.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - - -public class JavaProjectMigrationOperation extends AbstractDataModelOperation implements IJavaProjectMigrationDataModelProperties { - - - - public JavaProjectMigrationOperation(IDataModel model) { - super(model); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) { - - - - IDataModel jdm = DataModelFactory.createDataModel(new JavaFacetInstallDataModelProvider()); - - jdm.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, model.getStringProperty(PROJECT_NAME)); - - jdm.setProperty(IFacetDataModelProperties.FACET_VERSION, getJavaFacetVersion() ); - - IDataModel udm = DataModelFactory.createDataModel(new UtilityFacetInstallDataModelProvider()); - try { - if(model.isPropertySet(ADD_TO_EAR)){ - udm.setProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, model.getProperty(ADD_TO_EAR)); - } - udm.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, model.getStringProperty(PROJECT_NAME)); - udm.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, "1.0"); //$NON-NLS-1$ - udm.setProperty(IJ2EEModuleFacetInstallDataModelProperties.MODULE_URI, - model.getStringProperty(PROJECT_NAME) + ".jar"); //$NON-NLS-1$ - // we do not want to add to ear by default - udm.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, false); - } catch (Exception e) { - Logger.getLogger().logError(e); - } - - IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider()); - dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, model.getStringProperty(PROJECT_NAME)); - - FacetDataModelMap map = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); - map.add(jdm); - map.add(udm); - - try { - dm.getDefaultOperation().execute(monitor, null); - } catch (ExecutionException e) { - Logger.getLogger().logError(e); - } - return OK_STATUS; - } - - private IProjectFacetVersion getJavaFacetVersion(){ - - IProject project = J2EEProjectUtilities.getProject( model.getStringProperty(PROJECT_NAME) ); - IJavaProject jProj = JemProjectUtilities.getJavaProject( project ); - String jdtVersion = jProj.getOption(JavaCore.COMPILER_COMPLIANCE, true ); - - if (jdtVersion.startsWith("1.3")) { //$NON-NLS-1$ - return JavaFacetUtils.JAVA_13; - } else if (jdtVersion.startsWith("1.4")) { //$NON-NLS-1$ - return JavaFacetUtils.JAVA_14; - }else if (jdtVersion.startsWith("1.5")) { //$NON-NLS-1$ - return JavaFacetUtils.JAVA_50; - } - return JavaFacetUtils.JAVA_60; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaUtilityProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaUtilityProjectCreationDataModelProvider.java deleted file mode 100644 index ba73143ba..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaUtilityProjectCreationDataModelProvider.java +++ /dev/null @@ -1,43 +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.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - - - -public class JavaUtilityProjectCreationDataModelProvider - extends AbstractDataModelProvider implements IJavaUtilityProjectCreationDataModelProperties{ - - public JavaUtilityProjectCreationDataModelProvider() { - super(); - } - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PROJECT_NAME); - //propertyNames.add(PROJECT_LOCATION); - propertyNames.add(EAR_PROJECT_NAME); - propertyNames.add(RUNTIME); - propertyNames.add(SOURCE_FOLDER); - return propertyNames; - } - - - public IDataModelOperation getDefaultOperation() { - return new JavaUtilityProjectCreationOperation(model); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaUtilityProjectCreationOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaUtilityProjectCreationOperation.java deleted file mode 100644 index a7baf7597..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/JavaUtilityProjectCreationOperation.java +++ /dev/null @@ -1,83 +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.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties.FacetDataModelMap; -import org.eclipse.wst.common.componentcore.internal.operation.FacetProjectCreationOperation; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -public class JavaUtilityProjectCreationOperation extends AbstractDataModelOperation implements IJavaUtilityProjectCreationDataModelProperties{ - - - - public JavaUtilityProjectCreationOperation(IDataModel model) { - super(model); - } - - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - - IStatus stat = OK_STATUS; - - String projectName = model.getStringProperty( IJavaUtilityProjectCreationDataModelProperties.PROJECT_NAME ); - String earProjectName = model.getStringProperty( IJavaUtilityProjectCreationDataModelProperties.EAR_PROJECT_NAME );; - String javaSourceFolder = model.getStringProperty( IJavaUtilityProjectCreationDataModelProperties.SOURCE_FOLDER ); - - org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime = (IRuntime) model.getProperty(IJavaUtilityProjectCreationDataModelProperties.RUNTIME); - - IDataModel dm = DataModelFactory.createDataModel(new UtilityProjectCreationDataModelProvider()); - - - //IDataModel pdm = dm.getNestedModel( IFacetProjectCreationDataModelProperties.NESTED_PROJECT_DM ); - //pdm.setStringProperty( IProjectCreationPropertiesNew.PROJECT_LOCATION, model.getStringProperty( IJavaUtilityProjectCreationDataModelProperties.PROJECT_LOCATION ) ); - - FacetDataModelMap map = (FacetDataModelMap) dm.getProperty(UtilityProjectCreationDataModelProvider.FACET_DM_MAP); - - IDataModel javadm = map.getFacetDataModel( IModuleConstants.JST_JAVA ); - IDataModel utildm = map.getFacetDataModel( J2EEProjectUtilities.UTILITY ); - - - javadm.setProperty( JavaFacetInstallDataModelProvider.FACET_PROJECT_NAME, - projectName); - - - javadm.setProperty( JavaFacetInstallDataModelProvider.SOURCE_FOLDER_NAME, - javaSourceFolder); - - - utildm.setProperty( IUtilityFacetInstallDataModelProperties.EAR_PROJECT_NAME, earProjectName); - - utildm.setProperty( IUtilityFacetInstallDataModelProperties.FACET_RUNTIME, runtime ); - dm.setProperty(UtilityProjectCreationDataModelProvider.FACET_RUNTIME, runtime); - - FacetProjectCreationOperation op = new FacetProjectCreationOperation(dm); - try { - stat = op.execute( monitor, null ); - } catch (ExecutionException e) { - Logger.getLogger().logError(e); - } - return stat; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetInstallDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetInstallDataModelProvider.java deleted file mode 100644 index 05b5c5c84..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetInstallDataModelProvider.java +++ /dev/null @@ -1,25 +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.j2ee.project.facet; - -/** - * This class was not intended to be public API. Please use {@link org.eclipse.jst.j2ee.project.facet.IUtilityFacetInstallDataModelProperties} - * - * @deprecated - * @see org.eclipse.jst.j2ee.internal.project.facet.UtilityFacetInstallDataModelProvider - */ - -public class UtilityFacetInstallDataModelProvider extends org.eclipse.jst.j2ee.internal.project.facet.UtilityFacetInstallDataModelProvider { - public UtilityFacetInstallDataModelProvider() - { - super(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetInstallDelegate.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetInstallDelegate.java deleted file mode 100644 index 02859fb64..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetInstallDelegate.java +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - 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.IProject; -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.jst.common.project.facet.WtpUtils; -import org.eclipse.jst.common.project.facet.core.ClasspathHelper; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainerUtils; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.FacetDataModelProvider; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -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; - -public final class UtilityFacetInstallDelegate extends J2EEFacetInstallDelegate implements IDelegate { - - public void execute(final IProject project, final IProjectFacetVersion fv, final Object cfg, final IProgressMonitor monitor) throws CoreException { - if (monitor != null) { - monitor.beginTask("", 1); //$NON-NLS-1$ - } - - try { - - final IDataModel model = (IDataModel) cfg; - - // Add WTP natures. - - WtpUtils.addNatures(project); - - // Setup the flexible project structure. - - final IVirtualComponent c = ComponentCore.createComponent(project); - - c.create(0, null); - - final IVirtualFolder jsrc = c.getRootFolder(); - final IJavaProject jproj = JavaCore.create(project); - - final IClasspathEntry[] cp = jproj.getRawClasspath(); - - for (int i = 0; i < cp.length; i++) { - final IClasspathEntry cpe = cp[i]; - - if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) { - IPath path = cpe.getPath().removeFirstSegments(1); - if (path.isEmpty()) { - path = new Path("/"); //$NON-NLS-1$ - } - jsrc.createLink(path, 0, null); - } - } - -// final IWorkspace ws = ResourcesPlugin.getWorkspace(); - - final IVirtualFolder root = c.getRootFolder(); - - IContainer container = null; - - if (root.getProjectRelativePath().segmentCount() == 0) { - container = project; - } else { - container = project.getFolder(root.getProjectRelativePath()); - } - - try { - if (container != null) - createManifest(project, container, monitor); - } catch (InvocationTargetException e) { - Logger.getLogger().logError(e); - } catch (InterruptedException e) { - Logger.getLogger().logError(e); - } - - - ClasspathHelper.removeClasspathEntries(project, fv); - - if (!ClasspathHelper.addClasspathEntries(project, fv)) { - // TODO: Support the no runtime case. - // ClasspathHelper.addClasspathEntries( project, fv, <something> ); - } - - if(J2EEComponentClasspathContainerUtils.getDefaultUseEARLibraries()){ - final IPath earLibContainer = new Path(J2EEComponentClasspathContainer.CONTAINER_ID); - addToClasspath(jproj, JavaCore.newContainerEntry(earLibContainer)); - } - - 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(); - } - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetPostInstallDelegate.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetPostInstallDelegate.java deleted file mode 100644 index aec49dde7..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetPostInstallDelegate.java +++ /dev/null @@ -1,79 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - 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.jst.j2ee.internal.J2EEVersionConstants; -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 final class UtilityFacetPostInstallDelegate extends J2EEFacetInstallDelegate implements IDelegate { - - public void execute(final IProject project, final IProjectFacetVersion fv, final Object cfg, final IProgressMonitor monitor) throws CoreException { - if (monitor != null) { - monitor.beginTask("", 1); //$NON-NLS-1$ - } - - try { - - final IDataModel model = (IDataModel) cfg; - - - // Associate with an EAR, if necessary. - if (model.getBooleanProperty(IUtilityFacetInstallDataModelProperties.ADD_TO_EAR)) { - final String earProjectName = model.getStringProperty(IUtilityFacetInstallDataModelProperties.EAR_PROJECT_NAME); - if (earProjectName != null && earProjectName != "") { //$NON-NLS-1$ -// IProject earProject = ProjectUtilities.getProject(earProjectName); -// if (earProject.exists()) { -// IVirtualComponent earComp = ComponentCore.createComponent(earProject); -// -// IDataModel dataModel = DataModelFactory.createDataModel(new AddComponentToEnterpriseApplicationDataModelProvider()); -// dataModel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComp); -// List modList = (List) dataModel.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); -// modList.add(c); -// dataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modList); -// try { -// dataModel.getDefaultOperation().execute(null, null); -// } catch (ExecutionException e) { -// Logger.getLogger().logError(e); -// } -// } - - - final String moduleURI = model.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.MODULE_URI); - - //final String moduleURI = project.getName() + ".jar"; - - installAndAddModuletoEAR( J2EEVersionConstants.VERSION_1_4_TEXT, - earProjectName, - (IRuntime) model.getProperty(IJ2EEFacetInstallDataModelProperties.FACET_RUNTIME), - project, - moduleURI, - monitor ); - } - } - - - } catch (Exception e) { - Logger.getLogger().logError(e); - } finally { - if (monitor != null) { - monitor.done(); - } - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetUnInstallDelegate.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetUnInstallDelegate.java deleted file mode 100644 index a5f3eadca..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityFacetUnInstallDelegate.java +++ /dev/null @@ -1,72 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - initial API and implementation - ******************************************************************************/ - -package org.eclipse.jst.j2ee.project.facet; - -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.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.common.project.facet.WtpUtils; -import org.eclipse.jst.common.project.facet.core.ClasspathHelper; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.project.facet.core.IDelegate; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -public final class UtilityFacetUnInstallDelegate extends J2EEFacetInstallDelegate implements IDelegate { - - public void execute(final IProject project, final IProjectFacetVersion fv, final Object cfg, final IProgressMonitor monitor) throws CoreException { - if (monitor != null) { - monitor.beginTask("", 1); //$NON-NLS-1$ - } - - try{ - //remove .component file - IFile file = project.getFile( StructureEdit.MODULE_META_FILE_NAME ); - file.delete( true, monitor ); - - //remove manifest file - final IVirtualComponent c = ComponentCore.createComponent(project); - final IVirtualFolder root = c.getRootFolder(); - IContainer container = null; - - if (root.getProjectRelativePath().segmentCount() == 0) { - container = project; - } else { - container = project.getFolder(root.getProjectRelativePath()); - } - - IFile manifestFile = container.getFile(new Path(J2EEConstants.MANIFEST_URI)); - manifestFile.delete( true, monitor ); - - IFolder manifestFolder = container.getFolder( new Path(J2EEConstants.META_INF) ); - manifestFolder.delete( true, monitor ); - - //remove module core nature - WtpUtils.removeNatures( project ); - - //remove server class path container - ClasspathHelper.removeClasspathEntries( project, fv ); - - }finally { - if (monitor != null) { - monitor.done(); - } - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityProjectCreationDataModelProvider.java deleted file mode 100644 index 55ba7e92c..000000000 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/project/facet/UtilityProjectCreationDataModelProvider.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.project.facet; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties; -import org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider; -import org.eclipse.jst.common.project.facet.JavaFacetUtils; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties; -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; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.project.facet.ProductManager; - -public class UtilityProjectCreationDataModelProvider extends J2EEFacetProjectCreationDataModelProvider { - - public UtilityProjectCreationDataModelProvider() { - super(); - } - - public void init() { - super.init(); - - Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>(); - requiredFacets.add(JavaFacetUtils.JAVA_FACET); - requiredFacets.add(IJ2EEFacetConstants.UTILITY_FACET); - setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets); - - FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP); - IDataModel javaFacet = map.getFacetDataModel(JavaFacetUtils.JAVA_FACET.getId()); - // If applicable, keep project structure optimized by making output directory the same as the content root - if (ProductManager.shouldUseSingleRootStructure()) - javaFacet.setProperty(IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME, javaFacet.getStringProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME)); - IDataModel utilFacet = map.getFacetDataModel(IJ2EEFacetConstants.UTILITY_FACET.getId()); - utilFacet.addListener(new IDataModelListener() { - public void propertyChanged(DataModelEvent event) { - if (IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME.equals(event.getPropertyName())) { - if (isPropertySet(EAR_PROJECT_NAME)) - setProperty(EAR_PROJECT_NAME, event.getProperty()); - else - model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG); - }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 utilFacet = map.getFacetDataModel( J2EEProjectUtilities.UTILITY ); - utilFacet.setProperty( IJ2EEModuleFacetInstallDataModelProperties.MODULE_URI, propertyValue ); - } - return super.propertySet(propertyName, propertyValue); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/icons/11_cmpbean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/11_cmpbean_obj.gif Binary files differdeleted file mode 100644 index 5db4e72ed..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/11_cmpbean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/11_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/11_ejb_obj.gif Binary files differdeleted file mode 100644 index 445aa374e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/11_ejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/11_ejbjar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/11_ejbjar_obj.gif Binary files differdeleted file mode 100644 index f34adc945..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/11_ejbjar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/12_ear_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/12_ear_obj.gif Binary files differdeleted file mode 100644 index f66e7a922..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/12_ear_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/13_ear_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/13_ear_obj.gif Binary files differdeleted file mode 100644 index 07cd6ab2e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/13_ear_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/20_cmpbean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/20_cmpbean_obj.gif Binary files differdeleted file mode 100644 index 023fe8d4d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/20_cmpbean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/20_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/20_ejb_obj.gif Binary files differdeleted file mode 100644 index 7dbebc448..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/20_ejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/20_ejbjar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/20_ejbjar_obj.gif Binary files differdeleted file mode 100644 index 6b594c96e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/20_ejbjar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/AccessIntent.gif b/plugins/org.eclipse.jst.j2ee/icons/AccessIntent.gif Binary files differdeleted file mode 100644 index baf46780b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/AccessIntent.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ApplClientJar.gif b/plugins/org.eclipse.jst.j2ee/icons/ApplClientJar.gif Binary files differdeleted file mode 100644 index 4423578f1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ApplClientJar.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/AssemblyDescriptor.gif b/plugins/org.eclipse.jst.j2ee/icons/AssemblyDescriptor.gif Binary files differdeleted file mode 100644 index f0ff233b4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/AssemblyDescriptor.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/AssemblyDescriptorCreateMethodPermission.gif b/plugins/org.eclipse.jst.j2ee/icons/AssemblyDescriptorCreateMethodPermission.gif Binary files differdeleted file mode 100644 index f37ae2b11..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/AssemblyDescriptorCreateMethodPermission.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/AuthenticationMechanism.gif b/plugins/org.eclipse.jst.j2ee/icons/AuthenticationMechanism.gif Binary files differdeleted file mode 100644 index 13da128ce..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/AuthenticationMechanism.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/BeanCache.gif b/plugins/org.eclipse.jst.j2ee/icons/BeanCache.gif Binary files differdeleted file mode 100644 index 34a760d87..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/BeanCache.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/BeanInstall.gif b/plugins/org.eclipse.jst.j2ee/icons/BeanInstall.gif Binary files differdeleted file mode 100644 index dd5d5d56c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/BeanInstall.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/BeanInternationalization.gif b/plugins/org.eclipse.jst.j2ee/icons/BeanInternationalization.gif Binary files differdeleted file mode 100644 index 8fdc9a0bc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/BeanInternationalization.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/BeanStructure.gif b/plugins/org.eclipse.jst.j2ee/icons/BeanStructure.gif Binary files differdeleted file mode 100644 index 4e4b93058..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/BeanStructure.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/CMPAttribute.gif b/plugins/org.eclipse.jst.j2ee/icons/CMPAttribute.gif Binary files differdeleted file mode 100644 index 8f2b1d589..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/CMPAttribute.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/CMPAttributeCreateContainerManagedEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/CMPAttributeCreateContainerManagedEntity.gif Binary files differdeleted file mode 100644 index 5a441709a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/CMPAttributeCreateContainerManagedEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/CMPAttributeold.gif b/plugins/org.eclipse.jst.j2ee/icons/CMPAttributeold.gif Binary files differdeleted file mode 100644 index f143c43bb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/CMPAttributeold.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/CMPKeyAttribute.gif b/plugins/org.eclipse.jst.j2ee/icons/CMPKeyAttribute.gif Binary files differdeleted file mode 100644 index f438dc852..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/CMPKeyAttribute.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/CPDep.gif b/plugins/org.eclipse.jst.j2ee/icons/CPDep.gif Binary files differdeleted file mode 100644 index 2038b22ad..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/CPDep.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ConfigProperty.gif b/plugins/org.eclipse.jst.j2ee/icons/ConfigProperty.gif Binary files differdeleted file mode 100644 index 586eb816b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ConfigProperty.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/Connector.gif b/plugins/org.eclipse.jst.j2ee/icons/Connector.gif Binary files differdeleted file mode 100644 index c0eea5ba8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/Connector.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ConnectorCreateLicense.gif b/plugins/org.eclipse.jst.j2ee/icons/ConnectorCreateLicense.gif Binary files differdeleted file mode 100644 index 11aef620b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ConnectorCreateLicense.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ConnectorCreateResourceAdapter.gif b/plugins/org.eclipse.jst.j2ee/icons/ConnectorCreateResourceAdapter.gif Binary files differdeleted file mode 100644 index f37ae2b11..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ConnectorCreateResourceAdapter.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ContainerActivitySession.gif b/plugins/org.eclipse.jst.j2ee/icons/ContainerActivitySession.gif Binary files differdeleted file mode 100644 index 29aedbcb1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ContainerActivitySession.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntity.gif Binary files differdeleted file mode 100644 index 20ed1f9a4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityCreateEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityCreateEntity.gif Binary files differdeleted file mode 100644 index 37517a090..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityCreateEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityExtension.gif b/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityExtension.gif Binary files differdeleted file mode 100644 index b8c44509a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityExtension.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityExtensionCreateEjbRelationshipRole.gif b/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityExtensionCreateEjbRelationshipRole.gif Binary files differdeleted file mode 100644 index 93036317b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityExtensionCreateEjbRelationshipRole.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityno.gif b/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityno.gif Binary files differdeleted file mode 100644 index e93cc1db2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ContainerManagedEntityno.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/Copy of CreateChild.gif b/plugins/org.eclipse.jst.j2ee/icons/Copy of CreateChild.gif Binary files differdeleted file mode 100644 index 81aa4a2f8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/Copy of CreateChild.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/CreateChild.gif b/plugins/org.eclipse.jst.j2ee/icons/CreateChild.gif Binary files differdeleted file mode 100644 index 81aa4a2f8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/CreateChild.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EAR.gif b/plugins/org.eclipse.jst.j2ee/icons/EAR.gif Binary files differdeleted file mode 100644 index b5630b311..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EAR.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EJBJar.gif b/plugins/org.eclipse.jst.j2ee/icons/EJBJar.gif Binary files differdeleted file mode 100644 index f8b5c0a09..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EJBJar.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EJBJarCreateContainerManagedEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/EJBJarCreateContainerManagedEntity.gif Binary files differdeleted file mode 100644 index 1e1969059..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EJBJarCreateContainerManagedEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EJBJarCreateEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/EJBJarCreateEntity.gif Binary files differdeleted file mode 100644 index 5a441709a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EJBJarCreateEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EJBJarExtension.gif b/plugins/org.eclipse.jst.j2ee/icons/EJBJarExtension.gif Binary files differdeleted file mode 100644 index 7438a9df0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EJBJarExtension.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EJBJarExtensionCreateEjbGeneralization.gif b/plugins/org.eclipse.jst.j2ee/icons/EJBJarExtensionCreateEjbGeneralization.gif Binary files differdeleted file mode 100644 index 00295179d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EJBJarExtensionCreateEjbGeneralization.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EJBMethodCategory.gif b/plugins/org.eclipse.jst.j2ee/icons/EJBMethodCategory.gif Binary files differdeleted file mode 100644 index 7438a9df0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EJBMethodCategory.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbGeneralization.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbGeneralization.gif Binary files differdeleted file mode 100644 index aa490b6e3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbGeneralization.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbKeyRelationshipRole.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbKeyRelationshipRole.gif Binary files differdeleted file mode 100644 index 1b12ecf4f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbKeyRelationshipRole.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbModelFile.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbModelFile.gif Binary files differdeleted file mode 100644 index dfbc52986..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbModelFile.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbModule.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbModule.gif Binary files differdeleted file mode 100644 index f8b5c0a09..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbModule.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbModuleExtension.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbModuleExtension.gif Binary files differdeleted file mode 100644 index e34cdad16..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbModuleExtension.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbRelationship.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbRelationship.gif Binary files differdeleted file mode 100644 index bd63583f1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbRelationship.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbRelationshipRole.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbRelationshipRole.gif Binary files differdeleted file mode 100644 index 14902a0be..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbRelationshipRole.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbextModelFile.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbextModelFile.gif Binary files differdeleted file mode 100644 index dfbc52986..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbextModelFile.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EjbqlFinderDescriptor.gif b/plugins/org.eclipse.jst.j2ee/icons/EjbqlFinderDescriptor.gif Binary files differdeleted file mode 100644 index 586eb816b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EjbqlFinderDescriptor.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBean.gif b/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBean.gif Binary files differdeleted file mode 100644 index 586eb816b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBean.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanCreateContainerManagedEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanCreateContainerManagedEntity.gif Binary files differdeleted file mode 100644 index 99722d527..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanCreateContainerManagedEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanCreateEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanCreateEntity.gif Binary files differdeleted file mode 100644 index 99722d527..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanCreateEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanExtension.gif b/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanExtension.gif Binary files differdeleted file mode 100644 index c0eea5ba8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanExtension.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanExtensionCreateReadOnlyAttributes.gif b/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanExtensionCreateReadOnlyAttributes.gif Binary files differdeleted file mode 100644 index 11aef620b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EnterpriseBeanExtensionCreateReadOnlyAttributes.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/Entity.gif b/plugins/org.eclipse.jst.j2ee/icons/Entity.gif Binary files differdeleted file mode 100644 index 2969141b8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/Entity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EntityCreateContainerManagedEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/EntityCreateContainerManagedEntity.gif Binary files differdeleted file mode 100644 index 00295179d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EntityCreateContainerManagedEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EntityEJB.gif b/plugins/org.eclipse.jst.j2ee/icons/EntityEJB.gif Binary files differdeleted file mode 100644 index 80468117d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EntityEJB.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EntityExtension.gif b/plugins/org.eclipse.jst.j2ee/icons/EntityExtension.gif Binary files differdeleted file mode 100644 index f0ff233b4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EntityExtension.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/EntityExtensionCreateReadOnlyAttributes.gif b/plugins/org.eclipse.jst.j2ee/icons/EntityExtensionCreateReadOnlyAttributes.gif Binary files differdeleted file mode 100644 index f37ae2b11..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/EntityExtensionCreateReadOnlyAttributes.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/FinderDescriptor.gif b/plugins/org.eclipse.jst.j2ee/icons/FinderDescriptor.gif Binary files differdeleted file mode 100644 index 2969141b8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/FinderDescriptor.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/FullSelectFinderDescriptor.gif b/plugins/org.eclipse.jst.j2ee/icons/FullSelectFinderDescriptor.gif Binary files differdeleted file mode 100644 index 13da128ce..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/FullSelectFinderDescriptor.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/Identity.gif b/plugins/org.eclipse.jst.j2ee/icons/Identity.gif Binary files differdeleted file mode 100644 index 51cf89f26..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/Identity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/JavaClientModule.gif b/plugins/org.eclipse.jst.j2ee/icons/JavaClientModule.gif Binary files differdeleted file mode 100644 index 12a9ed73b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/JavaClientModule.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/JavaClientModuleExtension.gif b/plugins/org.eclipse.jst.j2ee/icons/JavaClientModuleExtension.gif Binary files differdeleted file mode 100644 index 12a9ed73b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/JavaClientModuleExtension.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/License.gif b/plugins/org.eclipse.jst.j2ee/icons/License.gif Binary files differdeleted file mode 100644 index f0ff233b4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/License.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/LocalTran.gif b/plugins/org.eclipse.jst.j2ee/icons/LocalTran.gif Binary files differdeleted file mode 100644 index e652041d3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/LocalTran.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/MethodElement.gif b/plugins/org.eclipse.jst.j2ee/icons/MethodElement.gif Binary files differdeleted file mode 100644 index c3e27cdec..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/MethodElement.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/MethodPermission.gif b/plugins/org.eclipse.jst.j2ee/icons/MethodPermission.gif Binary files differdeleted file mode 100644 index db55cc72d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/MethodPermission.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/MethodPermissionCreateMethodElement.gif b/plugins/org.eclipse.jst.j2ee/icons/MethodPermissionCreateMethodElement.gif Binary files differdeleted file mode 100644 index 11aef620b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/MethodPermissionCreateMethodElement.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/MethodSessionAttribute.gif b/plugins/org.eclipse.jst.j2ee/icons/MethodSessionAttribute.gif Binary files differdeleted file mode 100644 index 6836424f3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/MethodSessionAttribute.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/MethodTransaction.gif b/plugins/org.eclipse.jst.j2ee/icons/MethodTransaction.gif Binary files differdeleted file mode 100644 index c33f3b2c0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/MethodTransaction.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/MethodTransactionCreateMethodElement.gif b/plugins/org.eclipse.jst.j2ee/icons/MethodTransactionCreateMethodElement.gif Binary files differdeleted file mode 100644 index 93036317b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/MethodTransactionCreateMethodElement.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/PersistenceSecurityIdentity.gif b/plugins/org.eclipse.jst.j2ee/icons/PersistenceSecurityIdentity.gif Binary files differdeleted file mode 100644 index adedfe31d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/PersistenceSecurityIdentity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ReadOnlyAttributes.gif b/plugins/org.eclipse.jst.j2ee/icons/ReadOnlyAttributes.gif Binary files differdeleted file mode 100644 index 9f50c468b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ReadOnlyAttributes.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapter.gif b/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapter.gif Binary files differdeleted file mode 100644 index b8c44509a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapter.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateAuthenticationMechanism.gif b/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateAuthenticationMechanism.gif Binary files differdeleted file mode 100644 index 00295179d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateAuthenticationMechanism.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateConfigProperty.gif b/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateConfigProperty.gif Binary files differdeleted file mode 100644 index 37517a090..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateConfigProperty.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateSecurityPermission.gif b/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateSecurityPermission.gif Binary files differdeleted file mode 100644 index 93036317b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ResourceAdapterCreateSecurityPermission.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/RunAsMode.gif b/plugins/org.eclipse.jst.j2ee/icons/RunAsMode.gif Binary files differdeleted file mode 100644 index 8ed70a4be..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/RunAsMode.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/RunAsSpecifiedIdentity.gif b/plugins/org.eclipse.jst.j2ee/icons/RunAsSpecifiedIdentity.gif Binary files differdeleted file mode 100644 index 585ac7a25..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/RunAsSpecifiedIdentity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/SecurityIdentity.gif b/plugins/org.eclipse.jst.j2ee/icons/SecurityIdentity.gif Binary files differdeleted file mode 100644 index 56587d89c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/SecurityIdentity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/SecurityPermission.gif b/plugins/org.eclipse.jst.j2ee/icons/SecurityPermission.gif Binary files differdeleted file mode 100644 index 2969141b8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/SecurityPermission.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/Session.gif b/plugins/org.eclipse.jst.j2ee/icons/Session.gif Binary files differdeleted file mode 100644 index 507b8a82e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/Session.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/SessionCreateContainerManagedEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/SessionCreateContainerManagedEntity.gif Binary files differdeleted file mode 100644 index 8ac779306..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/SessionCreateContainerManagedEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/SessionCreateEntity.gif b/plugins/org.eclipse.jst.j2ee/icons/SessionCreateEntity.gif Binary files differdeleted file mode 100644 index 8ac779306..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/SessionCreateEntity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/SessionExtension.gif b/plugins/org.eclipse.jst.j2ee/icons/SessionExtension.gif Binary files differdeleted file mode 100644 index 7c28109f6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/SessionExtension.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/SessionExtensionCreateReadOnlyAttributes.gif b/plugins/org.eclipse.jst.j2ee/icons/SessionExtensionCreateReadOnlyAttributes.gif Binary files differdeleted file mode 100644 index 37517a090..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/SessionExtensionCreateReadOnlyAttributes.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/UseCallerIdentity.gif b/plugins/org.eclipse.jst.j2ee/icons/UseCallerIdentity.gif Binary files differdeleted file mode 100644 index 8e385e997..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/UseCallerIdentity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/UseSystemIdentity.gif b/plugins/org.eclipse.jst.j2ee/icons/UseSystemIdentity.gif Binary files differdeleted file mode 100644 index cf76ebc6c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/UseSystemIdentity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/UserFinderDescriptor.gif b/plugins/org.eclipse.jst.j2ee/icons/UserFinderDescriptor.gif Binary files differdeleted file mode 100644 index 29d1aab8b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/UserFinderDescriptor.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/WAR.gif b/plugins/org.eclipse.jst.j2ee/icons/WAR.gif Binary files differdeleted file mode 100644 index 31ecb7aee..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/WAR.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/WebModule.gif b/plugins/org.eclipse.jst.j2ee/icons/WebModule.gif Binary files differdeleted file mode 100644 index bf20f7017..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/WebModule.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/WebModuleExtension.gif b/plugins/org.eclipse.jst.j2ee/icons/WebModuleExtension.gif Binary files differdeleted file mode 100644 index bf20f7017..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/WebModuleExtension.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/WhereClauseFinderDescriptor.gif b/plugins/org.eclipse.jst.j2ee/icons/WhereClauseFinderDescriptor.gif Binary files differdeleted file mode 100644 index d85a9d0b3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/WhereClauseFinderDescriptor.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/access_intent_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/access_intent_obj.gif Binary files differdeleted file mode 100644 index caf09eaac..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/access_intent_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/access_intent_read_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/access_intent_read_obj.gif Binary files differdeleted file mode 100644 index b5dd219d0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/access_intent_read_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/access_intent_update_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/access_intent_update_obj.gif Binary files differdeleted file mode 100644 index b3307fee3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/access_intent_update_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/appClientExt_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/appClientExt_obj.gif Binary files differdeleted file mode 100644 index 910df4963..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/appClientExt_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/assemblyDescriptor_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/assemblyDescriptor_obj.gif Binary files differdeleted file mode 100644 index 405cae616..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/assemblyDescriptor_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/attributeKey_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/attributeKey_obj.gif Binary files differdeleted file mode 100644 index 534b37a72..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/attributeKey_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/attribute_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/attribute_obj.gif Binary files differdeleted file mode 100644 index cfb58e431..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/attribute_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/bmp.gif b/plugins/org.eclipse.jst.j2ee/icons/bmp.gif Binary files differdeleted file mode 100644 index ebc18b587..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/bmp.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/bmpEntity_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/bmpEntity_obj.gif Binary files differdeleted file mode 100644 index 797df138c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/bmpEntity_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/cmp.gif b/plugins/org.eclipse.jst.j2ee/icons/cmp.gif Binary files differdeleted file mode 100644 index 20ed1f9a4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/cmp.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/cmpEntity_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/cmpEntity_obj.gif Binary files differdeleted file mode 100644 index 20ed1f9a4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/cmpEntity_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/cmpField_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/cmpField_obj.gif Binary files differdeleted file mode 100644 index 6c66a3d9e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/cmpField_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/deaccsintent_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/deaccsintent_ovr.gif Binary files differdeleted file mode 100644 index 327c3f3f4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/deaccsintent_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/earBinding_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/earBinding_obj.gif Binary files differdeleted file mode 100644 index 2c1bc4114..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/earBinding_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/earExtension_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/earExtension_obj.gif Binary files differdeleted file mode 100644 index 07c56bc83..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/earExtension_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/earFile_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/earFile_obj.gif Binary files differdeleted file mode 100644 index 4468d66ab..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/earFile_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ejb16.gif b/plugins/org.eclipse.jst.j2ee/icons/ejb16.gif Binary files differdeleted file mode 100644 index f8b5c0a09..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ejb16.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ejb16old.GIF b/plugins/org.eclipse.jst.j2ee/icons/ejb16old.GIF Binary files differdeleted file mode 100644 index 1e4a57cb2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ejb16old.GIF +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ejbBinding_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/ejbBinding_obj.gif Binary files differdeleted file mode 100644 index c97e6eee1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ejbBinding_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ejbExtension_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/ejbExtension_obj.gif Binary files differdeleted file mode 100644 index 12184cfad..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ejbExtension_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ejbJar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/ejbJar_obj.gif Binary files differdeleted file mode 100644 index f8b5c0a09..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ejbJar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/ejbRef_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/ejbRef_obj.gif Binary files differdeleted file mode 100644 index 515506901..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/ejbRef_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/entitybean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/entitybean_obj.gif Binary files differdeleted file mode 100644 index 20ed1f9a4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/entitybean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/entitybean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/entitybean_wiz.gif Binary files differdeleted file mode 100644 index 5fb89294f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/entitybean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/error_co.gif b/plugins/org.eclipse.jst.j2ee/icons/error_co.gif Binary files differdeleted file mode 100644 index 119dcccd5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/error_co.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/field.gif b/plugins/org.eclipse.jst.j2ee/icons/field.gif Binary files differdeleted file mode 100644 index 06d38f5c8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/field.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/finder_descriptor_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/finder_descriptor_obj.gif Binary files differdeleted file mode 100644 index 5533c0bae..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/finder_descriptor_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/foreignKey_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/foreignKey_obj.gif Binary files differdeleted file mode 100644 index d261a1de3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/foreignKey_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/frnkeyrelnshp_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/frnkeyrelnshp_ovr.gif Binary files differdeleted file mode 100644 index cee9ff63e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/frnkeyrelnshp_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/Field_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/Field_ejb.gif Binary files differdeleted file mode 100644 index 06d38f5c8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/Field_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/ShowBaseTypes_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/ShowBaseTypes_ejb.gif Binary files differdeleted file mode 100644 index 9d8c615a8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/ShowBaseTypes_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/ShowGenTypes_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/ShowGenTypes_ejb.gif Binary files differdeleted file mode 100644 index ba4b1c362..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/ShowGenTypes_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/Types_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/Types_ejb.gif Binary files differdeleted file mode 100644 index e0ecb6a57..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/clcl16/Types_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/CreateResourceRefBinding_defaultAuth_BasicAuthData.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/CreateResourceRefBinding_defaultAuth_BasicAuthData.gif Binary files differdeleted file mode 100644 index 453145c7d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/CreateResourceRefBinding_defaultAuth_BasicAuthData.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/CreateRunAsSpecifiedIdentity_identity_Identity.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/CreateRunAsSpecifiedIdentity_identity_Identity.gif Binary files differdeleted file mode 100644 index 82bd4bdf3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/CreateRunAsSpecifiedIdentity_identity_Identity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/appclient_export_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/appclient_export_wiz.gif Binary files differdeleted file mode 100644 index 6f83300c8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/appclient_export_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/appclient_import_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/appclient_import_wiz.gif Binary files differdeleted file mode 100644 index ce667f4ef..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/appclient_import_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/createEJB_RDB.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/createEJB_RDB.gif Binary files differdeleted file mode 100644 index a6627bdfa..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/createEJB_RDB.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/createRDB_EJB.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/createRDB_EJB.gif Binary files differdeleted file mode 100644 index c323270b8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/createRDB_EJB.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejb_rdbmapping_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejb_rdbmapping_wiz.gif Binary files differdeleted file mode 100644 index 31748bd7f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejb_rdbmapping_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejbclientjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejbclientjar_wiz.gif Binary files differdeleted file mode 100644 index 6e65e7d54..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejbclientjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejbcomposer_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejbcomposer_wiz.gif Binary files differdeleted file mode 100644 index 847be21b7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/ejbcomposer_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_ear_wiz.gif Binary files differdeleted file mode 100644 index 2270b1717..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 72cd417c4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_rar_wiz.gif Binary files differdeleted file mode 100644 index befb3d4e8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_rar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_war_wiz.gif Binary files differdeleted file mode 100644 index ced859dd4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/export_war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/generate_ddl.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/generate_ddl.gif Binary files differdeleted file mode 100644 index fabe5588e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/generate_ddl.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/generate_rmic.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/generate_rmic.gif Binary files differdeleted file mode 100644 index b0fefa221..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/generate_rmic.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_ear_wiz.gif Binary files differdeleted file mode 100644 index 099201bb5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 5644b48df..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_rar_wiz.gif Binary files differdeleted file mode 100644 index 50f25a2f7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_rar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_war_wiz.gif Binary files differdeleted file mode 100644 index 432c06679..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/import_war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/new_appclientproject_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/new_appclientproject_wiz.gif Binary files differdeleted file mode 100644 index cd94cc493..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/new_appclientproject_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newaccessbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newaccessbean_wiz.gif Binary files differdeleted file mode 100644 index 1e0ca041e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newaccessbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newappclient_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newappclient_wiz.gif Binary files differdeleted file mode 100644 index 0ce86a13a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newappclient_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newconnectionprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newconnectionprj_wiz.gif Binary files differdeleted file mode 100644 index 1bec6ba83..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newconnectionprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newear_wiz.gif Binary files differdeleted file mode 100644 index 8b409b507..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejb_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejb_wiz.gif Binary files differdeleted file mode 100644 index 73561c7ab..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejb_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbex_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbex_wiz.gif Binary files differdeleted file mode 100644 index 6fbde809c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbjar_wiz.gif Binary files differdeleted file mode 100644 index 219e4c3df..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbprj_wiz.gif Binary files differdeleted file mode 100644 index ecda22bf9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newejbprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newservlet_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newservlet_wiz.gif Binary files differdeleted file mode 100644 index f45eadca8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newservlet_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newwar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newwar_wiz.gif Binary files differdeleted file mode 100644 index b9ac6be16..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/newwar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/re_execute.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/re_execute.gif Binary files differdeleted file mode 100644 index 8f943a8c3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/re_execute.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/table_mapping_strategy_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/table_mapping_strategy_wiz.gif Binary files differdeleted file mode 100644 index 88d2c1307..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ctool16/table_mapping_strategy_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/data_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/data_view.gif Binary files differdeleted file mode 100644 index 8f2b1d589..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/data_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ear_ed_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ear_ed_view.gif Binary files differdeleted file mode 100644 index 2800367fd..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ear_ed_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/earext_ed_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/earext_ed_view.gif Binary files differdeleted file mode 100644 index e9b34130d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/earext_ed_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_ed_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_ed_view.gif Binary files differdeleted file mode 100644 index ac0972f65..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_ed_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_rdbmapping_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_rdbmapping_view.gif Binary files differdeleted file mode 100644 index 650671f9b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_rdbmapping_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_view.gif Binary files differdeleted file mode 100644 index ac0972f65..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejb_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejbext_ed_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejbext_ed_view.gif Binary files differdeleted file mode 100644 index e9b34130d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/ejbext_ed_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/j2ee_perspective.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/j2ee_perspective.gif Binary files differdeleted file mode 100644 index 20acd4c42..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/j2ee_perspective.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/j2ee_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/j2ee_view.gif Binary files differdeleted file mode 100644 index 20acd4c42..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/j2ee_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/table_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/cview16/table_view.gif Binary files differdeleted file mode 100644 index b99b45cac..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/cview16/table_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/Field_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/Field_ejb.gif Binary files differdeleted file mode 100644 index bc24f1a0a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/Field_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/ShowBaseTypes_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/ShowBaseTypes_ejb.gif Binary files differdeleted file mode 100644 index d723a5f4d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/ShowBaseTypes_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/ShowGenTypes_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/ShowGenTypes_ejb.gif Binary files differdeleted file mode 100644 index 956e8b240..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/ShowGenTypes_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/Types_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/Types_ejb.gif Binary files differdeleted file mode 100644 index 645b1beaf..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dlcl16/Types_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/appclient_export_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/appclient_export_wiz.gif Binary files differdeleted file mode 100644 index f4c1946bc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/appclient_export_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/appclient_import_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/appclient_import_wiz.gif Binary files differdeleted file mode 100644 index 8311eb322..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/appclient_import_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/createEJB_RDB.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/createEJB_RDB.gif Binary files differdeleted file mode 100644 index 07c8fda7a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/createEJB_RDB.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/createRDB_EJB.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/createRDB_EJB.gif Binary files differdeleted file mode 100644 index 4c3edb1c2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/createRDB_EJB.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejb_rdbmapping_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejb_rdbmapping_wiz.gif Binary files differdeleted file mode 100644 index e321a4993..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejb_rdbmapping_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejbclientjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejbclientjar_wiz.gif Binary files differdeleted file mode 100644 index 849fea4f1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejbclientjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejbcomposer_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejbcomposer_wiz.gif Binary files differdeleted file mode 100644 index f3ad6c157..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/ejbcomposer_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_ear_wiz.gif Binary files differdeleted file mode 100644 index 0df2346e8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 86f296b15..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_rar_wiz.gif Binary files differdeleted file mode 100644 index 2f32b119a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_rar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_war_wiz.gif Binary files differdeleted file mode 100644 index 211d4e513..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/export_war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/generate_ddl.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/generate_ddl.gif Binary files differdeleted file mode 100644 index 4cf6b348f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/generate_ddl.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/generate_rmic.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/generate_rmic.gif Binary files differdeleted file mode 100644 index e579151f8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/generate_rmic.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_ear_wiz.gif Binary files differdeleted file mode 100644 index 69b92b9cb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index e55397626..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_rar_wiz.gif Binary files differdeleted file mode 100644 index d4d230832..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_rar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_war_wiz.gif Binary files differdeleted file mode 100644 index 1cd2eb0c9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/import_war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/new_appclientproject_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/new_appclientproject_wiz.gif Binary files differdeleted file mode 100644 index bf1b02029..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/new_appclientproject_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newaccessbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newaccessbean_wiz.gif Binary files differdeleted file mode 100644 index 73bdda6ac..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newaccessbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newappclient_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newappclient_wiz.gif Binary files differdeleted file mode 100644 index 17a003614..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newappclient_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newconnectionprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newconnectionprj_wiz.gif Binary files differdeleted file mode 100644 index 36ea3b14f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newconnectionprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newear_wiz.gif Binary files differdeleted file mode 100644 index fcee4ff22..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejb_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejb_wiz.gif Binary files differdeleted file mode 100644 index 96ce90f11..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejb_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbex_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbex_wiz.gif Binary files differdeleted file mode 100644 index 56c4b3dc8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbjar_wiz.gif Binary files differdeleted file mode 100644 index ae1d521d2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbprj_wiz.gif Binary files differdeleted file mode 100644 index e92896bf6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newejbprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newservlet_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newservlet_wiz.gif Binary files differdeleted file mode 100644 index 76b0a8f04..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newservlet_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newwar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newwar_wiz.gif Binary files differdeleted file mode 100644 index be1414a2f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/newwar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/re_execute.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/re_execute.gif Binary files differdeleted file mode 100644 index 7f056da88..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/re_execute.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/table_mapping_strategy_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/table_mapping_strategy_wiz.gif Binary files differdeleted file mode 100644 index 48314a171..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/dtool16/table_mapping_strategy_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/Field_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/Field_ejb.gif Binary files differdeleted file mode 100644 index 06d38f5c8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/Field_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/ShowBaseTypes_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/ShowBaseTypes_ejb.gif Binary files differdeleted file mode 100644 index 9d8c615a8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/ShowBaseTypes_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/ShowGenTypes_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/ShowGenTypes_ejb.gif Binary files differdeleted file mode 100644 index ba4b1c362..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/ShowGenTypes_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/Types_ejb.gif b/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/Types_ejb.gif Binary files differdeleted file mode 100644 index e0ecb6a57..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/elcl16/Types_ejb.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/appclient_export_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/appclient_export_wiz.gif Binary files differdeleted file mode 100644 index 6f83300c8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/appclient_export_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/appclient_import_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/appclient_import_wiz.gif Binary files differdeleted file mode 100644 index ce667f4ef..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/appclient_import_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/createEJB_RDB.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/createEJB_RDB.gif Binary files differdeleted file mode 100644 index a6627bdfa..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/createEJB_RDB.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/createRDB_EJB.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/createRDB_EJB.gif Binary files differdeleted file mode 100644 index c323270b8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/createRDB_EJB.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejb_rdbmapping_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejb_rdbmapping_wiz.gif Binary files differdeleted file mode 100644 index 31748bd7f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejb_rdbmapping_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejbclientjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejbclientjar_wiz.gif Binary files differdeleted file mode 100644 index 6e65e7d54..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejbclientjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejbcomposer_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejbcomposer_wiz.gif Binary files differdeleted file mode 100644 index 847be21b7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/ejbcomposer_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_ear_wiz.gif Binary files differdeleted file mode 100644 index 2270b1717..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 72cd417c4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_rar_wiz.gif Binary files differdeleted file mode 100644 index befb3d4e8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_rar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_war_wiz.gif Binary files differdeleted file mode 100644 index ced859dd4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/export_war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/generate_ddl.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/generate_ddl.gif Binary files differdeleted file mode 100644 index fabe5588e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/generate_ddl.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/generate_rmic.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/generate_rmic.gif Binary files differdeleted file mode 100644 index b0fefa221..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/generate_rmic.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_ear_wiz.gif Binary files differdeleted file mode 100644 index 099201bb5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 5644b48df..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_rar_wiz.gif Binary files differdeleted file mode 100644 index 50f25a2f7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_rar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_war_wiz.gif Binary files differdeleted file mode 100644 index 432c06679..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/import_war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/new_appclientproject_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/new_appclientproject_wiz.gif Binary files differdeleted file mode 100644 index cd94cc493..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/new_appclientproject_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newaccessbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newaccessbean_wiz.gif Binary files differdeleted file mode 100644 index 1e0ca041e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newaccessbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newappclient_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newappclient_wiz.gif Binary files differdeleted file mode 100644 index 0ce86a13a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newappclient_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newconnectionprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newconnectionprj_wiz.gif Binary files differdeleted file mode 100644 index 1bec6ba83..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newconnectionprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newear_wiz.gif Binary files differdeleted file mode 100644 index 8b409b507..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejb_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejb_wiz.gif Binary files differdeleted file mode 100644 index 73561c7ab..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejb_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbex_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbex_wiz.gif Binary files differdeleted file mode 100644 index 6fbde809c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbjar_wiz.gif Binary files differdeleted file mode 100644 index 219e4c3df..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbprj_wiz.gif Binary files differdeleted file mode 100644 index ecda22bf9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newejbprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newservlet_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newservlet_wiz.gif Binary files differdeleted file mode 100644 index f45eadca8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newservlet_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newwar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newwar_wiz.gif Binary files differdeleted file mode 100644 index b9ac6be16..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/newwar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/re_execute.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/re_execute.gif Binary files differdeleted file mode 100644 index 8f943a8c3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/re_execute.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/table_mapping_strategy_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/etool16/table_mapping_strategy_wiz.gif Binary files differdeleted file mode 100644 index 88d2c1307..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/etool16/table_mapping_strategy_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/data_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/data_view.gif Binary files differdeleted file mode 100644 index 8f2b1d589..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/data_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ear_ed_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ear_ed_view.gif Binary files differdeleted file mode 100644 index 2800367fd..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ear_ed_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/earext_ed_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/earext_ed_view.gif Binary files differdeleted file mode 100644 index e9b34130d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/earext_ed_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_ed_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_ed_view.gif Binary files differdeleted file mode 100644 index ac0972f65..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_ed_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_rdbmapping_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_rdbmapping_view.gif Binary files differdeleted file mode 100644 index 650671f9b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_rdbmapping_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_view.gif Binary files differdeleted file mode 100644 index ac0972f65..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejb_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejbext_ed_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejbext_ed_view.gif Binary files differdeleted file mode 100644 index e9b34130d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/ejbext_ed_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/j2ee_perspective.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/j2ee_perspective.gif Binary files differdeleted file mode 100644 index 20acd4c42..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/j2ee_perspective.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/j2ee_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/j2ee_view.gif Binary files differdeleted file mode 100644 index 20acd4c42..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/j2ee_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/table_view.gif b/plugins/org.eclipse.jst.j2ee/icons/full/eview16/table_view.gif Binary files differdeleted file mode 100644 index b99b45cac..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/eview16/table_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/EJBDataTransformer.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/EJBDataTransformer.gif Binary files differdeleted file mode 100644 index dbfb4e66c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/EJBDataTransformer.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/ForwardFlattenedFKComposer.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/ForwardFlattenedFKComposer.gif Binary files differdeleted file mode 100644 index 40ca08bdf..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/ForwardFlattenedFKComposer.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/InheritedPrimaryTableStrategy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/InheritedPrimaryTableStrategy.gif Binary files differdeleted file mode 100644 index 7ca8515c5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/InheritedPrimaryTableStrategy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/PrimaryTableStrategy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/PrimaryTableStrategy.gif Binary files differdeleted file mode 100644 index 64ec28652..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/PrimaryTableStrategy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/RDBMemberType.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/RDBMemberType.gif Binary files differdeleted file mode 100644 index 94fddb73d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/RDBMemberType.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/arraytype_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/arraytype_obj.gif Binary files differdeleted file mode 100644 index 9c27c10ae..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/arraytype_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/class.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/class.gif Binary files differdeleted file mode 100644 index 6279478c5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/class.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/datatype_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/datatype_obj.gif Binary files differdeleted file mode 100644 index 805379da4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/datatype_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/error_co.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/error_co.gif Binary files differdeleted file mode 100644 index 119dcccd5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/error_co.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/folder.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/folder.gif Binary files differdeleted file mode 100644 index c91b26723..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/folder.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/form_banner.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/form_banner.gif Binary files differdeleted file mode 100644 index aebc0b2a3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/form_banner.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/home_nav.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/home_nav.gif Binary files differdeleted file mode 100644 index fd0c66950..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/home_nav.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/interface.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/interface.gif Binary files differdeleted file mode 100644 index 21325ca77..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/interface.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/jcu_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/jcu_obj.gif Binary files differdeleted file mode 100644 index 36a73ace2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/jcu_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/showerr_tsk.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/showerr_tsk.gif Binary files differdeleted file mode 100644 index c2bfdd606..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/showerr_tsk.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/showwarn_tsk.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/showwarn_tsk.gif Binary files differdeleted file mode 100644 index 14009e997..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/showwarn_tsk.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/warn_tsk.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/warn_tsk.gif Binary files differdeleted file mode 100644 index e2b751dff..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/warn_tsk.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/extra/warning_co.gif b/plugins/org.eclipse.jst.j2ee/icons/full/extra/warning_co.gif Binary files differdeleted file mode 100644 index ee2dac4a9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/extra/warning_co.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_cmpbean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_cmpbean_obj.gif Binary files differdeleted file mode 100644 index 5db4e72ed..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_cmpbean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_ejb_obj.gif Binary files differdeleted file mode 100644 index 445aa374e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_ejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_ejbjar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_ejbjar_obj.gif Binary files differdeleted file mode 100644 index f34adc945..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/11_ejbjar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/12_ear_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/12_ear_deploy.gif Binary files differdeleted file mode 100644 index f4e43f0d2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/12_ear_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/12_ear_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/12_ear_obj.gif Binary files differdeleted file mode 100644 index f66e7a922..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/12_ear_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/13_ear_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/13_ear_deploy.gif Binary files differdeleted file mode 100644 index d8a225441..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/13_ear_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/13_ear_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/13_ear_obj.gif Binary files differdeleted file mode 100644 index 07cd6ab2e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/13_ear_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/14_ear_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/14_ear_obj.gif Binary files differdeleted file mode 100644 index 54b9b1745..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/14_ear_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_cmpbean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_cmpbean_obj.gif Binary files differdeleted file mode 100644 index 023fe8d4d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_cmpbean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_ejb_obj.gif Binary files differdeleted file mode 100644 index 7dbebc448..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_ejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_ejbjar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_ejbjar_obj.gif Binary files differdeleted file mode 100644 index 6b594c96e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/20_ejbjar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_cmpbean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_cmpbean_obj.gif Binary files differdeleted file mode 100644 index 35835bc25..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_cmpbean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_ejb_obj.gif Binary files differdeleted file mode 100644 index 673ba6aa6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_ejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 9dae05280..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/21_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/AbstractAuthData.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/AbstractAuthData.gif Binary files differdeleted file mode 100644 index 9840795fb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/AbstractAuthData.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ActivationConfig.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ActivationConfig.gif Binary files differdeleted file mode 100644 index 7b2c1f750..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ActivationConfig.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ActivationConfigProperty.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ActivationConfigProperty.gif Binary files differdeleted file mode 100644 index bc4723920..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ActivationConfigProperty.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/BasicAuthData.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/BasicAuthData.gif Binary files differdeleted file mode 100644 index 474fe9757..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/BasicAuthData.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/CompatibilityDescriptionGroup.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/CompatibilityDescriptionGroup.gif Binary files differdeleted file mode 100644 index e4b530eca..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/CompatibilityDescriptionGroup.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EJBLocalRef.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EJBLocalRef.gif Binary files differdeleted file mode 100644 index 49f813f09..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EJBLocalRef.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EjbRef.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EjbRef.gif Binary files differdeleted file mode 100644 index 5ca132d82..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EjbRef.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EjbRefBinding.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EjbRefBinding.gif Binary files differdeleted file mode 100644 index 5dac05712..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EjbRefBinding.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EnvEntry.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EnvEntry.gif Binary files differdeleted file mode 100644 index 734bfbd68..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/EnvEntry.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/Identity.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/Identity.gif Binary files differdeleted file mode 100644 index 75a9caab7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/Identity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceEnvRef.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceEnvRef.gif Binary files differdeleted file mode 100644 index 11b1dbb00..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceEnvRef.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceEnvRefBinding.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceEnvRefBinding.gif Binary files differdeleted file mode 100644 index 2ceb35ee7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceEnvRefBinding.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceRef.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceRef.gif Binary files differdeleted file mode 100644 index f7e1f5b52..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceRef.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceRefBinding.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceRefBinding.gif Binary files differdeleted file mode 100644 index 1d8d3e873..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ResourceRefBinding.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/RunAsSpecifiedIdentity.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/RunAsSpecifiedIdentity.gif Binary files differdeleted file mode 100644 index 483f3c2cf..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/RunAsSpecifiedIdentity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SOAPHeader.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SOAPHeader.gif Binary files differdeleted file mode 100644 index 7bf99266f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SOAPHeader.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityIdentity.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityIdentity.gif Binary files differdeleted file mode 100644 index b05d25b94..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityIdentity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityRole.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityRole.gif Binary files differdeleted file mode 100644 index 16472b83f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityRole.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityRoleRef.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityRoleRef.gif Binary files differdeleted file mode 100644 index 37f38ea19..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/SecurityRoleRef.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/UseCallerIdentity.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/UseCallerIdentity.gif Binary files differdeleted file mode 100644 index ffe70317c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/UseCallerIdentity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_obj.gif Binary files differdeleted file mode 100644 index caf09eaac..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_read_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_read_obj.gif Binary files differdeleted file mode 100644 index b5dd219d0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_read_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_update_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_update_obj.gif Binary files differdeleted file mode 100644 index b3307fee3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/access_intent_update_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/accessbean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/accessbean_obj.gif Binary files differdeleted file mode 100644 index 96411b8ce..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/accessbean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/annotation_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/annotation_positioned_overlay.gif Binary files differdeleted file mode 100644 index cec1d2d54..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/annotation_positioned_overlay.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appClientExt_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appClientExt_obj.gif Binary files differdeleted file mode 100644 index 910df4963..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appClientExt_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_12.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_12.gif Binary files differdeleted file mode 100644 index 6c304dbef..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_12.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_12_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_12_deploy.gif Binary files differdeleted file mode 100644 index da01785a2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_12_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_13.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_13.gif Binary files differdeleted file mode 100644 index 556473c02..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_13.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_13_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_13_deploy.gif Binary files differdeleted file mode 100644 index e1d605b6e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_13_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_14.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_14.gif Binary files differdeleted file mode 100644 index b2483803b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_14.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_14_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_14_deploy.gif Binary files differdeleted file mode 100644 index b0d08af9e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclient_14_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclientgroup_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclientgroup_deploy.gif Binary files differdeleted file mode 100644 index bb973cd42..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclientgroup_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclientgroup_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclientgroup_obj.gif Binary files differdeleted file mode 100644 index 276842824..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/appclientgroup_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/applclientJAR_obj.GIF b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/applclientJAR_obj.GIF Binary files differdeleted file mode 100644 index 4423578f1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/applclientJAR_obj.GIF +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/assemblyDescriptor_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/assemblyDescriptor_obj.gif Binary files differdeleted file mode 100644 index 405cae616..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/assemblyDescriptor_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/attributeKey_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/attributeKey_obj.gif Binary files differdeleted file mode 100644 index 534b37a72..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/attributeKey_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/attribute_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/attribute_obj.gif Binary files differdeleted file mode 100644 index cfb58e431..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/attribute_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_data_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_data_obj.gif Binary files differdeleted file mode 100644 index 757f6d9a9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_data_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_mechanism_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_mechanism_obj.gif Binary files differdeleted file mode 100644 index 30fdf97b2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_mechanism_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_table_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_table_obj.gif Binary files differdeleted file mode 100644 index 6600367bf..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/auth_table_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/bmpEntity_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/bmpEntity_obj.gif Binary files differdeleted file mode 100644 index 797df138c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/bmpEntity_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpEntity_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpEntity_obj.gif Binary files differdeleted file mode 100644 index 20ed1f9a4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpEntity_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpField_dec.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpField_dec.gif Binary files differdeleted file mode 100644 index 6c66a3d9e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpField_dec.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpField_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpField_obj.gif Binary files differdeleted file mode 100644 index 6c66a3d9e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/cmpField_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/collaccess_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/collaccess_obj.gif Binary files differdeleted file mode 100644 index 8ac7ca754..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/collaccess_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/collincrement_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/collincrement_obj.gif Binary files differdeleted file mode 100644 index 2aec8796e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/collincrement_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/config_prop_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/config_prop_obj.gif Binary files differdeleted file mode 100644 index bc4723920..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/config_prop_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connection_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connection_obj.gif Binary files differdeleted file mode 100644 index e8efe69dc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connection_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connector_module.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connector_module.gif Binary files differdeleted file mode 100644 index 522c511d6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connector_module.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connectorgroup_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connectorgroup_obj.gif Binary files differdeleted file mode 100644 index ad3af3c65..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/connectorgroup_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/copyhelper_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/copyhelper_ovr.gif Binary files differdeleted file mode 100644 index 4b850e428..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/copyhelper_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/create_child.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/create_child.gif Binary files differdeleted file mode 100644 index eb68f6376..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/create_child.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/dataclass_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/dataclass_ovr.gif Binary files differdeleted file mode 100644 index cac40a880..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/dataclass_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/db_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/db_obj.gif Binary files differdeleted file mode 100644 index 8f2b1d589..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/db_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/dbgroup_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/dbgroup_obj.gif Binary files differdeleted file mode 100644 index 40d011d0b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/dbgroup_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earBinding_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earBinding_obj.gif Binary files differdeleted file mode 100644 index 2c1bc4114..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earBinding_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earExtension_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earExtension_obj.gif Binary files differdeleted file mode 100644 index 07c56bc83..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earExtension_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earFile_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earFile_obj.gif Binary files differdeleted file mode 100644 index 4468d66ab..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/earFile_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/eargroup_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/eargroup_deploy.gif Binary files differdeleted file mode 100644 index cb0af0116..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/eargroup_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/eargroup_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/eargroup_obj.gif Binary files differdeleted file mode 100644 index 2eeb3ef01..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/eargroup_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbBinding_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbBinding_obj.gif Binary files differdeleted file mode 100644 index c97e6eee1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbBinding_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbExtension_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbExtension_obj.gif Binary files differdeleted file mode 100644 index 12184cfad..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbExtension_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbJar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbJar_obj.gif Binary files differdeleted file mode 100644 index f8b5c0a09..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbJar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbRef_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbRef_obj.gif Binary files differdeleted file mode 100644 index 515506901..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbRef_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_container_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_container_obj.gif Binary files differdeleted file mode 100644 index b0adb3e59..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_container_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_local_ref_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_local_ref_obj.gif Binary files differdeleted file mode 100644 index be8a6c1ce..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_local_ref_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_rdbmapping_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_rdbmapping_obj.gif Binary files differdeleted file mode 100644 index ed3b87bc0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_rdbmapping_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_reference.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_reference.gif Binary files differdeleted file mode 100644 index 515506901..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejb_reference.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbclientjar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbclientjar_obj.gif Binary files differdeleted file mode 100644 index f1c715ef9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbclientjar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbclientutil_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbclientutil_obj.gif Binary files differdeleted file mode 100644 index 51db289d0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbclientutil_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbgroup_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbgroup_deploy.gif Binary files differdeleted file mode 100644 index d85581251..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbgroup_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbgroup_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbgroup_obj.gif Binary files differdeleted file mode 100644 index b0adb3e59..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbgroup_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbql_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbql_obj.gif Binary files differdeleted file mode 100644 index 6e9243894..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/ejbql_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/environment_entity.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/environment_entity.gif Binary files differdeleted file mode 100644 index bf043f959..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/environment_entity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/envvar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/envvar_obj.gif Binary files differdeleted file mode 100644 index bf043f959..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/envvar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/extwebserviceitemprovider_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/extwebserviceitemprovider_obj.gif Binary files differdeleted file mode 100644 index f4cc6e3aa..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/extwebserviceitemprovider_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/finder_descriptor_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/finder_descriptor_obj.gif Binary files differdeleted file mode 100644 index 5533c0bae..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/finder_descriptor_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/foreignKey_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/foreignKey_obj.gif Binary files differdeleted file mode 100644 index d261a1de3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/foreignKey_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/form_banner.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/form_banner.gif Binary files differdeleted file mode 100644 index aebc0b2a3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/form_banner.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/group_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/group_obj.gif Binary files differdeleted file mode 100644 index 2de7edd64..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/group_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/homeInt_dec.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/homeInt_dec.gif Binary files differdeleted file mode 100644 index 41f6a7af4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/homeInt_dec.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/home_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/home_interface_positioned_overlay.gif Binary files differdeleted file mode 100644 index 91a756a3d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/home_interface_positioned_overlay.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/inhrelejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/inhrelejb_obj.gif Binary files differdeleted file mode 100644 index ed38f2378..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/inhrelejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_obj.gif Binary files differdeleted file mode 100644 index 293a4fa4d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_readcom_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_readcom_obj.gif Binary files differdeleted file mode 100644 index 71bfe6321..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_readcom_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_readuncom_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_readuncom_obj.gif Binary files differdeleted file mode 100644 index acfe4db46..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_readuncom_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_repread_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_repread_obj.gif Binary files differdeleted file mode 100644 index 9d489cf5a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_repread_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_serializ_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_serializ_obj.gif Binary files differdeleted file mode 100644 index d7db3f2de..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/isolation_level_serializ_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/jarproject_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/jarproject_deploy.gif Binary files differdeleted file mode 100644 index 4c54bf16c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/jarproject_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/javabean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/javabean_obj.gif Binary files differdeleted file mode 100644 index c5b260c2a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/javabean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/keyInt_dec.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/keyInt_dec.gif Binary files differdeleted file mode 100644 index 03af38b6b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/keyInt_dec.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/license_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/license_obj.gif Binary files differdeleted file mode 100644 index 50e8dbd30..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/license_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/listener.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/listener.gif Binary files differdeleted file mode 100644 index 232047872..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/listener.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/local_home_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/local_home_interface_positioned_overlay.gif Binary files differdeleted file mode 100644 index e5d6090fe..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/local_home_interface_positioned_overlay.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/local_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/local_interface_positioned_overlay.gif Binary files differdeleted file mode 100644 index 156febec2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/local_interface_positioned_overlay.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/manyRight_dec.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/manyRight_dec.gif Binary files differdeleted file mode 100644 index 6edba7b3e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/manyRight_dec.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/message_bean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/message_bean_obj.gif Binary files differdeleted file mode 100644 index 03e422acb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/message_bean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methElement_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methElement_obj.gif Binary files differdeleted file mode 100644 index c3e27cdec..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methElement_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methPermission_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methPermission_obj.gif Binary files differdeleted file mode 100644 index db55cc72d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methPermission_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methTransaction_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methTransaction_obj.gif Binary files differdeleted file mode 100644 index c33f3b2c0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methTransaction_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methods_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methods_obj.gif Binary files differdeleted file mode 100644 index 4054a0ec6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/methods_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_clientapp_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_clientapp_obj.gif Binary files differdeleted file mode 100644 index 0921a8e61..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_clientapp_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_ejb_obj.gif Binary files differdeleted file mode 100644 index 1a7cf0ee6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_ejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_group.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_group.gif Binary files differdeleted file mode 100644 index bb4d9d16b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_group.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_web_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_web_obj.gif Binary files differdeleted file mode 100644 index 7a7b7a3c6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/module_web_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/msgdrivendestination_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/msgdrivendestination_obj.gif Binary files differdeleted file mode 100644 index f5fdccd6f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/msgdrivendestination_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/opt_read.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/opt_read.gif Binary files differdeleted file mode 100644 index 2c4d6cdba..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/opt_read.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/opt_update.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/opt_update.gif Binary files differdeleted file mode 100644 index ab1d06ff4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/opt_update.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/parameter_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/parameter_obj.gif Binary files differdeleted file mode 100644 index b3e0727e8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/parameter_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/pess_read.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/pess_read.gif Binary files differdeleted file mode 100644 index 061aab07d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/pess_read.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/pess_update.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/pess_update.gif Binary files differdeleted file mode 100644 index 996f6ac98..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/pess_update.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/primaryKey_active_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/primaryKey_active_obj.gif Binary files differdeleted file mode 100644 index 7bb71d2ba..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/primaryKey_active_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/primaryKey_inactive_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/primaryKey_inactive_obj.gif Binary files differdeleted file mode 100644 index ebac134d2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/primaryKey_inactive_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/prjutiljar_missing_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/prjutiljar_missing_obj.gif Binary files differdeleted file mode 100644 index ff856e195..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/prjutiljar_missing_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/prjutiljar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/prjutiljar_obj.gif Binary files differdeleted file mode 100644 index 240d96a46..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/prjutiljar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/qname.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/qname.gif Binary files differdeleted file mode 100644 index 904159880..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/qname.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/query_method_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/query_method_obj.gif Binary files differdeleted file mode 100644 index 0d044049d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/query_method_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/readaheadhint_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/readaheadhint_obj.gif Binary files differdeleted file mode 100644 index 3ec246234..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/readaheadhint_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/relationship_role_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/relationship_role_obj.gif Binary files differdeleted file mode 100644 index e42284385..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/relationship_role_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/remInt_dec.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/remInt_dec.gif Binary files differdeleted file mode 100644 index 44c071efb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/remInt_dec.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/remote_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/remote_interface_positioned_overlay.gif Binary files differdeleted file mode 100644 index 203e398f4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/remote_interface_positioned_overlay.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/res_env_ref_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/res_env_ref_obj.gif Binary files differdeleted file mode 100644 index aed2adb9e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/res_env_ref_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resourceRef_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resourceRef_obj.gif Binary files differdeleted file mode 100644 index f84a67a35..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resourceRef_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resource_adapter_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resource_adapter_obj.gif Binary files differdeleted file mode 100644 index 959c660d7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resource_adapter_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resource_reference.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resource_reference.gif Binary files differdeleted file mode 100644 index f84a67a35..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/resource_reference.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/roleKey_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/roleKey_obj.gif Binary files differdeleted file mode 100644 index 274a850e4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/roleKey_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/role_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/role_obj.gif Binary files differdeleted file mode 100644 index b8c76f74a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/role_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/run_binding_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/run_binding_obj.gif Binary files differdeleted file mode 100644 index 4680b4bb3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/run_binding_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/run_map_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/run_map_obj.gif Binary files differdeleted file mode 100644 index 4b5374bb5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/run_map_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/secur_role_ref_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/secur_role_ref_obj.gif Binary files differdeleted file mode 100644 index 36ae1d9dc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/secur_role_ref_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_identity_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_identity_obj.gif Binary files differdeleted file mode 100644 index e91320f56..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_identity_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_permission_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_permission_obj.gif Binary files differdeleted file mode 100644 index 873fe1a25..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_permission_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role.gif Binary files differdeleted file mode 100644 index ad7903727..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role_obj.gif Binary files differdeleted file mode 100644 index ad7903727..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role_reference.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role_reference.gif Binary files differdeleted file mode 100644 index 0ce458a18..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/security_role_reference.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/securityrole_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/securityrole_obj.gif Binary files differdeleted file mode 100644 index a6b251fc8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/securityrole_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/securityrolebinding_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/securityrolebinding_obj.gif Binary files differdeleted file mode 100644 index 227c74932..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/securityrolebinding_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/serverPaused_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/serverPaused_obj.gif Binary files differdeleted file mode 100644 index dbfcf55dc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/serverPaused_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/service_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/service_interface_positioned_overlay.gif Binary files differdeleted file mode 100644 index 614666731..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/service_interface_positioned_overlay.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/sessionBean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/sessionBean_obj.gif Binary files differdeleted file mode 100644 index 507b8a82e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/sessionBean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/session_scope.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/session_scope.gif Binary files differdeleted file mode 100644 index 9d7b01234..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/session_scope.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/showwarn_tsk.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/showwarn_tsk.gif Binary files differdeleted file mode 100644 index 14009e997..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/showwarn_tsk.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/sql_query_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/sql_query_obj.gif Binary files differdeleted file mode 100644 index 72132b2d4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/sql_query_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/timout_scope.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/timout_scope.gif Binary files differdeleted file mode 100644 index f1c3b1685..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/timout_scope.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/transaction_scope.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/transaction_scope.gif Binary files differdeleted file mode 100644 index 4465a80db..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/transaction_scope.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/undefinedRight_dec.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/undefinedRight_dec.gif Binary files differdeleted file mode 100644 index a28c716e7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/undefinedRight_dec.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/user_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/user_obj.gif Binary files differdeleted file mode 100644 index 90a00147b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/user_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/utiljar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/utiljar_obj.gif Binary files differdeleted file mode 100644 index ec315d5ff..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/utiljar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warBinding_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warBinding_obj.gif Binary files differdeleted file mode 100644 index cb71fc651..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warBinding_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warExtension_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warExtension_obj.gif Binary files differdeleted file mode 100644 index 9fe7971be..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warExtension_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warFile_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warFile_obj.gif Binary files differdeleted file mode 100644 index 067477a3b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/warFile_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webServiceItemProvider_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webServiceItemProvider_obj.gif Binary files differdeleted file mode 100644 index 8fb844f5b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webServiceItemProvider_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webServicesFolder_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webServicesFolder_obj.gif Binary files differdeleted file mode 100644 index ab3039ca2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webServicesFolder_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/web_library_project_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/web_library_project_obj.gif Binary files differdeleted file mode 100644 index b268385d0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/web_library_project_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webapp_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webapp_deploy.gif Binary files differdeleted file mode 100644 index 80531e39b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webapp_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webgroup_deploy.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webgroup_deploy.gif Binary files differdeleted file mode 100644 index fb242a513..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webgroup_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webgroup_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webgroup_obj.gif Binary files differdeleted file mode 100644 index 274d361ca..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/obj16/webgroup_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_0_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_0_ovr.gif Binary files differdeleted file mode 100644 index 3bb995aac..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_0_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_1_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_1_ovr.gif Binary files differdeleted file mode 100644 index 4ac772850..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_1_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_2_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_2_ovr.gif Binary files differdeleted file mode 100644 index f350ae458..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_2_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_3_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_3_ovr.gif Binary files differdeleted file mode 100644 index 0888d5636..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_3_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_4_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_4_ovr.gif Binary files differdeleted file mode 100644 index 02affb1fd..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_4_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_5_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_5_ovr.gif Binary files differdeleted file mode 100644 index f3f364be3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/1_5_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_0_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_0_ovr.gif Binary files differdeleted file mode 100644 index 80b105fbe..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_0_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_1_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_1_ovr.gif Binary files differdeleted file mode 100644 index 687276584..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_1_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_2_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_2_ovr.gif Binary files differdeleted file mode 100644 index 77a2bd007..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_2_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_3_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_3_ovr.gif Binary files differdeleted file mode 100644 index 7c714881d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_3_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_4_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_4_ovr.gif Binary files differdeleted file mode 100644 index 39e6f80c1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/2_4_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/caller_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/caller_ovr.gif Binary files differdeleted file mode 100644 index 552337a76..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/caller_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/client_app_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/client_app_ovr.gif Binary files differdeleted file mode 100644 index 3ff1ca57e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/client_app_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/connector_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/connector_ovr.gif Binary files differdeleted file mode 100644 index b7e77bc69..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/connector_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/database_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/database_ovr.gif Binary files differdeleted file mode 100644 index 2ab322dc7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/database_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/ejb_module_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/ejb_module_ovr.gif Binary files differdeleted file mode 100644 index cf50d6d66..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/ejb_module_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/ejbql_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/ejbql_ovr.gif Binary files differdeleted file mode 100644 index 4081d4c37..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/ejbql_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/enterprise_app_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/enterprise_app_ovr.gif Binary files differdeleted file mode 100644 index ec19c473c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/enterprise_app_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/fullselect_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/fullselect_ovr.gif Binary files differdeleted file mode 100644 index d1bb3ee64..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/fullselect_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/home_interf_ov.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/home_interf_ov.gif Binary files differdeleted file mode 100644 index 3cbfe780f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/home_interf_ov.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/key_interf_ov.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/key_interf_ov.gif Binary files differdeleted file mode 100644 index 307044047..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/key_interf_ov.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/local_home_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/local_home_ovr.gif Binary files differdeleted file mode 100644 index d7827341f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/local_home_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/local_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/local_ovr.gif Binary files differdeleted file mode 100644 index 43e165576..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/local_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/optimistic_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/optimistic_ovr.gif Binary files differdeleted file mode 100644 index f7c71fb2f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/optimistic_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/remote_interf_ov.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/remote_interf_ov.gif Binary files differdeleted file mode 100644 index 19c9cae05..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/remote_interf_ov.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/securityrole_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/securityrole_ovr.gif Binary files differdeleted file mode 100644 index 2b61ab3a1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/securityrole_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_config_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_config_ovr.gif Binary files differdeleted file mode 100644 index d041bd028..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_config_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_inst_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_inst_ovr.gif Binary files differdeleted file mode 100644 index e8c91ac81..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_inst_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_ovr.gif Binary files differdeleted file mode 100644 index b5e8b3f9b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/server_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/user_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/user_ovr.gif Binary files differdeleted file mode 100644 index b8797f34f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/user_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/web_module_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/web_module_ovr.gif Binary files differdeleted file mode 100644 index c1e96177a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/web_module_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/whereclause_ovr.GIF b/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/whereclause_ovr.GIF Binary files differdeleted file mode 100644 index 987b661fb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/ovr16/whereclause_ovr.GIF +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/1x_cmpbean_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/1x_cmpbean_palette_obj.gif Binary files differdeleted file mode 100644 index 99e75dd40..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/1x_cmpbean_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/2x_cmpbean_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/2x_cmpbean_palette_obj.gif Binary files differdeleted file mode 100644 index b81d5ef9f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/2x_cmpbean_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/bmpEntity_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/bmpEntity_palette_obj.gif Binary files differdeleted file mode 100644 index 595d7e8da..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/bmpEntity_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/ejb_rdbmapping_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/ejb_rdbmapping_palette_obj.gif Binary files differdeleted file mode 100644 index d4f0b47bd..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/ejb_rdbmapping_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/ejb_reference_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/ejb_reference_palette_obj.gif Binary files differdeleted file mode 100644 index 6052360ee..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/ejb_reference_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/inherelejb_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/inherelejb_palette_obj.gif Binary files differdeleted file mode 100644 index 8c2ca928f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/inherelejb_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/message_bean_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/message_bean_palette_obj.gif Binary files differdeleted file mode 100644 index 804fabd04..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/message_bean_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/relationship_role_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/relationship_role_palette_obj.gif Binary files differdeleted file mode 100644 index ef7a20c72..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/relationship_role_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/sessionBean_palette_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/pal24/sessionBean_palette_obj.gif Binary files differdeleted file mode 100644 index 1400d5e7c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/pal24/sessionBean_palette_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_cmpbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_cmpbean_wiz.gif Binary files differdeleted file mode 100644 index 5999ae8b2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_cmpbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_ejb_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_ejb_wiz.gif Binary files differdeleted file mode 100644 index a92a7a938..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_ejb_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 561a70bfc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/11_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/12_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/12_ear_wiz.gif Binary files differdeleted file mode 100644 index 1cb420fe9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/12_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/13_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/13_ear_wiz.gif Binary files differdeleted file mode 100644 index 78fe9f19e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/13_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_cmpbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_cmpbean_wiz.gif Binary files differdeleted file mode 100644 index f2396419a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_cmpbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_ejb_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_ejb_wiz.gif Binary files differdeleted file mode 100644 index 973509301..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_ejb_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index f7b2b9dc1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/20_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/Serviceref_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/Serviceref_wiz.gif Binary files differdeleted file mode 100644 index 3d8bca824..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/Serviceref_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/access_intent_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/access_intent_wiz.gif Binary files differdeleted file mode 100644 index 56ed87065..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/access_intent_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/accessbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/accessbean_wiz.gif Binary files differdeleted file mode 100644 index c2cfbc707..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/accessbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/add_mess_dest_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/add_mess_dest_wiz_ban.gif Binary files differdeleted file mode 100644 index f9941cec6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/add_mess_dest_wiz_ban.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_export_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_export_wiz.gif Binary files differdeleted file mode 100644 index f0ef22af2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_export_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_import_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_import_wiz.gif Binary files differdeleted file mode 100644 index e5900ab9d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_import_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_wiz.gif Binary files differdeleted file mode 100644 index 860fcec4c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/appclient_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/attribute_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/attribute_wiz.gif Binary files differdeleted file mode 100644 index 8a70e59bc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/attribute_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/beanselection_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/beanselection_wiz.gif Binary files differdeleted file mode 100644 index a7e02b9f2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/beanselection_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/bmp_bean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/bmp_bean_wiz.gif Binary files differdeleted file mode 100644 index a07867dcb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/bmp_bean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/cmp_bean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/cmp_bean_wiz.gif Binary files differdeleted file mode 100644 index d709d1cf8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/cmp_bean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/del_clientview_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/del_clientview_wiz.gif Binary files differdeleted file mode 100644 index 5a282f746..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/del_clientview_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ear_wiz.gif Binary files differdeleted file mode 100644 index 1a8b12752..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/earimport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/earimport_wiz.gif Binary files differdeleted file mode 100644 index 2b9447f3f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/earimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/earpub_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/earpub_wiz.gif Binary files differdeleted file mode 100644 index d93b329b2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/earpub_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_module_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_module_wiz.gif Binary files differdeleted file mode 100644 index aab29948f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_module_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_ref_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_ref_wiz.gif Binary files differdeleted file mode 100644 index dc55d2af0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_ref_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_utility_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_utility_wiz.gif Binary files differdeleted file mode 100644 index 58f927b8c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_utility_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_wiz.gif Binary files differdeleted file mode 100644 index fe5e26820..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejb_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbbinding_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbbinding_wiz.gif Binary files differdeleted file mode 100644 index 8dee6c065..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbbinding_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbclientjar_wizban.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbclientjar_wizban.gif Binary files differdeleted file mode 100644 index 231da6174..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbclientjar_wizban.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbcomposerbanner_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbcomposerbanner_wiz.gif Binary files differdeleted file mode 100644 index 34324ffa3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbcomposerbanner_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbexample_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbexample_wiz.gif Binary files differdeleted file mode 100644 index 53bcb2e9b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbexample_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbexport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbexport_wiz.gif Binary files differdeleted file mode 100644 index 4ca8448ad..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbexport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbimport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbimport_wiz.gif Binary files differdeleted file mode 100644 index d123519da..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 13941e3bf..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbproject_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbproject_wiz.gif Binary files differdeleted file mode 100644 index 7f2aa1e05..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbproject_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbql_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbql_wiz.gif Binary files differdeleted file mode 100644 index 0ea27cae5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbql_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbrdbmapping_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbrdbmapping_wiz.gif Binary files differdeleted file mode 100644 index d8dbc32c5..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/ejbrdbmapping_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/env_ref_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/env_ref_wiz.gif Binary files differdeleted file mode 100644 index e50f828be..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/env_ref_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/env_variable_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/env_variable_wiz.gif Binary files differdeleted file mode 100644 index 2918928d1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/env_variable_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_appclient_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_appclient_wiz.gif Binary files differdeleted file mode 100644 index 532a40efb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_appclient_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_ear_wiz.gif Binary files differdeleted file mode 100644 index f56f9e0fa..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_ejbjar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_ejbjar_obj.gif Binary files differdeleted file mode 100644 index da3116862..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_ejbjar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_rar_wiz.gif Binary files differdeleted file mode 100644 index 6047f1adc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_rar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_war_wiz.gif Binary files differdeleted file mode 100644 index 649eacd5f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/export_war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_appclient_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_appclient_wiz.gif Binary files differdeleted file mode 100644 index 34418d941..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_appclient_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_class_file_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_class_file_wiz_ban.gif Binary files differdeleted file mode 100644 index 81b1e3f61..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_class_file_wiz_ban.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_ear_wiz.gif Binary files differdeleted file mode 100644 index 9da81ce37..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_ejbjar_wiz.gif Binary files differdeleted file mode 100644 index 786c86435..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_ejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_rar_wiz.gif Binary files differdeleted file mode 100644 index ea9dff4f6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_rar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_war_wiz.gif Binary files differdeleted file mode 100644 index 514274d38..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/import_war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/inheritance_hierarchy_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/inheritance_hierarchy_wiz.gif Binary files differdeleted file mode 100644 index 305d22e0a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/inheritance_hierarchy_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/isolationlevel_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/isolationlevel_wiz.gif Binary files differdeleted file mode 100644 index 64c541619..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/isolationlevel_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/javaprj_to_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/javaprj_to_ear_wiz.gif Binary files differdeleted file mode 100644 index 01e38ccbd..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/javaprj_to_ear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/javavisualeditor_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/javavisualeditor_wiz.gif Binary files differdeleted file mode 100644 index 2d51013d9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/javavisualeditor_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/local_ejb_ref_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/local_ejb_ref_wiz.gif Binary files differdeleted file mode 100644 index 34f12faba..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/local_ejb_ref_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/message_bean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/message_bean_wiz.gif Binary files differdeleted file mode 100644 index ad25134a1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/message_bean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/messdestref_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/messdestref_wiz.gif Binary files differdeleted file mode 100644 index b7067480a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/messdestref_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/method_permission_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/method_permission_wiz.gif Binary files differdeleted file mode 100644 index caa95c9be..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/method_permission_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/method_transaction_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/method_transaction_wiz.gif Binary files differdeleted file mode 100644 index f692e8334..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/method_transaction_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/new_appclientproject_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/new_appclientproject_wiz.gif Binary files differdeleted file mode 100644 index c4d2fdeb6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/new_appclientproject_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/new_clientview_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/new_clientview_wiz.gif Binary files differdeleted file mode 100644 index e9dc4573e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/new_clientview_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newaccessbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newaccessbean_wiz.gif Binary files differdeleted file mode 100644 index b32f60402..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newaccessbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newappclientprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newappclientprj_wiz.gif Binary files differdeleted file mode 100644 index cf4f00751..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newappclientprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newconnectionprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newconnectionprj_wiz.gif Binary files differdeleted file mode 100644 index 231f8d3e7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newconnectionprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newear_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newear_wiz.gif Binary files differdeleted file mode 100644 index 465f7afea..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newear_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejb_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejb_wiz.gif Binary files differdeleted file mode 100644 index 8a69ebec0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejb_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbex_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbex_wiz.gif Binary files differdeleted file mode 100644 index 16447fba1..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbjar_wiz.gif Binary files differdeleted file mode 100644 index 79829c2b3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbjar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbprj_wiz.gif Binary files differdeleted file mode 100644 index b4b8b14af..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newejbprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newfilter_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newfilter_wiz.gif Binary files differdeleted file mode 100644 index f4b4d0839..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newfilter_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newlistener_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newlistener_wiz.gif Binary files differdeleted file mode 100644 index 1be71d591..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newlistener_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newservlet_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newservlet_wiz.gif Binary files differdeleted file mode 100644 index 147e57a52..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newservlet_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwar_wiz.gif Binary files differdeleted file mode 100644 index d964e2e56..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwebex_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwebex_wiz.gif Binary files differdeleted file mode 100644 index ff7c242bf..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwebex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwprj_wiz.gif Binary files differdeleted file mode 100644 index 72944e924..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/newwprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/preload_relationship_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/preload_relationship_wiz.gif Binary files differdeleted file mode 100644 index f757600d0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/preload_relationship_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/regenabn_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/regenabn_wiz.gif Binary files differdeleted file mode 100644 index b80914e02..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/regenabn_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/relationship_role_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/relationship_role_wiz.gif Binary files differdeleted file mode 100644 index 0f483808c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/relationship_role_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/replace_role_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/replace_role_wiz.gif Binary files differdeleted file mode 100644 index 2dc52d4eb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/replace_role_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/resource_ref_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/resource_ref_wiz.gif Binary files differdeleted file mode 100644 index 0d6323e77..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/resource_ref_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/secur_role_ref_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/secur_role_ref_wiz.gif Binary files differdeleted file mode 100644 index 42294884c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/secur_role_ref_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/secur_role_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/secur_role_wiz.gif Binary files differdeleted file mode 100644 index e05db64d3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/secur_role_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/security_identity_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/security_identity_wiz.gif Binary files differdeleted file mode 100644 index ee031726c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/security_identity_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/selectbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/selectbean_wiz.gif Binary files differdeleted file mode 100644 index 013845164..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/selectbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/session_bean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/session_bean_wiz.gif Binary files differdeleted file mode 100644 index dfa3648f3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/session_bean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/sql_query_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/sql_query_wiz.gif Binary files differdeleted file mode 100644 index 0a3ee60dc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/sql_query_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/tablemappingstrategy_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/tablemappingstrategy_wiz.gif Binary files differdeleted file mode 100644 index fad2d5976..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/tablemappingstrategy_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/user_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/user_wiz.gif Binary files differdeleted file mode 100644 index 7d771ef18..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/user_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/usergroup_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/usergroup_wiz.gif Binary files differdeleted file mode 100644 index 7e3c9291c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/usergroup_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/war_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/war_wiz.gif Binary files differdeleted file mode 100644 index 2d8c0479c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/war_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/warexport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/warexport_wiz.gif Binary files differdeleted file mode 100644 index d25124251..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/warexport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/warimport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/full/wizban/warimport_wiz.gif Binary files differdeleted file mode 100644 index 0bbebe947..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/full/wizban/warimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/getstart_a.GIF b/plugins/org.eclipse.jst.j2ee/icons/getstart_a.GIF Binary files differdeleted file mode 100644 index 6331e65e8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/getstart_a.GIF +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/initializ_parameter.gif b/plugins/org.eclipse.jst.j2ee/icons/initializ_parameter.gif Binary files differdeleted file mode 100644 index b902ea3ea..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/initializ_parameter.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/isolation_level_readcom_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/isolation_level_readcom_obj.gif Binary files differdeleted file mode 100644 index 71bfe6321..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/isolation_level_readcom_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/isolation_level_readuncom_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/isolation_level_readuncom_obj.gif Binary files differdeleted file mode 100644 index acfe4db46..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/isolation_level_readuncom_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/isolation_level_repread_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/isolation_level_repread_obj.gif Binary files differdeleted file mode 100644 index 9d489cf5a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/isolation_level_repread_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/isolation_level_serializ_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/isolation_level_serializ_obj.gif Binary files differdeleted file mode 100644 index d7db3f2de..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/isolation_level_serializ_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/jar_nonexist_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/jar_nonexist_obj.gif Binary files differdeleted file mode 100644 index 0c2ab2195..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/jar_nonexist_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/jar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/jar_obj.gif Binary files differdeleted file mode 100644 index ec315d5ff..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/jar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/java_prop.gif b/plugins/org.eclipse.jst.j2ee/icons/java_prop.gif Binary files differdeleted file mode 100644 index 49873f49e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/java_prop.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/key.gif b/plugins/org.eclipse.jst.j2ee/icons/key.gif Binary files differdeleted file mode 100644 index 03af38b6b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/key.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/message_bean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/message_bean_obj.gif Binary files differdeleted file mode 100644 index 03e422acb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/message_bean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/methElement_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/methElement_obj.gif Binary files differdeleted file mode 100644 index c3e27cdec..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/methElement_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/methPermission_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/methPermission_obj.gif Binary files differdeleted file mode 100644 index db55cc72d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/methPermission_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/methTransaction_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/methTransaction_obj.gif Binary files differdeleted file mode 100644 index c33f3b2c0..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/methTransaction_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/msgdrivenbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/msgdrivenbean_wiz.gif Binary files differdeleted file mode 100644 index 30eae5053..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/msgdrivenbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/newjprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/newjprj_wiz.gif Binary files differdeleted file mode 100644 index 6d137cd38..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/newjprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/componentscopedref.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/componentscopedref.gif Binary files differdeleted file mode 100644 index 120b02086..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/componentscopedref.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/handler.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/handler.gif Binary files differdeleted file mode 100644 index 1c8339c9f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/handler.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/localencodingmapping_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/localencodingmapping_obj.gif Binary files differdeleted file mode 100644 index 82555b91e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/localencodingmapping_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/messdestref_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/messdestref_obj.gif Binary files differdeleted file mode 100644 index c6830d00f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/messdestref_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/portcomponent.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/portcomponent.gif Binary files differdeleted file mode 100644 index b930e2d09..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/portcomponent.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/qname.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/qname.gif Binary files differdeleted file mode 100644 index 904159880..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/qname.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/serviceref.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/serviceref.gif Binary files differdeleted file mode 100644 index 670c5c92e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/serviceref.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/serviceref_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/serviceref_obj.gif Binary files differdeleted file mode 100644 index 2efd1a59f..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/serviceref_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/obj16/webservicedesc.gif b/plugins/org.eclipse.jst.j2ee/icons/obj16/webservicedesc.gif Binary files differdeleted file mode 100644 index 8fb844f5b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/obj16/webservicedesc.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/primaryKey_active_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/primaryKey_active_obj.gif Binary files differdeleted file mode 100644 index 7bb71d2ba..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/primaryKey_active_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/primaryKey_inactive_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/primaryKey_inactive_obj.gif Binary files differdeleted file mode 100644 index ebac134d2..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/primaryKey_inactive_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/rdaheadhint_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/rdaheadhint_obj.gif Binary files differdeleted file mode 100644 index 3ec246234..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/rdaheadhint_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/resourceRef_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/resourceRef_obj.gif Binary files differdeleted file mode 100644 index f84a67a35..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/resourceRef_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/role.gif b/plugins/org.eclipse.jst.j2ee/icons/role.gif Binary files differdeleted file mode 100644 index 6edba7b3e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/role.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/roleKey_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/roleKey_obj.gif Binary files differdeleted file mode 100644 index 274a850e4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/roleKey_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/role_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/role_obj.gif Binary files differdeleted file mode 100644 index b8c76f74a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/role_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/roleid_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/roleid_obj.gif Binary files differdeleted file mode 100644 index b68316272..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/roleid_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/serverPaused_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/serverPaused_obj.gif Binary files differdeleted file mode 100644 index dbfcf55dc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/serverPaused_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/sessionBean_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/sessionBean_obj.gif Binary files differdeleted file mode 100644 index 507b8a82e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/sessionBean_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/sessionbean_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/sessionbean_wiz.gif Binary files differdeleted file mode 100644 index b9a8d7124..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/sessionbean_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/warBinding_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/warBinding_obj.gif Binary files differdeleted file mode 100644 index cb71fc651..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/warBinding_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/warExtension_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/warExtension_obj.gif Binary files differdeleted file mode 100644 index 9fe7971be..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/warExtension_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/warFile_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/warFile_obj.gif Binary files differdeleted file mode 100644 index 31ecb7aee..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/warFile_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/warn_tsk.gif b/plugins/org.eclipse.jst.j2ee/icons/warn_tsk.gif Binary files differdeleted file mode 100644 index e2b751dff..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/warn_tsk.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/warning_co.gif b/plugins/org.eclipse.jst.j2ee/icons/warning_co.gif Binary files differdeleted file mode 100644 index ee2dac4a9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/warning_co.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/web_application.gif b/plugins/org.eclipse.jst.j2ee/icons/web_application.gif Binary files differdeleted file mode 100644 index 09f609d6c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/web_application.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/ArrowDown.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/ArrowDown.gif Binary files differdeleted file mode 100644 index 91e708f7c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/ArrowDown.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/ArrowUp.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/ArrowUp.gif Binary files differdeleted file mode 100644 index 906051150..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/ArrowUp.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/add_column.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/add_column.gif Binary files differdeleted file mode 100644 index 256e5a0a3..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/add_column.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/connection.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/connection.gif Binary files differdeleted file mode 100644 index e8efe69dc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/connection.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/convertlinks_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/convertlinks_wiz.gif Binary files differdeleted file mode 100644 index 3d75cb53a..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/convertlinks_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/default.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/default.gif Binary files differdeleted file mode 100644 index 52bac3646..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/default.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/exportftp_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/exportftp_wiz.gif Binary files differdeleted file mode 100644 index fc66e9ea7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/exportftp_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/exportwar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/exportwar_wiz.gif Binary files differdeleted file mode 100644 index ced859dd4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/exportwar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importftp_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importftp_wiz.gif Binary files differdeleted file mode 100644 index 400e049ed..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importftp_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importhttp_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importhttp_wiz.gif Binary files differdeleted file mode 100644 index 41768717c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importhttp_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importwar_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importwar_wiz.gif Binary files differdeleted file mode 100644 index 432c06679..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/importwar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/method.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/method.gif Binary files differdeleted file mode 100644 index e33651358..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/method.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/methodreturn.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/methodreturn.gif Binary files differdeleted file mode 100644 index 268ae7afc..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/methodreturn.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/newwebex_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/newwebex_wiz.gif Binary files differdeleted file mode 100644 index 43e86dbfd..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/newwebex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/newwebprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/newwebprj_wiz.gif Binary files differdeleted file mode 100644 index 8956b3d1c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/newwebprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/warFile_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/warFile_obj.gif Binary files differdeleted file mode 100644 index 31ecb7aee..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/warFile_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/web_application.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/web_application.gif Binary files differdeleted file mode 100644 index d2a041b39..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/web_application.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/web_ovr.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/web_ovr.gif Binary files differdeleted file mode 100644 index e0dd2d85c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/ctool16/web_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/linksview16/mailto_view.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/linksview16/mailto_view.gif Binary files differdeleted file mode 100644 index 23f12fa33..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/linksview16/mailto_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/ascii.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/ascii.gif Binary files differdeleted file mode 100644 index ef3028807..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/ascii.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/binary.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/binary.gif Binary files differdeleted file mode 100644 index 17633ae45..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/binary.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/environment_entity.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/environment_entity.gif Binary files differdeleted file mode 100644 index bf043f959..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/environment_entity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/java_properties.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/java_properties.gif Binary files differdeleted file mode 100644 index 49873f49e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/java_properties.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/method_return.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/method_return.gif Binary files differdeleted file mode 100644 index d528595b4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/method_return.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/projlib_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/projlib_obj.gif Binary files differdeleted file mode 100644 index 6912defa4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/projlib_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/servlet.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/servlet.gif Binary files differdeleted file mode 100644 index fc1bece72..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/obj16/servlet.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/sample16/folder.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/sample16/folder.gif Binary files differdeleted file mode 100644 index c91b26723..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/sample16/folder.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/thumbnail16/defaultFile.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/thumbnail16/defaultFile.gif Binary files differdeleted file mode 100644 index ef3028807..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/thumbnail16/defaultFile.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/thumbnail16/defaultFolder.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/thumbnail16/defaultFolder.gif Binary files differdeleted file mode 100644 index c91b26723..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/thumbnail16/defaultFolder.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/colourpal_view.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/colourpal_view.gif Binary files differdeleted file mode 100644 index 5a04dae01..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/colourpal_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/gallery_view.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/gallery_view.gif Binary files differdeleted file mode 100644 index 9f779e421..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/gallery_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/links_view.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/links_view.gif Binary files differdeleted file mode 100644 index 5fd9c9494..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/links_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/sample.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/sample.gif Binary files differdeleted file mode 100644 index bda81f7da..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/sample.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/thumbnail_view.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/thumbnail_view.gif Binary files differdeleted file mode 100644 index ababbcafe..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/view16/thumbnail_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/ftpimport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/ftpimport_wiz.gif Binary files differdeleted file mode 100644 index 56c8c3bb9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/ftpimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/ftppub_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/ftppub_wiz.gif Binary files differdeleted file mode 100644 index efb2bd4ec..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/ftppub_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/httpimport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/httpimport_wiz.gif Binary files differdeleted file mode 100644 index 71c8182d7..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/httpimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/newwebex_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/newwebex_wiz.gif Binary files differdeleted file mode 100644 index ff7c242bf..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/newwebex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/newwprj_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/newwprj_wiz.gif Binary files differdeleted file mode 100644 index 72944e924..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/newwprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/warexport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/warexport_wiz.gif Binary files differdeleted file mode 100644 index d25124251..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/warexport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/warimport_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/warimport_wiz.gif Binary files differdeleted file mode 100644 index 0bbebe947..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webtoolsicons/full/wizban/warimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/11_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/11_ejb_obj.gif Binary files differdeleted file mode 100644 index 445aa374e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/11_ejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/11_ejbjar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/11_ejbjar_obj.gif Binary files differdeleted file mode 100644 index f34adc945..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/11_ejbjar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/20_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/20_ejb_obj.gif Binary files differdeleted file mode 100644 index 7dbebc448..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/20_ejb_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/20_ejbjar_obj.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/20_ejbjar_obj.gif Binary files differdeleted file mode 100644 index 6b594c96e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/20_ejbjar_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/ServletCreateInitParam.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/ServletCreateInitParam.gif Binary files differdeleted file mode 100644 index e12289b3c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/ServletCreateInitParam.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/WebAppCreateContextParam.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/WebAppCreateContextParam.gif Binary files differdeleted file mode 100644 index 8450a6f0e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/WebAppCreateContextParam.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/WebResourceCollectionCreateURLPatternType.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/WebResourceCollectionCreateURLPatternType.gif Binary files differdeleted file mode 100644 index 9f75eb094..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/WebResourceCollectionCreateURLPatternType.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/authority_constraint.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/authority_constraint.gif Binary files differdeleted file mode 100644 index 5b64c4d75..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/authority_constraint.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/create_child.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/create_child.gif Binary files differdeleted file mode 100644 index eb68f6376..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/create_child.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/error_page.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/error_page.gif Binary files differdeleted file mode 100644 index 811b21bbb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/error_page.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/errorcode_errorpage.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/errorcode_errorpage.gif Binary files differdeleted file mode 100644 index 811b21bbb..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/errorcode_errorpage.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/exception_type_errorpage.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/exception_type_errorpage.gif Binary files differdeleted file mode 100644 index 184556359..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/exception_type_errorpage.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/filter.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/filter.gif Binary files differdeleted file mode 100644 index 0712d1ed9..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/filter.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/filter_mapping.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/filter_mapping.gif Binary files differdeleted file mode 100644 index 8f2e36ba6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/filter_mapping.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/form_login_config.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/form_login_config.gif Binary files differdeleted file mode 100644 index e3fcbb1e6..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/form_login_config.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/full/wizban/newservlet_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/full/wizban/newservlet_wiz.gif Binary files differdeleted file mode 100644 index 147e57a52..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/full/wizban/newservlet_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/http_type.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/http_type.gif Binary files differdeleted file mode 100644 index b26c71d2e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/http_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/initializ_parameter.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/initializ_parameter.gif Binary files differdeleted file mode 100644 index 162a57805..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/initializ_parameter.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/initializ_parameter_context.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/initializ_parameter_context.gif Binary files differdeleted file mode 100644 index 162a57805..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/initializ_parameter_context.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/jsp_library_reference.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/jsp_library_reference.gif Binary files differdeleted file mode 100644 index 997b50c69..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/jsp_library_reference.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/jsp_type.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/jsp_type.gif Binary files differdeleted file mode 100644 index 8a6367542..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/jsp_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/listener.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/listener.gif Binary files differdeleted file mode 100644 index 232047872..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/listener.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/mime_mapping.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/mime_mapping.gif Binary files differdeleted file mode 100644 index b64775883..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/mime_mapping.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/newservlet_wiz.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/newservlet_wiz.gif Binary files differdeleted file mode 100644 index f45eadca8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/newservlet_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/security_constraint.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/security_constraint.gif Binary files differdeleted file mode 100644 index d155408e8..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/security_constraint.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/security_role_nametype.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/security_role_nametype.gif Binary files differdeleted file mode 100644 index e91320f56..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/security_role_nametype.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet.gif Binary files differdeleted file mode 100644 index fc1bece72..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet_mapping.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet_mapping.gif Binary files differdeleted file mode 100644 index c495ac8c4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet_mapping.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet_type.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet_type.gif Binary files differdeleted file mode 100644 index c4a9d210b..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/servlet_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/session_config.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/session_config.gif Binary files differdeleted file mode 100644 index 7b2c1f750..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/session_config.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/url_type.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/url_type.gif Binary files differdeleted file mode 100644 index b26c71d2e..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/url_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/user_data_constraint.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/user_data_constraint.gif Binary files differdeleted file mode 100644 index 25dc9c892..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/user_data_constraint.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_application.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_application.gif Binary files differdeleted file mode 100644 index 09f609d6c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_application.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_resource_collection.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_resource_collection.gif Binary files differdeleted file mode 100644 index acba7cb36..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_resource_collection.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_type.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_type.gif Binary files differdeleted file mode 100644 index 09f609d6c..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/web_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/webapp_12.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/webapp_12.gif Binary files differdeleted file mode 100644 index 7646c44a4..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/webapp_12.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/webapp_13.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/webapp_13.gif Binary files differdeleted file mode 100644 index fec24d632..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/webapp_13.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/welcome_file.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/welcome_file.gif Binary files differdeleted file mode 100644 index d7dab830d..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/welcome_file.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/welcome_list.gif b/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/welcome_list.gif Binary files differdeleted file mode 100644 index f4c713273..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/webuiIcons/welcome_list.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/icons/xml_image.gif b/plugins/org.eclipse.jst.j2ee/icons/xml_image.gif Binary files differdeleted file mode 100644 index 1496cba65..000000000 --- a/plugins/org.eclipse.jst.j2ee/icons/xml_image.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/EnterpriseArtifactEdit.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/EnterpriseArtifactEdit.java deleted file mode 100644 index e90bf472a..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/EnterpriseArtifactEdit.java +++ /dev/null @@ -1,359 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.componentcore; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jst.common.jdt.internal.integration.JavaArtifactEditModel; -import org.eclipse.jst.common.jdt.internal.integration.WorkingCopyManager; -import org.eclipse.jst.common.jdt.internal.integration.WorkingCopyProvider; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IModelProvider; -import org.eclipse.jst.j2ee.model.IModelProviderFactory; -import org.eclipse.jst.j2ee.model.IModelProviderListener; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel; -import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelListener; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -/** - * <p> - * EnterpriseArtifactEdit obtains a type-specific J2EE metamodel from the managed - * {@see org.eclipse.wst.common.modulecore.ArtifactEditModel}. The underlying EditModel maintains - * {@see org.eclipse.emf.ecore.resource.Resource}s, such as the J2EE deployment descriptor - * resource. The defined methods extract data or manipulate the contents of the underlying resource. - * </p> - * - * <p> - * This class is an abstract class, and clients are intended to subclass and own their - * implementation. - * </p> - */ -public abstract class EnterpriseArtifactEdit extends ArtifactEdit implements WorkingCopyProvider, IModelProvider, IModelProviderFactory { - - public static boolean SUPPORT_LEGACY_PROJECTS = true; - private ArtifactEdit writableEdit = null; - - /** - * - */ - protected EnterpriseArtifactEdit() { - super(); - } - - public EnterpriseArtifactEdit(IVirtualComponent aModule){ - super(aModule); - } - - - /** - * @param aHandle - * @param toAccessAsReadOnly - * @throws IllegalArgumentException - */ - public EnterpriseArtifactEdit(IProject aProject, boolean toAccessAsReadOnly) throws IllegalArgumentException { - super(aProject, toAccessAsReadOnly); - } - - /** - * @param aHandle - * @param toAccessAsReadOnly - * @throws IllegalArgumentException - */ - protected EnterpriseArtifactEdit(IProject aProject, boolean toAccessAsReadOnly, boolean forCreate, String projectType) throws IllegalArgumentException { - super(aProject, toAccessAsReadOnly, forCreate, projectType); - } - - /** - * <p> - * Creates an instance facade for the given {@see ArtifactEditModel}. - * </p> - * <p> - * Clients that use this constructor are required to release their access of the EditModel when - * finished. Calling {@see ArtifactEdit#dispose()}will not touch the supplied EditModel. - * </p> - * - * @param anArtifactEditModel - * A valid, properly-accessed EditModel - */ - public EnterpriseArtifactEdit(ArtifactEditModel model) { - super(model); - } - - /** - * <p> - * Creates an instance facade for the given {@see WorkbenchComponent}. - * </p> - * <p> - * Instances of EnterpriseArtifactEdit that are returned through this method must be - * {@see #dispose()}ed of when no longer in use. - * </p> - * <p> - * Note: This method is for internal use only. Clients should not call this method. - * </p> - * - * @param aNature - * A non-null {@see ModuleCoreNature} for an accessible project - * @param aModule - * A non-null {@see WorkbenchComponent} pointing to a module from the given - * {@see ModuleCoreNature} - */ - - protected EnterpriseArtifactEdit(ModuleCoreNature aNature, IVirtualComponent aModule, boolean toAccessAsReadOnly) { - super(aNature, aModule, toAccessAsReadOnly); - } - - /** - * <p> - * Retrieves J2EE version information from deployment descriptor resource. - * </p> - * - * @return An the J2EE Specification version of the underlying {@see WorkbenchComponent} - * - */ - public abstract int getJ2EEVersion(); - - /** - * <p> - * Retrieves a deployment descriptor resource from {@see ArtifactEditModel}using a defined URI. - * </p> - * - * @return The correct deployment descriptor resource for the underlying - * {@see WorkbenchComponent} - * - */ - public abstract Resource getDeploymentDescriptorResource(); - - /** - * <p> - * Obtains the root object from a deployment descriptor resource, the root object contains all - * other resource defined objects. Examples of a deployment descriptor root include: - * {@see org.eclipse.jst.j2ee.webapplication.WebApp}, - * {@see org.eclipse.jst.j2ee.application.Application}, and - * {@see org.eclipse.jst.j2ee.ejb.EJBJar} - * </p> - * <p> - * Subclasses may extend this method to perform their own deployment descriptor creataion/ - * retrieval. - * </p> - * - * @return An EMF metamodel object representing the J2EE deployment descriptor - * - */ - - public EObject getDeploymentDescriptorRoot() { - Resource res = getDeploymentDescriptorResource(); - if (!res.getContents().isEmpty()) - return (EObject) res.getContents().get(0); - return null; - } - - /** - * Returns a working copy managet - * - * @return - */ - - public WorkingCopyManager getWorkingCopyManager() { - if(isBinary()){ - throwAttemptedBinaryEditModelAccess(); - } - return ((JavaArtifactEditModel)getArtifactEditModel()).getWorkingCopyManager(); - } - - /** - * Returns the working copy remembered for the compilation unit. - * - * @param input - * ICompilationUnit - * @return the working copy of the compilation unit, or <code>null</code> if there is no - * remembered working copy for this compilation unit - */ - public ICompilationUnit getWorkingCopy(ICompilationUnit cu, boolean forNewCU) throws org.eclipse.core.runtime.CoreException { - if (isReadOnly()) - return null; - return getWorkingCopyManager().getWorkingCopy(cu, forNewCU); - } - protected boolean validProjectVersion(IProject project) { - - return EnterpriseArtifactEdit.SUPPORT_LEGACY_PROJECTS || primValidProjectVersion(project); - } -protected boolean primValidProjectVersion(IProject project) { - - // Return true if project is being created - if (!project.exists()) return true; - IFacetedProject facetedProject = null; - try { - facetedProject = ProjectFacetsManager.create(project); - } catch (CoreException e) { - // Do Nothing - } - if (facetedProject == null) - // Return true if project facet is being created - return true; - //return true for legacy projects, or use preference. - return !J2EEProjectUtilities.isJEEProject(project); - } - - /** - * Returns the working copy remembered for the compilation unit encoded in the given editor - * input. Does not connect the edit model to the working copy. - * - * @param input - * ICompilationUnit - * @return the working copy of the compilation unit, or <code>null</code> if the input does - * not encode an editor input, or if there is no remembered working copy for this - * compilation unit - */ - public ICompilationUnit getExistingWorkingCopy(ICompilationUnit cu) throws org.eclipse.core.runtime.CoreException { - return getWorkingCopyManager().getExistingWorkingCopy(cu); - } - - public URI getModuleLocation(String moduleName) { - if (getProject()!=null) - return ModuleURIUtil.fullyQualifyURI(getProject()); - return null; - } - - /** - * This will delete - * - * @cu from the workbench and fix the internal references for this working copy manager. - */ - public void delete(org.eclipse.jdt.core.ICompilationUnit cu, org.eclipse.core.runtime.IProgressMonitor monitor) { - getWorkingCopyManager().delete(cu, monitor); - } - - /** - * <p> - * Create an deployment descriptor resource if one does not get and return it. Subclasses should - * overwrite this method to create their own type of deployment descriptor - * </p> - * - * @return an EObject - */ - - public abstract EObject createModelRoot(); - - /** - * <p> - * Create an deployment descriptor resource if one does not get and return it. Subclasses should - * overwrite this method to create their own type of deployment descriptor - * </p> - * - * @param int - * version of the component - * @return an EObject - */ - - public abstract EObject createModelRoot(int version); - - public Archive asArchive(boolean includeSource) throws OpenFailureException{ - return asArchive(includeSource, true); - } - - public Archive asArchive(boolean includeSource, boolean includeClasspathComponents) throws OpenFailureException { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.model.IModelProvider#getModelObject() - */ - public Object getModelObject() { - if ( getWritableEdit() != null) - return getWritableEdit().getContentModelRoot(); - return getContentModelRoot(); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.model.IModelProvider#getModelObject(org.eclipse.core.runtime.IPath) - */ - public Object getModelObject(IPath modelPath) { - if ( getWritableEdit() != null) { - Resource res = ((ArtifactEditModel)getWritableEdit().getAdapter(ArtifactEditModel.ADAPTER_TYPE)).getResource(URI.createURI(modelPath.toString())); - if (res != null && !res.getContents().isEmpty()) - return res.getContents().get(0); - else return null; - } - return getContentModelRoot(); - } - - public IModelProvider create(IProject project) { - return (IModelProvider)getArtifactEditForRead(project); - } - - public IModelProvider create(IVirtualComponent component) { - return (IModelProvider)getArtifactEditForRead(component); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.model.IModelProvider#modify(java.lang.Runnable, org.eclipse.core.runtime.IPath) - */ - public void modify(Runnable runnable, IPath modelPath) { - //About to modify and save this model - - // access model (write count) - // cache writable model (setWriteableEdit()) - // run runnable - // save model - // release access count - // null Writable Edit - - } - - public IStatus validateEdit(IPath modelPath, Object context) { - // ArtifactEdit will validate all files it manages, and uses its own context mechanism - return validateEdit(); - } - - /** - * @param writableEdit the writableEdit to set - */ - protected void setWritableEdit(ArtifactEdit writableEdit) { - this.writableEdit = writableEdit; - } - - /** - * @return the writableEdit - */ - protected ArtifactEdit getWritableEdit() { - return writableEdit; - } - - public void addListener(IModelProviderListener listener) - { - if (listener instanceof EditModelListener) - { - addListener((EditModelListener)listener); - } - } - - public void removeListener(IModelProviderListener listener) - { - if (listener instanceof EditModelListener) - { - removeListener((EditModelListener)listener); - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualArchiveComponent.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualArchiveComponent.java deleted file mode 100644 index 5406b10bd..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualArchiveComponent.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.componentcore; - -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.internal.componentcore.EnterpriseBinaryComponentHelper; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - -public class J2EEModuleVirtualArchiveComponent extends VirtualArchiveComponent { - - private static final IVirtualReference[] NO_REFERENCES = new VirtualReference[0]; - - protected String[] manifestClasspath; - - public J2EEModuleVirtualArchiveComponent(IProject aComponentProject, String archiveLocation, IPath aRuntimePath) { - super(aComponentProject, archiveLocation, aRuntimePath); - } - - public IVirtualReference[] getReferences() { - List dynamicReferences = J2EEModuleVirtualComponent.getManifestReferences(this, null); - if (null == dynamicReferences) { - return NO_REFERENCES; - } - return (IVirtualReference[]) dynamicReferences.toArray(new IVirtualReference[dynamicReferences.size()]); - } - - public String[] getManifestClasspath() { - if (null == manifestClasspath) { - Archive archive = EnterpriseBinaryComponentHelper.ArchiveCache.getInstance().getArchive(this); - if (null == archive) { - EnterpriseBinaryComponentHelper helper = EnterpriseBinaryComponentHelper.getHelper(this); - try { - archive = helper.accessArchive(); - ArchiveManifest manifest = archive.getManifest(); - manifestClasspath = manifest.getClassPathTokenized(); - } catch (Exception e) { - } finally { - if (null != archive) { - archive.close(); - } - if (null != helper) { - helper.dispose(); - } - } - } else { - ArchiveManifest manifest = archive.getManifest(); - manifestClasspath = manifest.getClassPathTokenized(); - } - - if (manifestClasspath == null) { - manifestClasspath = new String[0]; - } - } - return manifestClasspath; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.java deleted file mode 100644 index a90708a77..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.java +++ /dev/null @@ -1,311 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.componentcore; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathAttribute; -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.jst.j2ee.classpathdep.ClasspathDependencyUtil; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder; -import org.eclipse.wst.common.componentcore.internal.util.IComponentImplFactory; -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.componentcore.resources.IVirtualReference; - -public class J2EEModuleVirtualComponent extends VirtualComponent implements IComponentImplFactory { - - public J2EEModuleVirtualComponent() { - super(); - } - - public J2EEModuleVirtualComponent(IProject aProject, IPath aRuntimePath) { - super(aProject, aRuntimePath); - } - - public IVirtualComponent createComponent(IProject aProject) { - return new J2EEModuleVirtualComponent(aProject, new Path("/")); //$NON-NLS-1$ - } - - public IVirtualComponent createArchiveComponent(IProject aProject, String archiveLocation, IPath aRuntimePath) { - return new J2EEModuleVirtualArchiveComponent(aProject, archiveLocation, aRuntimePath); - } - - public IVirtualFolder createFolder(IProject aProject, IPath aRuntimePath) { - return new VirtualFolder(aProject, aRuntimePath); - } - - /** - * Retrieves all references except those computed dynamically from - * tagged Java classpath entries. - * @return IVirtualReferences for all non-Java classpath entry references. - */ - public IVirtualReference[] getNonJavaReferences() { - return getReferences(false); - } - - public IVirtualReference[] getReferences() { - return getReferences(true); - } - - private IVirtualReference[] getReferences(final boolean getJavaRefs) { - IVirtualReference[] hardReferences = getNonManifestReferences(getJavaRefs); - - // retrieve the dynamic references specified via the MANIFEST.MF classpath - List dynamicReferences = J2EEModuleVirtualComponent.getManifestReferences(this, hardReferences); - - IVirtualReference[] references = null; - if (dynamicReferences == null) { - references = hardReferences; - } else { - references = new IVirtualReference[hardReferences.length + dynamicReferences.size()]; - System.arraycopy(hardReferences, 0, references, 0, hardReferences.length); - for (int i = 0; i < dynamicReferences.size(); i++) { - references[hardReferences.length + i] = (IVirtualReference) dynamicReferences.get(i); - } - } - return references; - } - - public IVirtualReference[] getNonManifestReferences() { - return getNonManifestReferences(true); - } - - public IVirtualReference[] getNonManifestReferences(final boolean getJavaRefs) { - final List allRefs = new ArrayList(); - - // add component file references - IVirtualReference[] hardReferences = super.getReferences(); - for (int i = 0; i < hardReferences.length; i++) { - allRefs.add(hardReferences[i]); - } - - // add the dynamic references specified via specially tagged JDT classpath entries - if (getJavaRefs) { - IVirtualReference[] cpRefs = getJavaClasspathReferences(hardReferences); - for (int i = 0; i < cpRefs.length; i++) { - allRefs.add(cpRefs[i]); - } - } - - return (IVirtualReference[]) allRefs.toArray(new IVirtualReference[allRefs.size()]); - } - - public static String [] getManifestClasspath(IVirtualComponent moduleComponent) { - String[] manifestClasspath = null; - if(!moduleComponent.isBinary()){ - IVirtualFile vManifest = moduleComponent.getRootFolder().getFile(J2EEConstants.MANIFEST_URI); - if (vManifest.exists()) { - IFile manifestFile = vManifest.getUnderlyingFile(); - InputStream in = null; - try { - in = manifestFile.getContents(); - ArchiveManifest manifest = new ArchiveManifestImpl(in); - manifestClasspath = manifest.getClassPathTokenized(); - } catch (IOException e) { - Logger.getLogger().logError(e); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } finally { - if (in != null) { - try { - in.close(); - in = null; - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - } - } - } else { - manifestClasspath = ((J2EEModuleVirtualArchiveComponent)moduleComponent).getManifestClasspath(); - } - - return manifestClasspath; - - } - - public IVirtualReference[] getJavaClasspathReferences() { - return getJavaClasspathReferences(null); - } - - private IVirtualReference[] getJavaClasspathReferences(IVirtualReference[] hardReferences) { - final IProject project = getProject(); - final List cpRefs = new ArrayList(); - final boolean isWebApp = J2EEProjectUtilities.isDynamicWebComponent(this); - - try { - if (project == null || !project.isAccessible() || !project.hasNature(JavaCore.NATURE_ID)) { - return new IVirtualReference[0]; - } - - final IJavaProject javaProject = JavaCore.create(project); - if (javaProject == null) { - return new IVirtualReference[0]; - } - - // retrieve all referenced classpath entries - final Map referencedEntries = ClasspathDependencyUtil.getComponentClasspathDependencies(javaProject, isWebApp); - - if (referencedEntries.isEmpty()) { - return new IVirtualReference[0]; - } - - if (hardReferences == null) { - // only compute this not set and if we have some cp dependencies - hardReferences = super.getReferences(); - } - final IPath[] hardRefPaths = new IPath[hardReferences.length]; - for (int j = 0; j < hardReferences.length; j++) { - final IVirtualComponent comp = hardReferences[j].getReferencedComponent(); - if (comp.isBinary()) { - final VirtualArchiveComponent archiveComp = (VirtualArchiveComponent) comp; - final File diskFile = archiveComp.getUnderlyingDiskFile(); - IPath diskPath = null; - if (diskFile.exists()) { - diskPath =new Path(diskFile.getAbsolutePath()); - } else { - final IFile iFile = archiveComp.getUnderlyingWorkbenchFile(); - diskPath = iFile.getFullPath(); - } - hardRefPaths[j] = diskPath; - } - } - - final Iterator i = referencedEntries.keySet().iterator(); - while (i.hasNext()) { - final IClasspathEntry entry = (IClasspathEntry) i.next(); - final IClasspathAttribute attrib = (IClasspathAttribute) referencedEntries.get(entry); - final IPath runtimePath = ClasspathDependencyUtil.getRuntimePath(attrib, isWebApp); - boolean add = true; - final IPath entryLocation = ClasspathDependencyUtil.getEntryLocation(entry); - if (entryLocation == null) { - // unable to retrieve location for cp entry, do not contribute as a virtual ref - add = false; - } else { - for (int j = 0; j < hardRefPaths.length; j++) { - if (entryLocation.equals(hardRefPaths[j])) { - // entry resolves to same file as existing hard reference, can skip - add = false; - break; - } - } - } - - if (add) { - final String componentPath = VirtualArchiveComponent.CLASSPATHARCHIVETYPE + IPath.SEPARATOR + entryLocation.toPortableString(); - final VirtualArchiveComponent entryComponent = (VirtualArchiveComponent) ComponentCore.createArchiveComponent(project, componentPath); - final IVirtualReference entryReference = ComponentCore.createReference(this, entryComponent, runtimePath); - entryReference.setArchiveName(ClasspathDependencyUtil.getArchiveName(entry)); - cpRefs.add(entryReference); - } - } - - } catch (CoreException jme) { - Logger.getLogger().logError(jme); - } - - return (IVirtualReference[]) cpRefs.toArray(new IVirtualReference[cpRefs.size()]); - } - - public static List getManifestReferences(IVirtualComponent moduleComponent, IVirtualReference[] hardReferences) { - List dynamicReferences = null; - String [] manifestClasspath = getManifestClasspath(moduleComponent); - - IVirtualReference foundRef = null; - String earArchiveURI = null; //The URI for this archive in the EAR - boolean simplePath = false; - - if (manifestClasspath != null && manifestClasspath.length > 0) { - IProject[] earProjects = J2EEProjectUtilities.getAllProjectsInWorkspaceOfType(J2EEProjectUtilities.ENTERPRISE_APPLICATION); - IVirtualReference[] earRefs = null; - for (int i = 0; i < earProjects.length && null == earRefs; i++) { - IVirtualComponent tempEARComponent = ComponentCore.createComponent(earProjects[i]); - IVirtualReference[] tempEarRefs = tempEARComponent.getReferences(); - for (int j = 0; j < tempEarRefs.length && earRefs == null; j++) { - if (tempEarRefs[j].getReferencedComponent().equals(moduleComponent)) { - earRefs = tempEarRefs; - foundRef = tempEarRefs[j]; - earArchiveURI = foundRef.getArchiveName(); - simplePath = earArchiveURI != null ? earArchiveURI.lastIndexOf("/") == -1 : true; //$NON-NLS-1$ - } - } - } - - if (null != earRefs) { - for (int i = 0; i < manifestClasspath.length; i++) { - boolean found = false; - for (int j = 0; j < earRefs.length && !found; j++) { - if(foundRef != earRefs[j]){ - String archiveName = earRefs[j].getArchiveName(); - if (null != archiveName){ - boolean shouldAdd = false; - if(simplePath && manifestClasspath[i].lastIndexOf("/") == -1){ //$NON-NLS-1$ - shouldAdd = archiveName.equals(manifestClasspath[i]); - } else { - String earRelativeURI = ArchiveUtil.deriveEARRelativeURI(manifestClasspath[i], earArchiveURI); - if(null != earRelativeURI){ - shouldAdd = earRelativeURI.equals(archiveName); - } - } - - if(shouldAdd){ - found = true; - boolean shouldInclude = true; - IVirtualComponent dynamicComponent = earRefs[j].getReferencedComponent(); - if(null != hardReferences){ - for (int k = 0; k < hardReferences.length && shouldInclude; k++) { - if (hardReferences[k].getReferencedComponent().equals(dynamicComponent)) { - shouldInclude = false; - } - } - } - if (shouldInclude) { - IVirtualReference dynamicReference = ComponentCore.createReference(moduleComponent, dynamicComponent); - if (null == dynamicReferences) { - dynamicReferences = new ArrayList(); - } - dynamicReferences.add(dynamicReference); - } - } - } - } - } - } - } - } - return dynamicReferences; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/AppClientBinaryComponentHelper.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/AppClientBinaryComponentHelper.java deleted file mode 100644 index fb8134c77..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/AppClientBinaryComponentHelper.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.componentcore; - -import java.io.IOException; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ApplicationClientFileImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.AppClient12ImportStrategyImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class AppClientBinaryComponentHelper extends EnterpriseBinaryComponentHelper { - - public static boolean handlesComponent(IVirtualComponent component) { - AppClientBinaryComponentHelper helper = null; - try { - helper = new AppClientBinaryComponentHelper(component); - return helper.isArchiveValid(); - } catch (Exception e) { - return false; - } finally { - helper.dispose(); - } - } - - protected static class Discriminator extends AppClient12ImportStrategyImpl.Discriminator { - - private static Discriminator instance; - - public static Discriminator getInstance() { - if (instance == null) { - instance = new Discriminator(); - } - return instance; - } - - public Archive createConvertedArchive() { - ReferenceCountedApplicationClientFileImpl archive = new ReferenceCountedApplicationClientFileImpl(); - return archive; - } - } - - protected static class ReferenceCountedApplicationClientFileImpl extends ApplicationClientFileImpl implements IReferenceCountedArchive { - - private int count = 0; - - public void access() { - synchronized (this) { - count++; - } - } - - public void close() { - synchronized (this) { - count--; - if (count > 0) { - return; - } - } - physicallyClose(this); - } - - public void forceClose(){ - count = 0; - super.close(); - } - - private EnterpriseBinaryComponentHelper helper = null; - - public EnterpriseBinaryComponentHelper getEnterpriseBinaryComponentHelper() { - return helper; - } - - public void setEnterpriseBinaryComponentHelper(EnterpriseBinaryComponentHelper helper) { - this.helper = helper; - } - - protected LoadStrategy createLoadStrategyForReopen(Archive parent) throws IOException { - try { - return createBinaryLoadStrategy(getEnterpriseBinaryComponentHelper()); - } catch (OpenFailureException e) { - throw new IOException(e.getMessage()); - } - } - - } - - protected ArchiveTypeDiscriminator getDiscriminator() { - return Discriminator.getInstance(); - } - - public AppClientBinaryComponentHelper(IVirtualComponent component) { - super(component); - } - - public EObject getPrimaryRootObject() { - return ((ApplicationClientFile) getArchive()).getDeploymentDescriptor(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/ComponentArchiveOptions.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/ComponentArchiveOptions.java deleted file mode 100644 index efa0a2ae4..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/ComponentArchiveOptions.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.componentcore; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class ComponentArchiveOptions extends ArchiveOptions { - - private IVirtualComponent component; - - public ComponentArchiveOptions(IVirtualComponent component){ - this.component = component; - } - - public IVirtualComponent getComponent() { - return component; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/EJBBinaryComponentHelper.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/EJBBinaryComponentHelper.java deleted file mode 100644 index 2a4885f93..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/EJBBinaryComponentHelper.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.componentcore; - -import java.io.IOException; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EJBJarFileImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.EjbJar11ImportStrategyImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class EJBBinaryComponentHelper extends EnterpriseBinaryComponentHelper { - - public static boolean handlesComponent(IVirtualComponent component) { - EJBBinaryComponentHelper helper = null; - try { - helper = new EJBBinaryComponentHelper(component); - return helper.isArchiveValid(); - } catch (Exception e) { - return false; - } finally { - helper.dispose(); - } - } - - protected static class Discriminator extends EjbJar11ImportStrategyImpl.Discriminator { - - private static Discriminator instance; - - public static Discriminator getInstance() { - if (instance == null) { - instance = new Discriminator(); - } - return instance; - } - - public Archive createConvertedArchive() { - ReferenceCountedEJBJarFileImpl archive = new ReferenceCountedEJBJarFileImpl(); - return archive; - } - } - - protected static class ReferenceCountedEJBJarFileImpl extends EJBJarFileImpl implements IReferenceCountedArchive { - - private int count = 0; - - public void access() { - synchronized (this) { - count++; - } - } - - public void close() { - synchronized (this) { - count--; - if (count > 0) { - return; - } - } - physicallyClose(this); - } - - public void forceClose(){ - count = 0; - super.close(); - } - - private EnterpriseBinaryComponentHelper helper = null; - - public EnterpriseBinaryComponentHelper getEnterpriseBinaryComponentHelper() { - return helper; - } - - public void setEnterpriseBinaryComponentHelper(EnterpriseBinaryComponentHelper helper) { - this.helper = helper; - } - - protected LoadStrategy createLoadStrategyForReopen(Archive parent) throws IOException { - try { - return createBinaryLoadStrategy(getEnterpriseBinaryComponentHelper()); - } catch (OpenFailureException e) { - throw new IOException(e.getMessage()); - } - } - } - - protected ArchiveTypeDiscriminator getDiscriminator() { - return Discriminator.getInstance(); - } - - public EJBBinaryComponentHelper(IVirtualComponent component) { - super(component); - } - - public EObject getPrimaryRootObject() { - return ((EJBJarFile) getArchive()).getDeploymentDescriptor(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/EnterpriseBinaryComponentHelper.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/EnterpriseBinaryComponentHelper.java deleted file mode 100644 index ca1a98bcf..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/EnterpriseBinaryComponentHelper.java +++ /dev/null @@ -1,382 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.componentcore; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipFileLoadStrategyImpl; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.internal.BinaryComponentHelper; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; - -public abstract class EnterpriseBinaryComponentHelper extends BinaryComponentHelper { - - public static EnterpriseBinaryComponentHelper getHelper(IVirtualComponent aComponent){ - EnterpriseBinaryComponentHelper helper = null; - if (J2EEProjectUtilities.isEJBComponent(aComponent)) { - helper = new EJBBinaryComponentHelper(aComponent); - } else if (J2EEProjectUtilities.isApplicationClientComponent(aComponent)) { - helper = new AppClientBinaryComponentHelper(aComponent); - } else if (J2EEProjectUtilities.isJCAComponent(aComponent)) { - helper = new JCABinaryComponentHelper(aComponent); - } else if (J2EEProjectUtilities.isDynamicWebComponent(aComponent)) { - helper = new WebBinaryComponentHelper(aComponent); - } else { - helper = new UtilityBinaryComponentHelper(aComponent); - } - return helper; - } - - private IReferenceCountedArchive archive = null; - - protected EnterpriseBinaryComponentHelper(IVirtualComponent component) { - super(component); - } - - protected ComponentArchiveOptions getArchiveOptions() { - ComponentArchiveOptions options = new ComponentArchiveOptions(getComponent()); - options.setIsReadOnly(true); - options.setRendererType(ArchiveOptions.SAX); - options.setUseJavaReflection(false); - return options; - } - - protected IReferenceCountedArchive getUniqueArchive() { - try { - return openArchive(); - } catch (OpenFailureException e) { - Logger.getLogger().logError(e); - } - return null; - } - - public Archive accessArchive() { - IReferenceCountedArchive archive = getArchive(); - archive.access(); - if(!isPhysicallyOpen(archive)){ - physicallyOpen(archive); - } - return archive; - } - - protected IReferenceCountedArchive getArchive() { - if (archive == null) { - archive = getUniqueArchive(); - } - return archive; - } - - protected boolean isArchiveValid() { - if (archive != null) { - return true; - } - Archive anArchive = null; - try { - anArchive = CommonarchiveFactory.eINSTANCE.primOpenArchive(getArchiveOptions(), getArchiveURI()); - ArchiveTypeDiscriminator disc = getDiscriminator(); - return null == disc || disc.canImport(anArchive); - } catch (Exception e) { - return false; - } finally { - if (anArchive != null) { - anArchive.close(); - } - } - } - - protected String getArchiveURI() { - String archiveURI = null; - VirtualArchiveComponent archiveComp = (VirtualArchiveComponent) getComponent(); - java.io.File diskFile = archiveComp.getUnderlyingDiskFile(); - if (diskFile.exists()) - archiveURI = diskFile.getAbsolutePath(); - else { - IFile iFile = archiveComp.getUnderlyingWorkbenchFile(); - archiveURI = iFile.getRawLocation().toOSString(); - } - return archiveURI; - } - - public void dispose() { - if (archive != null) { - archive.close(); - archive = null; - } - } - - protected abstract ArchiveTypeDiscriminator getDiscriminator(); - - protected IReferenceCountedArchive openArchive() throws OpenFailureException { - ArchiveCache cache = ArchiveCache.getInstance(); - IReferenceCountedArchive archive = cache.getArchive(getComponent()); - if (archive != null) { - archive.access(); - return archive; - } - return cache.openArchive(this); - } - - boolean gotResource = false; - - public Resource getResource(URI uri) { - Resource resource = null; - if(!isPhysicallyOpen(getArchive())){ - resource = getArchive().getResourceSet().getResource(uri, false); - if(resource == null){ - physicallyOpen(getArchive()); - } - } - if(resource == null){ - resource = getArchive().getResourceSet().getResource(uri, true); - } - - return resource; - } - - public void releaseAccess(ArtifactEdit edit) { - dispose(); - } - - private static void unloadArchive(IReferenceCountedArchive archive) { - WorkbenchResourceHelperBase.removeAndUnloadAll(archive.getResourceSet().getResources(), archive.getResourceSet()); - archive.getLoadStrategy().setResourceSet(null); - archive.setLoadStrategy(null); - } - - private static boolean isPhysicallyOpen(IReferenceCountedArchive archive) { - return ((BinaryZipFileLoadStrategy)archive.getLoadStrategy()).isPhysicallyOpen(); - } - - private static void physicallyOpen(IReferenceCountedArchive archive) { - try { - ((BinaryZipFileLoadStrategy)archive.getLoadStrategy()).physicallyOpen(); - } catch (ZipException e) { - Logger.getLogger().logError(e); - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - - protected static void physicallyClose(IReferenceCountedArchive archive) { - ((BinaryZipFileLoadStrategy)archive.getLoadStrategy()).physicallyClose(); - } - - private static class BinaryZipFileLoadStrategy extends ZipFileLoadStrategyImpl { - - private boolean physicallyOpen = true; - - public BinaryZipFileLoadStrategy() { - super(); - } - - public BinaryZipFileLoadStrategy(java.io.File file) throws IOException { - super(file); - } - - public boolean isPhysicallyOpen(){ - return physicallyOpen; - } - - public void physicallyOpen() throws ZipException, IOException{ - if(!isPhysicallyOpen()){ - physicallyOpen = true; - setZipFile(new ZipFile(file)); - } - } - - public void physicallyClose(){ - if(isPhysicallyOpen()){ - physicallyOpen = false; - try{ - zipFile.close(); - } - catch (Throwable t) { - //Ignore - } - } - } - - public InputStream getInputStream(String uri) throws IOException, FileNotFoundException { - final boolean isPhysciallyOpen = isPhysicallyOpen(); - Exception caughtException = null; - try { - if (!isPhysciallyOpen) { - physicallyOpen(); - } - ZipEntry entry = getZipFile().getEntry(uri); - if (entry == null) - throw new FileNotFoundException(uri); - - return new java.io.BufferedInputStream(getZipFile().getInputStream(entry)) { - public void close() throws IOException { - super.close(); - if (!isPhysciallyOpen ) { - physicallyClose(); - } - } - }; - } catch (FileNotFoundException e) { - caughtException = e; - throw e; - } catch (IllegalStateException zipClosed) { - caughtException = zipClosed; - throw new IOException(zipClosed.toString()); - } catch (Exception e) { - caughtException = e; - throw new IOException(e.toString()); - } finally { - if (caughtException != null) { - if (!isPhysciallyOpen) { - physicallyClose(); - } - } - } - } - }; - - public static class ArchiveCache { - - private static ArchiveCache instance = null; - - public static ArchiveCache getInstance() { - if (instance == null) { - instance = new ArchiveCache(); - } - return instance; - } - - protected Map componentsToArchives = new Hashtable(); - - public synchronized IReferenceCountedArchive getArchive(IVirtualComponent component) { - IReferenceCountedArchive archive = (IReferenceCountedArchive) componentsToArchives.get(component); - return archive; - } - - public synchronized void clearDisconnectedArchivesInEAR(IVirtualComponent earComponent) { - if (componentsToArchives.isEmpty()) { - return; - } - Set liveBinaryComponnts = new HashSet(); - IVirtualReference[] refs = earComponent.getReferences(); - IVirtualComponent component = null; - for (int i = 0; i < refs.length; i++) { - component = refs[i].getReferencedComponent(); - if (component.isBinary()) { - liveBinaryComponnts.add(component); - } - } - clearArchivesInProject(earComponent.getProject(), liveBinaryComponnts); - } - - public synchronized void clearAllArchivesInProject(IProject earProject) { - if (componentsToArchives.isEmpty()) { - return; - } - clearArchivesInProject(earProject, null); - } - - private void clearArchivesInProject(IProject earProject, Set excludeSet) { - Iterator iterator = componentsToArchives.entrySet().iterator(); - IVirtualComponent component = null; - IReferenceCountedArchive archive = null; - while (iterator.hasNext()) { - Map.Entry entry = (Map.Entry)iterator.next(); - component = (IVirtualComponent) entry.getKey(); - if (component.getProject().equals(earProject) && (excludeSet == null || !excludeSet.contains(component))) { - archive = (IReferenceCountedArchive) entry.getValue(); - archive.forceClose(); - unloadArchive(archive); - iterator.remove(); - } - } - } - - public synchronized IReferenceCountedArchive openArchive(EnterpriseBinaryComponentHelper helper) throws OpenFailureException { - ArchiveOptions options = helper.getArchiveOptions(); - String archiveURI = helper.getArchiveURI(); - - options.setLoadStrategy(createBinaryLoadStrategy(helper)); - - Archive anArchive = CommonarchiveFactory.eINSTANCE.primOpenArchive(options, archiveURI); - - ArchiveTypeDiscriminator discriminator = helper.getDiscriminator(); - - if (!discriminator.canImport(anArchive)) { - anArchive.close(); - throw new OpenFailureException(discriminator.getUnableToOpenMessage()); - } - IReferenceCountedArchive specificArchive = (IReferenceCountedArchive) discriminator.openArchive(anArchive); - specificArchive.setEnterpriseBinaryComponentHelper(helper); - specificArchive.initializeAfterOpen(); - specificArchive.access(); - componentsToArchives.put(helper.getComponent(), specificArchive); - return specificArchive; - } - } - - protected static BinaryZipFileLoadStrategy createBinaryLoadStrategy(EnterpriseBinaryComponentHelper helper) throws OpenFailureException { - String archiveURI = helper.getArchiveURI(); - String filename = archiveURI.replace('/', java.io.File.separatorChar); - java.io.File file = new java.io.File(filename); - if (!file.exists()) { - throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.file_not_found_EXC_, (new Object[] { archiveURI, file.getAbsolutePath() }))); - } - try { - BinaryZipFileLoadStrategy strategy = new BinaryZipFileLoadStrategy(file); - return strategy; - } catch (IOException ex) { - throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.could_not_open_EXC_, (new Object[] { archiveURI })), ex); - } - } - - protected interface IReferenceCountedArchive extends Archive { - - /** - * Increases the reference count by one. A call to close will decriment - * the count by one. If after decrimenting the count the count is 0 - * - */ - public void access(); - - public void forceClose(); - - public void setEnterpriseBinaryComponentHelper(EnterpriseBinaryComponentHelper helper); - - public EnterpriseBinaryComponentHelper getEnterpriseBinaryComponentHelper(); - - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/JCABinaryComponentHelper.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/JCABinaryComponentHelper.java deleted file mode 100644 index 2fa77d945..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/JCABinaryComponentHelper.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.componentcore; - -import java.io.IOException; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.RARFileImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.RarImportStrategyImpl; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class JCABinaryComponentHelper extends EnterpriseBinaryComponentHelper { - - public static boolean handlesComponent(IVirtualComponent component) { - JCABinaryComponentHelper helper = null; - try { - helper = new JCABinaryComponentHelper(component); - return helper.isArchiveValid(); - } catch (Exception e) { - return false; - } finally { - helper.dispose(); - } - } - - protected static class Discriminator extends RarImportStrategyImpl.Discriminator { - - private static Discriminator instance; - - public static Discriminator getInstance() { - if (instance == null) { - instance = new Discriminator(); - } - return instance; - } - - public Archive createConvertedArchive() { - ReferenceCountedRARFileImpl archive = new ReferenceCountedRARFileImpl(); - return archive; - } - } - - protected static class ReferenceCountedRARFileImpl extends RARFileImpl implements IReferenceCountedArchive { - - private int count = 0; - - public void access() { - synchronized (this) { - count++; - } - } - - public void close() { - synchronized (this) { - count--; - if (count > 0) { - return; - } - } - physicallyClose(this); - } - - public void forceClose(){ - count = 0; - super.close(); - } - - private EnterpriseBinaryComponentHelper helper = null; - - public EnterpriseBinaryComponentHelper getEnterpriseBinaryComponentHelper() { - return helper; - } - - public void setEnterpriseBinaryComponentHelper(EnterpriseBinaryComponentHelper helper) { - this.helper = helper; - } - - protected LoadStrategy createLoadStrategyForReopen(Archive parent) throws IOException { - try { - return createBinaryLoadStrategy(getEnterpriseBinaryComponentHelper()); - } catch (OpenFailureException e) { - throw new IOException(e.getMessage()); - } - } - } - - protected ArchiveTypeDiscriminator getDiscriminator() { - return Discriminator.getInstance(); - } - - public JCABinaryComponentHelper(IVirtualComponent component) { - super(component); - } - - public EObject getPrimaryRootObject() { - return ((RARFile) getArchive()).getDeploymentDescriptor(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/UtilityBinaryComponentHelper.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/UtilityBinaryComponentHelper.java deleted file mode 100644 index c7e8cf0da..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/UtilityBinaryComponentHelper.java +++ /dev/null @@ -1,120 +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.j2ee.internal.componentcore; - -import java.io.IOException; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class UtilityBinaryComponentHelper extends EnterpriseBinaryComponentHelper { - - public UtilityBinaryComponentHelper(IVirtualComponent component) { - super(component); - } - - protected static class Discriminator extends ArchiveTypeDiscriminatorImpl { - - private static Discriminator instance; - - public static Discriminator getInstance() { - if (instance == null) { - instance = new Discriminator(); - } - return instance; - } - - public Archive createConvertedArchive() { - ReferenceCountedArchiveImpl archive = new ReferenceCountedArchiveImpl(); - return archive; - } - - public boolean canImport(Archive anArchive) { - return true; - } - - public ImportStrategy createImportStrategy(Archive old, Archive newArchive) { - return null; - } - - public String getUnableToOpenMessage() { - return "";//$NON-NLS-1$ - } - } - - protected static class ReferenceCountedArchiveImpl extends ArchiveImpl implements IReferenceCountedArchive { - - private int count = 0; - - public void access() { - synchronized (this) { - count++; - } - } - - public void close() { - synchronized (this) { - count--; - if (count > 0) { - return; - } - } - physicallyClose(this); - } - - public void forceClose(){ - count = 0; - super.close(); - } - - private EnterpriseBinaryComponentHelper helper = null; - - public EnterpriseBinaryComponentHelper getEnterpriseBinaryComponentHelper() { - return helper; - } - - public void setEnterpriseBinaryComponentHelper(EnterpriseBinaryComponentHelper helper) { - this.helper = helper; - } - - protected LoadStrategy createLoadStrategyForReopen(Archive parent) throws IOException { - try { - return createBinaryLoadStrategy(getEnterpriseBinaryComponentHelper()); - } catch (OpenFailureException e) { - throw new IOException(e.getMessage()); - } - } - } - - protected ArchiveTypeDiscriminator getDiscriminator() { - return Discriminator.getInstance(); - } - - protected IReferenceCountedArchive getUniqueArchive() { - try { - return openArchive(); - } catch (OpenFailureException e) { - } - return null; - } - - public EObject getPrimaryRootObject() { - return null; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/WebBinaryComponentHelper.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/WebBinaryComponentHelper.java deleted file mode 100644 index 7802d3b54..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/WebBinaryComponentHelper.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.componentcore; - -import java.io.IOException; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.War22ImportStrategyImpl; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -public class WebBinaryComponentHelper extends EnterpriseBinaryComponentHelper { - - public static boolean handlesComponent(IVirtualComponent component) { - WebBinaryComponentHelper helper = null; - try { - helper = new WebBinaryComponentHelper(component); - return helper.isArchiveValid(); - } catch (Exception e) { - return false; - } finally { - helper.dispose(); - } - } - - protected static class Discriminator extends War22ImportStrategyImpl.Discriminator { - - private static Discriminator instance; - - public static Discriminator getInstance() { - if (instance == null) { - instance = new Discriminator(); - } - return instance; - } - - public Archive createConvertedArchive() { - ReferenceCountedWARFileImpl archive = new ReferenceCountedWARFileImpl(); - return archive; - } - } - - protected static class ReferenceCountedWARFileImpl extends WARFileImpl implements IReferenceCountedArchive { - - private int count = 0; - - public void access() { - synchronized (this) { - count++; - } - } - - public void close() { - synchronized (this) { - count--; - if (count > 0) { - return; - } - } - physicallyClose(this); - } - - public void forceClose(){ - count = 0; - super.close(); - } - - private EnterpriseBinaryComponentHelper helper = null; - - public EnterpriseBinaryComponentHelper getEnterpriseBinaryComponentHelper() { - return helper; - } - - public void setEnterpriseBinaryComponentHelper(EnterpriseBinaryComponentHelper helper) { - this.helper = helper; - } - - protected LoadStrategy createLoadStrategyForReopen(Archive parent) throws IOException { - try { - return createBinaryLoadStrategy(getEnterpriseBinaryComponentHelper()); - } catch (OpenFailureException e) { - throw new IOException(e.getMessage()); - } - } - } - - protected ArchiveTypeDiscriminator getDiscriminator() { - return Discriminator.getInstance(); - } - - public WebBinaryComponentHelper(IVirtualComponent component) { - super(component); - } - - public EObject getPrimaryRootObject() { - return ((WARFile) getArchive()).getDeploymentDescriptor(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/ClasspathDeleteInfo.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/ClasspathDeleteInfo.java deleted file mode 100644 index fbb8341f7..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/ClasspathDeleteInfo.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.internal.delete; - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; - -/** - * A simple structure that remembers for a given project, the manifest entries to be deleted and the - * build path entries to be deleted - */ -public class ClasspathDeleteInfo { - /** - * The project from which the dependencies will be removed - */ - protected IProject targetProject; - /** - * The literal manifest entries to be removed; String - */ - protected List manifestEntries; - /** - * The project references to be removed from the build path; IProject - */ - protected List referencedProjects; - - public ClasspathDeleteInfo(IProject project) { - super(); - targetProject = project; - } - - /** - * Gets the manifestEntries. - * - * @return Returns a List - */ - public List getManifestEntries() { - if (manifestEntries == null) - manifestEntries = new ArrayList(); - return manifestEntries; - } - - - /** - * Gets the referencedProjects. - * - * @return Returns a List - */ - public List getReferencedProjects() { - if (referencedProjects == null) - referencedProjects = new ArrayList(); - return referencedProjects; - } - - - /** - * Gets the targetProject. - * - * @return Returns a IProject - */ - public IProject getTargetProject() { - return targetProject; - } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/DeleteModuleOperation.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/DeleteModuleOperation.java deleted file mode 100644 index a09dd6281..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/DeleteModuleOperation.java +++ /dev/null @@ -1,258 +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.internal.delete; - - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * Do not use this. It will be deleted in 3.0 - * - * @deprecated - * - */ -public class DeleteModuleOperation { //extends WTPOperation { - - protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { - // TODO Auto-generated method stub - - } - -// protected DeleteOptions options; -// /* -// * key is an EAREditModel and the value is a list of delete commands. We cache the commands and -// * execute later because the modules still need to exist when we go to remove module dependency -// * references. -// */ -// protected Map deferredCommands; -// protected IProgressMonitor monitor; -// protected DeleteModuleDependencyOperation deleteModuleDependencyOperation; -// protected LooseComposedEditModel deleteEditModel; -// protected List dirtyEarModels; -// -// protected static String EDIT_MODEL_KEY = "DELETE_MODULES"; //$NON-NLS-1$ -// -// public DeleteModuleOperation(DeleteOptions options) { -// this.options = options; -// } -// -// /** -// * @see HeadlessJ2EEOperation#execute(IProgressMonitor) -// */ -// protected void execute(IProgressMonitor aMonitor) throws CoreException, InvocationTargetException, InterruptedException { -// this.monitor = aMonitor; -// try { -// buildDeleteCommandsIfNecessary(); -// if (options.shouldDeleteModuleDependencies()) { -// deleteModuleDependencies(); -// } -// checkIfEarsAreDirty(); -// executeDeferredCommands(); -// saveModelsIfNecessary(); -// } finally { -// releaseModels(); -// } -// -// } -// -// protected void checkIfEarsAreDirty() { -// dirtyEarModels = new ArrayList(); -// if (deferredCommands == null) -// return; -// Iterator models = deferredCommands.keySet().iterator(); -// while (models.hasNext()) { -// EAREditModel model = (EAREditModel) models.next(); -// if (model.isDirty() && !dirtyEarModels.contains(model)) { -// dirtyEarModels.add(model); -// } -// } -// } -// -// protected void buildDeleteCommandsIfNecessary() { -// if (deferredCommands != null && !deferredCommands.isEmpty()) -// return; -// deferredCommands = new HashMap(); -// List earProjects = EARNatureRuntime.getAllEARProjectsInWorkbench(); -// for (int i = 0; i < earProjects.size(); i++) { -// IProject p = (IProject) earProjects.get(i); -// if (options.getSelectedProjects().contains(p)) -// return; -// EARNatureRuntime runtime = EARNatureRuntime.getRuntime(p); -// if (runtime != null) -// buildDeleteCommands(runtime); -// } -// } -// -// protected void buildDeleteCommands(EARNatureRuntime runtime) { -// List commands = new ArrayList(); -// EAREditModel model = runtime.getEarEditModelForWrite(this); -// List projects = options.getModuleAndUtilityProjects(); -// try { -// if (options.shouldDeleteModules()) { -// for (int i = 0; i < projects.size(); i++) { -// IProject project = (IProject) projects.get(i); -// Module m = runtime.getModule(project); -// if (m != null) -// commands.add(new RemoveModuleFromEARProjectCommand(m, runtime.getProject())); -// else { -// String uri = runtime.getJARUri(project); -// if (uri != null) -// commands.add(new RemoveUtilityJARMapCommand(runtime.getProject(), uri, project)); -// } -// } -// } -// if (!commands.isEmpty()) -// deferredCommands.put(model, commands); -// else -// model.releaseAccess(this); -// } catch (RuntimeException e) { -// model.releaseAccess(this); -// throw e; -// } catch (Error err) { -// model.releaseAccess(this); -// throw err; -// } -// } -// -// /** -// * Do this for unhandled exceptions -// */ -// protected void releaseModels() { -// if (deleteEditModel != null) { -// //TODO - RLS, 2/19/2004 we need to revisit the whole notion of the loose composed edit -// //model beccause this does not release the nested models as expected, also it looks -// // like -// // the delete edit model is never created which means validate edit is not happening -// //TODO - JAS when you look at this class to clean up the above, also look at -// // RenameModuleOperation -// //because it has the same kind of mess -// deleteEditModel.releaseAccess(this); -// deleteEditModel = null; -// } -// if (deferredCommands != null) { -// Iterator iter = deferredCommands.keySet().iterator(); -// while (iter.hasNext()) { -// EditModel editModel = (EditModel) iter.next(); -// editModel.releaseAccess(this); -// iter.remove(); -// } -// } -// } -// -// public void release() { -// releaseModels(); -// } -// -// /** -// * After a normal execution flow, save the models if necessary -// */ -// protected void saveModelsIfNecessary() { -// if (deferredCommands == null) -// return; -// Iterator models = deferredCommands.keySet().iterator(); -// while (models.hasNext()) { -// EAREditModel model = (EAREditModel) models.next(); -// if (model.isDirty()) { -// if (dirtyEarModels.contains(model)) { -// model.saveIfNecessary(this); -// } else { -// model.save(this); -// } -// } -// } -// } -// -// protected void deleteModuleDependencies() throws InvocationTargetException, InterruptedException { -// getDeleteModuleDependencyOperation().run(monitor); -// } -// -// protected DeleteModuleDependencyOperation getDeleteModuleDependencyOperation() { -// if (deleteModuleDependencyOperation == null) { -// List earEditModels = new ArrayList(); -// Iterator iter = deferredCommands.keySet().iterator(); -// while (iter.hasNext()) -// earEditModels.add(((EAREditModel) iter.next()).getEARNature()); -// deleteModuleDependencyOperation = new DeleteModuleDependencyOperation(earEditModels, new HashSet(options.getModuleAndUtilityProjects())); -// } -// return deleteModuleDependencyOperation; -// } -// -// protected void executeDeferredCommands() { -// Iterator it = deferredCommands.entrySet().iterator(); -// while (it.hasNext()) { -// Map.Entry entry = (Map.Entry) it.next(); -// List commands = (List) entry.getValue(); -// executeCommands(commands); -// -// } -// } -// -// protected void executeCommands(List commands) { -// for (int i = 0; i < commands.size(); i++) { -// Command cmd = (Command) commands.get(i); -// cmd.execute(); -// } -// } -// -// /** -// * Return a list of all the non-resource files that will get modified as a result of running -// * this operation; used for validate edit. -// */ -// protected List getAffectedNonResourceFiles() { -// if (options.shouldDeleteModuleDependencies()) -// return getDeleteModuleDependencyOperation().getAffectedFiles(); -// return Collections.EMPTY_LIST; -// } -// -// /** -// * Use this only for validate edits -// */ -// public ComposedEditModel getDeleteEditModel() { -// if (deleteEditModel == null) -// initializeDeleteEditModel(); -// return deleteEditModel; -// } -// -// protected void initializeDeleteEditModel() { -// if (options.getAllProjectsToDelete().size() == 0) { -// throw new RuntimeException(J2EECreationResourceHandler.getString("DeleteModuleOperation_UI_0")); //$NON-NLS-1$ -// } -// -// buildDeleteCommandsIfNecessary(); -// IProject project = null; -// project = (IProject) options.getAllProjectsToDelete().get(0); -// -// deleteEditModel = new LooseComposedEditModel(EDIT_MODEL_KEY, (EMFWorkbenchContext) WorkbenchResourceHelper.getEMFContext(project)) { -// -// /** -// * @see org.eclipse.jst.j2ee.internal.internal.workbench.EditModel#getNonResourceFiles() -// */ -// public List getNonResourceFiles() { -// List result = super.getNonResourceFiles(); -// result.addAll(getAffectedNonResourceFiles()); -// return result; -// } -// }; -// -// Iterator it = deferredCommands.keySet().iterator(); -// while (it.hasNext()) { -// deleteEditModel.addChild((J2EEEditModel) it.next()); -// } -// } -// -// public IStatus getStatus() { -// return deleteModuleDependencyOperation.getStatus(); -// } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/DeleteOptions.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/DeleteOptions.java deleted file mode 100644 index a921577e5..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/delete/DeleteOptions.java +++ /dev/null @@ -1,126 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.internal.delete; - - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class DeleteOptions { - - protected boolean isEARDelete; - protected boolean deleteProjects; - protected boolean deleteModules; - protected boolean deleteModuleDependencies; - protected List selectedProjects; - /** Applicable for EAR delete */ - protected List selectedReferencedProjects; - - /** - * Constructor for DeleteOptions. - */ - public DeleteOptions() { - super(); - } - - - public boolean shouldDeleteModules() { - return deleteModules; - } - - - public void setDeleteModules(boolean deleteModulesFromAllEARs) { - this.deleteModules = deleteModulesFromAllEARs; - } - - - public boolean shouldDeleteProjects() { - return deleteProjects; - } - - - public void setDeleteProjects(boolean deleteProjects) { - this.deleteProjects = deleteProjects; - } - - - public boolean shouldDeleteModuleDependencies() { - return deleteModuleDependencies; - } - - - public void setDeleteModuleDependencies(boolean deleteReferencesFromModuleDependencies) { - this.deleteModuleDependencies = deleteReferencesFromModuleDependencies; - } - - public List getModuleAndUtilityProjects() { - if (isEARDelete) - return getSelectedReferencedProjects(); - return getSelectedProjects(); - } - - public List getAllProjectsToDelete() { - List result = new ArrayList(); - result.addAll(getSelectedProjects()); - result.addAll(getSelectedReferencedProjects()); - return result; - } - - /** - * Gets the selectedProjects. - * - * @return Returns a List - */ - public List getSelectedProjects() { - if (selectedProjects == null) - return Collections.EMPTY_LIST; - return selectedProjects; - } - - /** - * Sets the selectedProjects. - * - * @param selectedProjects - * The selectedProjects to set - */ - public void setSelectedProjects(List selectedProjects) { - this.selectedProjects = selectedProjects; - } - - /** - * Gets the selectedReferencedProjects. - * - * @return Returns a List - */ - public List getSelectedReferencedProjects() { - if (selectedReferencedProjects == null) - return Collections.EMPTY_LIST; - return selectedReferencedProjects; - } - - /** - * Sets the selectedReferencedProjects. - * - * @param selectedReferencedProjects - * The selectedReferencedProjects to set - */ - public void setSelectedReferencedProjects(List selectedReferencedProjects) { - this.selectedReferencedProjects = selectedReferencedProjects; - } - - public boolean isEARDelete() { - return isEARDelete; - } - - public void setIsEARDelete(boolean isEARDelete) { - this.isEARDelete = isEARDelete; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/Assert.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/Assert.java deleted file mode 100644 index 126f9e882..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/Assert.java +++ /dev/null @@ -1,110 +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.internal.project; - -/** - * <code>Assert</code> is useful for for embedding runtime sanity checks - * in code. - * The predicate methods all test a condition and throw some - * type of unchecked exception if the condition does not hold. - * <p> - * Assertion failure exceptions, like most runtime exceptions, are - * thrown when something is misbehaving. Assertion failures are invariably - * unspecified behavior; consequently, clients should never rely on - * these being thrown (and certainly should not being catching them - * specifically). - * </p> - */ -public final class Assert { - /* This class is not intended to be instantiated. */ - private Assert() { - // not allowed - } - - /** Asserts that an argument is legal. If the given boolean is - * not <code>true</code>, an <code>IllegalArgumentException</code> - * is thrown. - * - * @param expression the outcode of the check - * @return <code>true</code> if the check passes (does not return - * if the check fails) - * @exception IllegalArgumentException if the legality test failed - */ - public static boolean isLegal(boolean expression) { - return isLegal(expression, ""); //$NON-NLS-1$ - } - - /** Asserts that an argument is legal. If the given boolean is - * not <code>true</code>, an <code>IllegalArgumentException</code> - * is thrown. - * The given message is included in that exception, to aid debugging. - * - * @param expression the outcode of the check - * @param message the message to include in the exception - * @return <code>true</code> if the check passes (does not return - * if the check fails) - * @exception IllegalArgumentException if the legality test failed - */ - public static boolean isLegal(boolean expression, String message) { - if (!expression) - throw new IllegalArgumentException(message); - return expression; - } - - /** Asserts that the given object is not <code>null</code>. If this - * is not the case, some kind of unchecked exception is thrown. - * - * @param object the value to test - * @exception IllegalArgumentException if the object is <code>null</code> - */ - public static void isNotNull(Object object) { - isNotNull(object, ""); //$NON-NLS-1$ - } - - /** Asserts that the given object is not <code>null</code>. If this - * is not the case, some kind of unchecked exception is thrown. - * The given message is included in that exception, to aid debugging. - * - * @param object the value to test - * @param message the message to include in the exception - * @exception IllegalArgumentException if the object is <code>null</code> - */ - public static void isNotNull(Object object, String message) { - if (object == null) - throw new AssertionFailedException("null argument:" + message); //$NON-NLS-1$ - } - - /** Asserts that the given boolean is <code>true</code>. If this - * is not the case, some kind of unchecked exception is thrown. - * - * @param expression the outcode of the check - * @return <code>true</code> if the check passes (does not return - * if the check fails) - */ - public static boolean isTrue(boolean expression) { - return isTrue(expression, ""); //$NON-NLS-1$ - } - - /** Asserts that the given boolean is <code>true</code>. If this - * is not the case, some kind of unchecked exception is thrown. - * The given message is included in that exception, to aid debugging. - * - * @param expression the outcode of the check - * @param message the message to include in the exception - * @return <code>true</code> if the check passes (does not return - * if the check fails) - */ - public static boolean isTrue(boolean expression, String message) { - if (!expression) - throw new AssertionFailedException("assertion failed: " + message); //$NON-NLS-1$ - return expression; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/AssertionFailedException.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/AssertionFailedException.java deleted file mode 100644 index 4b73c2bf3..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/AssertionFailedException.java +++ /dev/null @@ -1,34 +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.internal.project; - -/** - * <code>AssertionFailedException</code> is a runtime exception thrown - * by some of the methods in <code>Assert</code>. - * <p> - * This class is not declared public to prevent some misuses; programs that catch - * or otherwise depend on assertion failures are susceptible to unexpected - * breakage when assertions in the code are added or removed. - * </p> - */ -/* package */ -class AssertionFailedException extends RuntimeException { - /** - * All serializable objects should have a stable serialVersionUID - */ - private static final long serialVersionUID = 1L; - - /** Constructs a new exception with the given message. - */ - public AssertionFailedException(String detail) { - super(detail); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/IJ2EEProjectTypes.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/IJ2EEProjectTypes.java deleted file mode 100644 index 684f12120..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/IJ2EEProjectTypes.java +++ /dev/null @@ -1,23 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.internal.project; - - -public interface IJ2EEProjectTypes { - int SOURCE = 1; - int BINARY = 2; - int DEFAULT = 3; - int UTIL = 4; - int EJB_CLIENT = 5; - int MODULE = 6; - int EJB_MODULE = 7; - int WEB_MODULE = 8; - int JCA_MODULE = 9; - int APPCLIENT_MODULE = 10; -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EECreationResourceHandler.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EECreationResourceHandler.java deleted file mode 100644 index dcb326b28..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EECreationResourceHandler.java +++ /dev/null @@ -1,162 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.project; - - -import org.eclipse.osgi.util.NLS; - -public class J2EECreationResourceHandler extends NLS { - private static final String BUNDLE_NAME = "j2eecreation";//$NON-NLS-1$ - - private J2EECreationResourceHandler() { - // Do not instantiate - } - - public static String EJBReferenceDataModel_UI_12; - public static String MIGRATE_J2EE_SPEC_UI_; - public static String EJBReferenceDataModel_UI_11; - public static String EJBReferenceDataModel_UI_10; - public static String REQUIRED_CLIENT_VIEW_TITLE; - public static String MIGRATION_COMPLETE; - public static String NOT_NEEDED_DEPLOYMENT_DESC_MIG; - public static String MIGRATION_WARNINGS_REPORT_UI_; - public static String BACKEND_MIGRATION_FAILED; - public static String REUSE_DELETED_CLIENT_VIEW_NAME_UI_; - public static String EJB_PROJECTS_UI_; - public static String NOT_NEEDED_BACKEND_MIG; - public static String MIGRATION_NOT_POSSIBLE_REPORT; - public static String PROJECT_MUST_BE_SELECTED_UI_; - public static String JAR_11_IMPORT_20_UI_; - public static String WEBCONTENT_FOLDER_RENAME_SKIPPED; - public static String CONFIRM_MIGRATE_PROJECT_STRUCTURE; - public static String WEBPROJECT_VERSION_MIGRATE_FAILED; - public static String JdkJarFileDoesNotExist_UI; - public static String Local_cannot_be_empty_UI_; - public static String LOCAL_CLIENT_NOT_NEEDED; - public static String REMOTE_CLIENT_VIEWS_NOT_EXIST_UI_; - public static String MIGRATING_PROJECT_STRUCTURES_UI_; - public static String ResourceEnvironmentReferenceDataModel_2; - public static String J2EE_1_2_ONLY_HAVE_REMOTE; - public static String OPEN_EDITORS_TITLE; - public static String EJB_MUST_BE_SELECTED_UI_; - public static String FAILED_MIGRATING_IMPORTED_CLASSES; - public static String OPEN_J2EE_MIGRATION_WIZARD_UI_; - public static String LOCAL_CLIENT_VIEWS_EXIST_UI_; - public static String DELETING_REMOTE_CLIENT_VIEWS_UI_; - public static String EJB_UI_; - public static String CONFIRM_CLIENT_VIEW_REQUIRED; - public static String MIGRATION_NOT_NEEDED; - public static String ADDING_LOCAL_CLIENT_VIEWS_UI_; - public static String WEB_UI_; - public static String DeleteModuleOperation_UI_0; - public static String Home_cannot_be_empty_UI_; - public static String WEBCONTENT_LIBPATH_UPDATE_FAILED; - public static String REMOTE_CLIENT_DELETE_SUCCESS_UI_; - public static String ServerTargetDataModel_UI_9; - public static String LOCAL_CLIENT_ADD_FAILED_UI_; - public static String ServerTargetDataModel_UI_8; - public static String OLD_PROJECT_STRUCTURE_UI_; - public static String ServerTargetDataModel_UI_7; - public static String INFORM_PROPER_SELECTION; - public static String MIGRATE_MODULE_PROJECTS_UI_; - public static String COMPLETED_LOCAL_CLIENT_CREATE; - public static String IMPORTED_CLASSES_FILE_DELETED; - public static String ADD_LOCAL_CLIENT_VIEWS_BAN_UI_; - public static String USE_REMOTE_FOR_DIFFERENT_EAR; - public static String APP_PROJECT_ERROR_EXC_; - public static String InvalidCharsError; - public static String ENTERPRISE_APPLICATIONS_UI_; - public static String ResourceReferenceDataModel_UI_1; - public static String ResourceReferenceDataModel_UI_0; - public static String DELETE_REM_CLIENT_VIEWS_UI_; - public static String Errors_occurred_renaming_module_dependencies_UI_; - public static String MIGRATION_ERRORS_REPORT_UI_; - public static String J2EE_VERSION_FAILED_UI_; - public static String COMPLETED_DEPLOY_DELETE; - public static String PROJECT_REFERENCES_UPDATED; - public static String TARGET_ALSO_EXIST_IN_SAME_EAR; - public static String WEBCONTENT_FOLDER_RENAME_FAILED; - public static String MIGRATE_UI_; - public static String Creating__UI_; - public static String Error_creating_an_EAR_proj_UI_; - public static String ReferenceDataModel_UI_6; - public static String ReferenceDataModel_UI_5; - public static String ReferenceDataModel_UI_3; - public static String ENTERPRISE_BEANS_BAN_UI_; - public static String ADD_LOCAL_CLIENT_VIEWS_CHECK_UI_; - public static String Can_not_rename_module_dependency_from_project_UI_; - public static String PROJECT_STRUCTURE_SUCCESS_UI_; - public static String SOURCE_FOLDER_RENAME_SKIPPED; - public static String UNKNOWN_UI_; - public static String WIZ_BAN_DESC_UI_; - public static String COMPLETED_CMP20_CODEGEN; - public static String PROJECT_NOT_NEED_MIGRATION_UI_; - public static String SELECT_EJB_CLIENT_VIEWS_UI_; - public static String Creating_Java_Project_UI_; - public static String REMOTE_CLIENT_DELETE_FAILED_UI_; - public static String FILES_OUT_OF_SYNC; - public static String MIGRATE_CMP_BEANS_UI_; - public static String Remote_cannot_be_empty_UI_; - public static String Errors_occurred_deleting_module_dependencies_UI_; - public static String Can_not_remove_module_dependency_from_project_UI_; - public static String INVALID_SELECTION_TITLE; - public static String ABS_PATHS_APP_EXT_REMOVED; - public static String Local_home_cannot_be_empty_UI_; - public static String USE_LOCAL_FOR_DIFFERENT_EAR; - public static String ENTERPRISE_APP_PROJECTS_UI_; - public static String MIGRATE_J2EE_PROJECTS_UI_; - public static String MIGRATION_SUCCESS_REPORT_UI_; - public static String FAILED_DEPLOY_DELETE; - public static String J2EE_VERSION_NOT_NEED_MIGRATION_UI_; - public static String MIGRATING_J2EE_VERSION_UI_; - public static String APPLICATION_CLIENTS_UI_; - public static String ServiceReferenceDataModel_ERROR_8; - public static String PROJECT_STRUCTURE_FAILED_UI_; - public static String LOCAL_CLIENT_ADD_SUCCESS_UI_; - public static String COMPONENT_ALREADYINEAR; - public static String COMPLETED_BACKEND_MIG; - public static String MIGRATE_EJB_SPEC_UI_; - public static String RenameModuleOperation_UI_0; - public static String CMP_11_IMPORT_20_UI_; - public static String J2EE_PROJECT_MIGRATION_TITLE_UI_; - public static String APP_CLIENT_ONLY_HAVE_REMOTE; - public static String MIGRATION_NOT_NEEDED_REPORT; - public static String LOCAL_CLIENT_VIEW_SCHEME_UI_; - public static String BINARY_MIGRATION_FAILED; - public static String ENTERPRISE_APPLICATION_UI_; - public static String INFORM_OPEN_EDITORS; - public static String EXTRACTED_IMPORTED_CLASSES; - public static String J2EE_VERSION_SUCCESS_UI_; - public static String SUFFIX_EXAMPLE_UI_; - public static String CONFIRMATION_TITLE; - public static String MIGRATION_ERRORS; - public static String APPLICATION_CLIENT_UI_; - public static String SPECIFY_SUFFIX_UI_; - public static String CONFIRM_MIGRATE_J2EE_13; - public static String PortComponentReferenceDataModel_ERROR_4; - public static String FAILED_LOCAL_CLIENT_CREATE; - public static String MessageDestReferenceDataModel_9; - public static String APPLICATION_CLIENT_PROJECTS_UI_; - public static String MessageDestReferenceDataModel_8; - public static String SOURCE_FOLDER_RENAME_FAILED; - public static String MessageDestReferenceDataModel_7; - public static String ENTERPRISE_BEANS_LIST_UI_; - public static String PROJECT_CLASSPATH_UPDATED; - public static String VERSION_NOT_SUPPORTED; - - static { - NLS.initializeMessages(BUNDLE_NAME, J2EECreationResourceHandler.class); - } - - public static String getString(String key, Object[] args) { - return NLS.bind(key, args); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EEJavaProjectInfo.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EEJavaProjectInfo.java deleted file mode 100644 index bdbacddfe..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EEJavaProjectInfo.java +++ /dev/null @@ -1,481 +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.internal.project; - - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.IPath; -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.jdt.core.JavaModelException; -import org.eclipse.jem.internal.plugin.JavaProjectInfo; -import org.eclipse.wst.server.core.IRuntime; - -/** - * This class stores the info required for creating a new J2EE project; not all info will apply to - * all kinds of projects - */ -public class J2EEJavaProjectInfo extends JavaProjectInfo { - protected static final String SRCROOT_VAR = "JRE_SRCROOT"; //$NON-NLS-1$ - protected IProject project; - protected String jdkRTJarPath; - protected String projectName; - protected IPath projectLocation; - protected String javaOutputPath; - protected IClasspathEntry[] classpathEntries; - protected boolean shouldInitializeDefaultClasspath = true; - protected String natureId; - protected IRuntime serverTarget; - protected int moduleVersion; - - /** - * EJBProjectInfo constructor comment. - */ - public J2EEJavaProjectInfo() { - super(); - } - - /** - * EJBProjectInfo constructor comment. - */ - public J2EEJavaProjectInfo(IProject project) { - super(); - setProject(project); - } - - public IClasspathEntry[] calculateServerClasspathEntries() throws JavaModelException { - IJavaProject javaProject = getJavaProject(); - if (javaProject == null) - return null; - if (getProject().exists()) { - //We don't need to remove a server target anyomre as it need to be there - //ServerTargetManager.removeServerTarget(getProject(),null); - IClasspathEntry[] ces = javaProject.getRawClasspath(); - if (ces.length > 0) - addToClasspathEntries(ces); - } - addServerJdkRuntimeToClasspathEntries(); - addServerJarsToClasspathEntries(); - return classpathEntries; - } - - /** - * Sets up the default classpath for this project - */ - protected void addDefaultToClasspathEntries() { - addToClasspathEntries(computeDefaultJavaClasspath()); - } - - /** - * Set the corresponding jsp and servlet levels. Creation date: (11/09/00 10:05:24 AM) - */ - public void setJ2EEVersion(int newVersion) { - } - - - /** - * add the source folder to classpath dir (IClasspathEntry.CPE_SOURCE) - */ - public void addJavaSourceToClasspathEntries() { - IPath sourceClassPath = new Path(getFullSourcePath()); - addToClasspathEntries(new IClasspathEntry[]{JavaCore.newSourceEntry(sourceClassPath)}); - } - - public boolean addJdkJarToClasspathEntries(String jdkJarFullPathName) { - - IJavaProject javaProject = getJavaProject(); - if (javaProject == null) - return false; - - IClasspathEntry[] entry = new IClasspathEntry[1]; - Path path = new Path(jdkJarFullPathName); - if (!path.toFile().exists()) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(J2EECreationResourceHandler.getString(J2EECreationResourceHandler.JdkJarFileDoesNotExist_UI, new Object[]{jdkJarFullPathName})); - return false; - } - - entry[0] = JavaCore.newLibraryEntry(path, null, null); - addToClasspathEntries(entry); - - return true; - } - - /** - * add rt.jar form the server.jdk plugin - */ - public void addServerJdkRuntimeToClasspathEntries() { - addToClasspathEntries(getServerJDKClasspathEntries()); - } - - public IClasspathEntry[] getServerJDKClasspathEntries() { - List list = new ArrayList(4); - //TODO This class should be deleted. - // if (isJ2EE13() - // || !org.eclipse.jst.j2ee.internal.internal.plugin.J2EEPlugin.hasDevelopmentRole()) { - // list.add(JavaCore.newVariableEntry(new - // Path(IEJBNatureConstants.SERVERJDK_50_PLUGINDIR_VARIABLE + "/jre/lib/rt.jar"), - // //$NON-NLS-1$ - // new Path(IEJBNatureConstants.SERVERJDK_50_PLUGINDIR_VARIABLE + "/src.jar"), //$NON-NLS-1$ - // new Path(IEJBNatureConstants.SERVERJDK_SRCROOT_VARIABLE))); //$NON-NLS-1$ - // } else { - // list.add(JavaCore.newVariableEntry(new - // Path(IEJBNatureConstants.SERVERJDK_PLUGINDIR_VARIABLE + "/jre/lib/rt.jar"), //$NON-NLS-1$ - // new Path(IEJBNatureConstants.SERVERJDK_PLUGINDIR_VARIABLE + "/src.jar"), //$NON-NLS-1$ - // new Path(IEJBNatureConstants.SERVERJDK_SRCROOT_VARIABLE))); //$NON-NLS-1$ - // } - return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]); - } - - /** - * Adds entries to the class path for this project - */ - public void addToClasspathEntries(IClasspathEntry[] entries) { - - java.util.List list = new ArrayList(10); - // add the existing ones if any - if (classpathEntries != null) - list.addAll(Arrays.asList(classpathEntries)); - - // add the new ones - list.addAll(Arrays.asList(entries)); - - // convert - classpathEntries = new IClasspathEntry[list.size()]; - classpathEntries = (IClasspathEntry[]) list.toArray(classpathEntries); - - } - - public boolean addVariableJarToClasspathEntries(String fullPath) { - - IJavaProject javaProject = getJavaProject(); - if (javaProject == null) - return false; - - IClasspathEntry[] entry = new IClasspathEntry[1]; - entry[0] = JavaCore.newVariableEntry(new Path(fullPath), null, null); - addToClasspathEntries(entry); - return true; - } - - public boolean addVariableJarToClasspathEntriesWithAttachments(String fullPath, String srcPath, String srcRoot) { - - IJavaProject javaProject = getJavaProject(); - if (javaProject == null) - return false; - - IClasspathEntry[] entry = new IClasspathEntry[1]; - entry[0] = JavaCore.newVariableEntry(new Path(fullPath), new Path(srcPath), new Path(srcRoot)); - addToClasspathEntries(entry); - return true; - } - - /** - * Return the default classpath for projects of this kind; subclasses should override for - * setting up new projects - */ - protected IClasspathEntry[] computeDefaultJavaClasspath() { - IJavaProject javaProject = getJavaProject(); - if (javaProject == null) - return null; - addJavaSourceToClasspathEntries(); - if (serverTarget == null) { - addServerJdkRuntimeToClasspathEntries(); - addServerJarsToClasspathEntries(); - } - return classpathEntries; - } - - /** - * Sublcasses have to overide this method to set the server jars - */ - public void addServerJarsToClasspathEntries() { - - } - - /** - * Creates a project handle with a specified path. The project resource should <b>not </b> be - * created concretely here; - */ - public IProject createProjectHandle(IPath projectPath) { - return getWorkspace().getRoot().getProject(projectPath.segment(0)); - } - - public IClasspathEntry[] getClasspathEntries() { - if (classpathEntries == null) - initializeClasspathEntries(); - return classpathEntries; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public java.lang.String getDefaultContextRoot() { - return null; - } - - /** - * Subclasses should override as necessary - */ - protected String getDefaultJavaOutputPath() { - return DEFAULT_JAVA_OUTPUT_PATH; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public java.lang.String getDefaultUri() { - return projectName.replace(' ', '_') + ".jar"; //$NON-NLS-1$ - } - - /** - * Get the java output folder for the receiver, in the form of /project/ <output folder> - * - * @return java.lang.String - */ - public String getFullJavaOutputPath() { - return Path.ROOT.append(getProjectPath()).append(getJavaOutputPath()).toString(); - } - - /** - * Get the module path folder for the receiver in the form of /project/modulepath - * - * @return java.lang.String - */ - protected String getFullSourcePath() { - return Path.ROOT.append(getProjectPath()).append(getSourcePath()).toString(); - } - - /** - * Returns the project relative path of the java build destination - */ - public java.lang.String getJavaOutputPath() { - if (javaOutputPath == null) - javaOutputPath = getDefaultJavaOutputPath(); - return javaOutputPath; - } - - /** - * @param i - */ - public void setModuleVersion(int version) { - moduleVersion = version; - } - - public IJavaProject getJavaProject() { - // needed to get an IJavaProject to create classpaths from. - IProject aProject = getProject(); - if (aProject == null) - aProject = getWorkspace().getRoot().getProject(getProjectName()); - - return JavaCore.create(aProject); - } - - /** - * Return the absolute path of the default jdk rt.jar to use for this project - */ - public java.lang.String getJdkRTJarPath() { - return jdkRTJarPath; - } - - /** - * Return the project being created; checks the workspace for an existing project - */ - public IProject getProject() { - if (project == null) { - IProject aProject = getWorkspace().getRoot().getProject(getProjectName()); - if (aProject.exists()) - project = aProject; - } - return project; - } - - /** - * Return the location of the project in the file system. - * - * @return org.eclipse.core.runtime.IPath - */ - public IPath getProjectLocation() { - return projectLocation; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public java.lang.String getProjectName() { - if (projectName == null && project != null) - projectName = project.getName(); - return projectName; - } - - public IPath getProjectPath() { - return new Path(getProjectName()); - } - - public IWorkspace getWorkspace() { - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getWorkspace(); - } - - /** - * Lazy initialization - useGetClasspathEntries - */ - protected void initializeClasspathEntries() { - if (shouldInitializeDefaultClasspath()) - computeDefaultJavaClasspath(); - else - classpathEntries = new IClasspathEntry[0]; - } - - /** - * Answer false by default - * - * @deprecated - Use getModuleVersion() with J2EEVersionConstants - */ - protected boolean isJ2EE13() { - return false; - } - - public IProject primGetProject() { - return project; - } - - public void removeClasspathEntry(IClasspathEntry entry) { - if (entry == null) - return; - - List list = new ArrayList(Arrays.asList(getClasspathEntries())); - list.remove(entry); - classpathEntries = (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]); - } - - /** - * Insert the method's description here. Creation date: (11/10/00 10:09:58 AM) - * - * @param newClassPathEntries - * org.eclipse.jdt.core.api.IClasspathEntry - */ - public void setClasspathEntries(IClasspathEntry[] newClasspathEntries) { - classpathEntries = newClasspathEntries; - } - - public void setJavaOutputPath(String path) { - javaOutputPath = path; - } - - public void setJdkRTJarPath(String path) { - jdkRTJarPath = path; - } - - public void setProject(IProject aProject) { - project = aProject; - } - - /** - * Set the location in the file system that the project is to be created. - * - * @param newProjectLocation - * IPath - */ - public void setProjectLocation(IPath newProjectLocation) { - projectLocation = newProjectLocation; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @param newProjectName - * java.lang.String - */ - public void setProjectName(java.lang.String newProjectName) { - if (projectName != newProjectName) - setClasspathEntries(null); - projectName = newProjectName; - } - - public void setShouldInitializeDefaultClasspath(boolean value) { - shouldInitializeDefaultClasspath = value; - } - - public boolean shouldInitializeDefaultClasspath() { - return shouldInitializeDefaultClasspath; - } - - /** - * Gets the natureId. - * - * @return Returns a String - */ - public String getNatureId() { - if (natureId == null) - return getDefaultNatureId(); - return natureId; - } - - /** - * returns the correct nature id string based on the J2EE spec level being used - */ - public String getDefaultNatureId() { - return null; - } - - /** - * Sets the natureId. - * - * @param natureId - * The natureId to set - */ - public void setNatureId(String natureId) { - this.natureId = natureId; - } - - /** - * Get the correct WAS classpath variable based on the J2EE version. - */ - protected String getWASPluginVariable() { - //TODO This class needs to be deleted. - // if (isJ2EE13() - // || !org.eclipse.jst.j2ee.internal.internal.plugin.J2EEPlugin.hasDevelopmentRole()) - // return IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE; - // else - // return IEJBNatureConstants.WAS_PLUGINDIR_VARIABLE; - return ""; //$NON-NLS-1$ - } - - public int getModuleVersion() { - return moduleVersion; - } - - /** - * @return - */ - public IRuntime getServerTarget() { - return serverTarget; - } - - /** - * @param target - */ - public void setServerTarget(IRuntime target) { - serverTarget = target; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EEProjectUtilities.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EEProjectUtilities.java deleted file mode 100644 index 44be6e13f..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/J2EEProjectUtilities.java +++ /dev/null @@ -1,1174 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.project; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.ICommand; -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.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.util.URI; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.java.JavaClass; -import org.eclipse.jem.java.JavaRefFactory; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.emf.workbench.WorkbenchByteArrayOutputStream; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.util.plugin.JEMUtilPlugin; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.ejb.EnterpriseBean; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.archive.operations.JavaComponentLoadStrategyImpl; -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; -import org.eclipse.jst.j2ee.internal.componentcore.AppClientBinaryComponentHelper; -import org.eclipse.jst.j2ee.internal.componentcore.EJBBinaryComponentHelper; -import org.eclipse.jst.j2ee.internal.componentcore.JCABinaryComponentHelper; -import org.eclipse.jst.j2ee.internal.componentcore.WebBinaryComponentHelper; -import org.eclipse.jst.j2ee.internal.moduleextension.EarModuleManager; -import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants; -import org.eclipse.jst.j2ee.project.facet.IJavaProjectMigrationDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationDataModelProvider; -import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationOperation; -import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek; -import org.eclipse.jst.server.core.FacetUtil; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -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.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.componentcore.resources.IVirtualResource; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.SimpleValidateEdit; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.server.core.IRuntime; - -public class J2EEProjectUtilities extends ProjectUtilities implements IJ2EEFacetConstants { - private static final IVirtualReference[] NO_REFERENCES = new IVirtualReference[0]; - - /** - * Return the absolute path of a loose archive in a J2EE application or WAR file - */ - public static IPath getRuntimeLocation(IProject aProject) { - if (JemProjectUtilities.isBinaryProject(aProject)) - return getBinaryProjectJARLocation(aProject); - return JemProjectUtilities.getJavaProjectOutputAbsoluteLocation(aProject); - } - - public static IPath getBinaryProjectJARLocation(IProject aProject) { - List sources = JemProjectUtilities.getLocalJARPathsFromClasspath(aProject); - if (!sources.isEmpty()) { - IPath path = (IPath) sources.get(0); - return aProject.getFile(path).getLocation(); - } - return null; - } - - public static Archive getClientJAR(EJBJarFile file, EARFile earFile) { - EJBJar jar = null; - try { - jar = file.getDeploymentDescriptor(); - } catch (DeploymentDescriptorLoadException exc) { - return null; - } - if (jar == null) - return null; - String clientJAR = jar.getEjbClientJar(); - if (clientJAR == null || clientJAR.length() == 0) - return null; - String normalized = ArchiveUtil.deriveEARRelativeURI(clientJAR, file.getURI()); - if (normalized != null) { - try { - File aFile = earFile.getFile(normalized); - if (aFile.isArchive() && !aFile.isModuleFile()) - return (Archive) aFile; - } catch (FileNotFoundException nothingThere) { - } - } - return null; - // TODO - release the DD here to free up space - } - - /** - * Append one IClasspathEntry to the build path of the passed project. If a classpath entry - * having the same path as the parameter already exists, then does nothing. - */ - public static void appendJavaClassPath(IProject p, IClasspathEntry newEntry) throws JavaModelException { - IJavaProject javaProject = JemProjectUtilities.getJavaProject(p); - if (javaProject == null) - return; - IClasspathEntry[] classpath = javaProject.getRawClasspath(); - List newPathList = new ArrayList(classpath.length); - for (int i = 0; i < classpath.length; i++) { - IClasspathEntry entry = classpath[i]; - // fix dup class path entry for .JETEmitter project - // Skip the entry to be added if it already exists - if (Platform.getOS().equals(Platform.OS_WIN32)) { - if (!entry.getPath().toString().equalsIgnoreCase(newEntry.getPath().toString())) - newPathList.add(entry); - else - return; - } else { - if (!entry.getPath().equals(newEntry.getPath())) - newPathList.add(entry); - else - return; - } - } - newPathList.add(newEntry); - IClasspathEntry[] newClasspath = (IClasspathEntry[]) newPathList.toArray(new IClasspathEntry[newPathList.size()]); - javaProject.setRawClasspath(newClasspath, new NullProgressMonitor()); - } - - public static Archive asArchiveFromBinary(String jarUri, IProject aProject) throws OpenFailureException { - IPath path = getBinaryProjectJARLocation(aProject); - if (path != null) { - String location = path.toOSString(); - Archive anArchive = CommonarchiveFactoryImpl.getActiveFactory().primOpenArchive(location); - anArchive.setURI(jarUri); - return anArchive; - } - return null; - } - - public static ArchiveManifest readManifest(IFile aFile) { - InputStream in = null; - try { - if (aFile == null || !aFile.exists()) - return null; - in = aFile.getContents(); - return new ArchiveManifestImpl(in); - } catch (Exception ex) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); - return null; - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException weTried) { - } - } - } - } - - public static ArchiveManifest readManifest(IProject p) { - InputStream in = null; - try { - IFile aFile = getManifestFile(p); - if (aFile == null || !aFile.exists()) - return null; - in = aFile.getContents(); - return new ArchiveManifestImpl(in); - } catch (Exception ex) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); - return null; - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException weTried) { - } - } - } - } - - /** - * Equavalent to calling getManifestFile(project, true) - * - * @param p - * @return - */ - public static IFile getManifestFile(IProject project) { - return getManifestFile(project, true); - } - - /** - * Returns the IFile handle to the J2EE manifest file for the specified - * project. If createIfNecessary is true, the MANIFEST.MF file will be - * created if it does not already exist. - * - * @param p - * @param createIfNecessary - * @return - */ - public static IFile getManifestFile(IProject p, boolean createIfNecessary) { - IVirtualComponent component = ComponentCore.createComponent(p); - try { - IFile file = ComponentUtilities.findFile(component, new Path(J2EEConstants.MANIFEST_URI)); - if (createIfNecessary && file == null) { - IVirtualFolder virtualFolder = component.getRootFolder(); - file = virtualFolder.getUnderlyingFolder().getFile(new Path(J2EEConstants.MANIFEST_URI)); - - try { - ManifestFileCreationAction.createManifestFile(file, p); - } catch (CoreException e) { - Logger.getLogger().log(e); - } catch (IOException e) { - Logger.getLogger().log(e); - } - } - return file; - } catch (CoreException ce) { - Logger.getLogger().log(ce); - } - return null; - } - - public static void writeManifest(IProject aProject, ArchiveManifest manifest) throws java.io.IOException { - writeManifest(aProject, getManifestFile(aProject), manifest); - } - - public static void writeManifest(IFile aFile, ArchiveManifest manifest) throws java.io.IOException { - writeManifest(aFile.getProject(), aFile, manifest); - } - - private static void writeManifest(IProject aProject, IFile aFile, ArchiveManifest manifest) throws java.io.IOException { - if (aFile != null) { - if(SimpleValidateEdit.validateEdit(new IFile[] { aFile })){ - OutputStream out = new WorkbenchByteArrayOutputStream(aFile); - manifest.writeSplittingClasspath(out); - out.close(); - J2EEComponentClasspathUpdater.getInstance().queueUpdateModule(aProject); - } - } - } - - /** - * Keys are the EJB JAR files and the values are the respective client JARs; includes only key - * value pairs for which EJB Client JARs are defined and exist. - * - * @author schacher - */ - public static Map collectEJBClientJARs(EARFile earFile) { - if (earFile == null) - return Collections.EMPTY_MAP; - Map ejbClientJARs = null; - List ejbJARFiles = earFile.getEJBJarFiles(); - Archive clientJAR = null; - for (int i = 0; i < ejbJARFiles.size(); i++) { - EJBJarFile ejbJarFile = (EJBJarFile) ejbJARFiles.get(i); - clientJAR = getClientJAR(ejbJarFile, earFile); - if (clientJAR != null) { - if (ejbClientJARs == null) - ejbClientJARs = new HashMap(); - ejbClientJARs.put(ejbJarFile, clientJAR); - } - } - return ejbClientJARs == null ? Collections.EMPTY_MAP : ejbClientJARs; - } - - public static String computeRelativeText(String referencingURI, String referencedURI, EnterpriseBean bean) { - if (bean == null) - return null; - - String beanName = bean.getName(); - if (beanName == null) - return null; - - String relativeUri = computeRelativeText(referencingURI, referencedURI); - if (relativeUri == null) - return beanName; - return relativeUri + "#" + beanName; //$NON-NLS-1$ - } - - public static String computeRelativeText(String referencingURI, String referencedURI) { - if (referencingURI == null || referencedURI == null) - return null; - IPath pPre = new Path(referencingURI); - IPath pDep = new Path(referencedURI); - if (pPre.getDevice() != null || pDep.getDevice() != null) - return null; - pPre = pPre.makeRelative(); - pDep = pDep.makeRelative(); // referenced Archive path URI - - while (pPre.segmentCount() > 1 && pDep.segmentCount() > 1 && pPre.segment(0).equals(pDep.segment(0))) { - pPre = pPre.removeFirstSegments(1); - pDep = pDep.removeFirstSegments(1); - } - - IPath result = null; - StringBuffer buf = new StringBuffer(); - String segment = null; - do { - segment = pDep.lastSegment(); - pPre = pPre.removeLastSegments(1); - pDep = pDep.removeLastSegments(1); - if (segment != null) { - if (result == null) - result = new Path(segment); - else - result = new Path(segment).append(result); - } - if (!pPre.equals(pDep) && !pPre.isEmpty()) - buf.append("../"); //$NON-NLS-1$ - } while (!pPre.equals(pDep)); - - if (result != null) - buf.append(result.makeRelative().toString()); - - return buf.toString(); - } - - public static IProject getEJBProjectFromEJBClientProject(IProject ejbClientProject) { - try { - if (null != ejbClientProject && ejbClientProject.hasNature(JavaCore.NATURE_ID)) { - IProject[] allProjects = getAllProjects(); - for (int i = 0; i < allProjects.length; i++) { - if (null != EarModuleManager.getEJBModuleExtension().getEJBJar(allProjects[i])) { - if (ejbClientProject == EarModuleManager.getEJBModuleExtension().getDefinedEJBClientJARProject(allProjects[i])) { - return allProjects[i]; - } - } - } - } - } catch (CoreException e) { - } - return null; - } - - public static EnterpriseBean getEnterpriseBean(ICompilationUnit cu) { - IProject proj = cu.getJavaProject().getProject(); - EJBJar jar = EarModuleManager.getEJBModuleExtension().getEJBJar(proj); - if (null == jar) { - jar = EarModuleManager.getEJBModuleExtension().getEJBJar(getEJBProjectFromEJBClientProject(proj)); - } - if (jar != null) { - int index = cu.getElementName().indexOf('.'); - String className = cu.getElementName(); - if (index > 0) - className = className.substring(0, index); - JavaClass javaClass = (JavaClass) JavaRefFactory.eINSTANCE.reflectType(cu.getParent().getElementName(), className, jar.eResource().getResourceSet()); - return jar.getEnterpriseBeanWithReference(javaClass); - } - return null; - } - - public static IContainer getSourceFolderOrFirst(IProject p, String defaultSourceName) { - try { - IPath sourcePath = getSourcePathOrFirst(p, defaultSourceName); - if (sourcePath == null) - return null; - else if (sourcePath.isEmpty()) - return p; - else - return p.getFolder(sourcePath); - } catch (IllegalArgumentException ex) { - return null; - } - } - - public static void removeBuilders(IProject project, List builderids) throws CoreException { - IProjectDescription desc = project.getDescription(); - ICommand[] oldSpec = desc.getBuildSpec(); - int oldLength = oldSpec.length; - if (oldLength == 0) - return; - int remaining = 0; - // null out all commands that match the builder to remove - for (int i = 0; i < oldSpec.length; i++) { - if (builderids.contains(oldSpec[i].getBuilderName())) - oldSpec[i] = null; - else - remaining++; - } - // check if any were actually removed - if (remaining == oldSpec.length) - return; - ICommand[] newSpec = new ICommand[remaining]; - for (int i = 0, newIndex = 0; i < oldLength; i++) { - if (oldSpec[i] != null) - newSpec[newIndex++] = oldSpec[i]; - } - desc.setBuildSpec(newSpec); - project.setDescription(desc, IResource.NONE, null); - } - - public static IPath getSourcePathOrFirst(IProject p, String defaultSourceName) { - IJavaProject javaProj = JemProjectUtilities.getJavaProject(p); - if (javaProj == null) - return null; - IClasspathEntry[] cp = null; - try { - cp = javaProj.getRawClasspath(); - } catch (JavaModelException ex) { - JEMUtilPlugin.getLogger().logError(ex); - return null; - } - IClasspathEntry firstSource = null; - IPath defaultSourcePath = null; - if (defaultSourceName != null) - defaultSourcePath = createPath(p, defaultSourceName); - boolean found = false; - for (int i = 0; i < cp.length; i++) { - if (cp[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) { - // check if it contains /META-INF/MANIFEST.MF - IPath sourceFolderPath = cp[i].getPath().removeFirstSegments(1); - IFolder sourceFolder = p.getFolder(sourceFolderPath); - if (isSourceFolderAnInputContainer(sourceFolder)) { - found = true; - if (firstSource == null) { - firstSource = cp[i]; - if (defaultSourcePath == null) - break; - } - if (cp[i].getPath().equals(defaultSourcePath)) - return defaultSourcePath.removeFirstSegments(1); - } - } - } - if (!found) { - for (int i = 0; i < cp.length; i++) { - if (cp[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) { - if (firstSource == null) { - firstSource = cp[i]; - if (defaultSourcePath == null) - break; - } - if (cp[i].getPath().equals(defaultSourcePath)) - return defaultSourcePath.removeFirstSegments(1); - } - } - } - if (firstSource == null) - return null; - if (firstSource.getPath().segment(0).equals(p.getName())) - return firstSource.getPath().removeFirstSegments(1); - return null; - } - - public static boolean isSourceFolderAnInputContainer(IFolder sourceFolder) { - IContainer parent = sourceFolder; - while (true) { - parent = parent.getParent(); - if (parent == null) - return false; - if (parent instanceof IProject) - break; - } - IProject project = (IProject) parent; - try { - if (!project.isAccessible()) - return false; - if (isEJBProject(project)) { - return sourceFolder.findMember(J2EEConstants.EJBJAR_DD_URI) != null; - } else if (isApplicationClientProject(project)) { - return sourceFolder.findMember(J2EEConstants.APP_CLIENT_DD_URI) != null; - } else if (isDynamicWebProject(project)) { - return sourceFolder.findMember(J2EEConstants.WEBAPP_DD_URI) != null; - } else if (isJCAProject(project)) { - return sourceFolder.findMember(J2EEConstants.RAR_DD_URI) != null; - } - } catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - public static Archive asArchive(String jarUri, IProject project, boolean exportSource) throws OpenFailureException { - return asArchive(jarUri, project, exportSource, true); - } - - public static Archive asArchive(String jarUri, IProject project, boolean exportSource, boolean includeClasspathComponents) throws OpenFailureException { - JavaComponentLoadStrategyImpl strat = new JavaComponentLoadStrategyImpl(ComponentCore.createComponent(project), includeClasspathComponents); - strat.setExportSource(exportSource); - return CommonarchiveFactoryImpl.getActiveFactory().primOpenArchive(strat, jarUri); - } - - public static boolean isProjectOfType(IProject project, String typeID) { - IFacetedProject facetedProject = null; - try { - facetedProject = ProjectFacetsManager.create(project); - } catch (CoreException e) { - return false; - } - - if (facetedProject != null && ProjectFacetsManager.isProjectFacetDefined(typeID)) { - IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(typeID); - return projectFacet != null && facetedProject.hasProjectFacet(projectFacet); - } - return false; - } - - private static boolean isProjectOfType(IFacetedProject facetedProject, String typeID) { - - if (facetedProject != null && ProjectFacetsManager.isProjectFacetDefined(typeID)) { - IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(typeID); - return projectFacet != null && facetedProject.hasProjectFacet(projectFacet); - } - return false; - } - - private static boolean isEARProject(IFacetedProject project) { - return isProjectOfType(project, ENTERPRISE_APPLICATION); - } - - private static boolean isDynamicWebProject(IFacetedProject project) { - return isProjectOfType(project, DYNAMIC_WEB); - } - - private static boolean isStaticWebProject(IFacetedProject project) { - return isProjectOfType(project, STATIC_WEB); - } - - private static boolean isEJBProject(IFacetedProject project) { - return isProjectOfType(project, EJB); - } - - private static boolean isJCAProject(IFacetedProject project) { - return isProjectOfType(project, JCA); - } - - private static boolean isApplicationClientProject(IFacetedProject project) { - return isProjectOfType(project, APPLICATION_CLIENT); - } - - private static boolean isUtilityProject(IFacetedProject project) { - return isProjectOfType(project, UTILITY); - } - - public static boolean isEARProject(IProject project) { - return isProjectOfType(project, ENTERPRISE_APPLICATION); - } - - public static boolean isDynamicWebComponent(IVirtualComponent component) { - if (component.isBinary()) { - return WebBinaryComponentHelper.handlesComponent(component); - } - return isProjectOfType(component.getProject(), DYNAMIC_WEB); - } - - public static boolean isDynamicWebProject(IProject project) { - return isProjectOfType(project, DYNAMIC_WEB); - } - - public static boolean isStaticWebProject(IProject project) { - return isProjectOfType(project, STATIC_WEB); - } - - public static boolean isEJBComponent(IVirtualComponent component) { - if (component.isBinary()) { - return EJBBinaryComponentHelper.handlesComponent(component); - } - return isProjectOfType(component.getProject(), EJB); - } - - public static boolean isEJBProject(IProject project) { - return isProjectOfType(project, EJB); - } - - public static boolean isJCAComponent(IVirtualComponent component) { - if (component.isBinary()) { - return JCABinaryComponentHelper.handlesComponent(component); - } - return isProjectOfType(component.getProject(), JCA); - } - - public static boolean isJCAProject(IProject project) { - return isProjectOfType(project, JCA); - } - - public static boolean isApplicationClientComponent(IVirtualComponent component) { - if (component.isBinary()) { - return AppClientBinaryComponentHelper.handlesComponent(component); - } - return isProjectOfType(component.getProject(), APPLICATION_CLIENT); - } - - public static boolean isApplicationClientProject(IProject project) { - return isProjectOfType(project, APPLICATION_CLIENT); - } - - public static boolean isUtilityProject(IProject project) { - return isProjectOfType(project, UTILITY); - } - - public static boolean isStandaloneProject(IProject project) { - return getReferencingEARProjects(project).length == 0; - } - - - - public static IProject[] getReferencingEARProjects(IProject project) { - if(project != null && isEARProject(project)){ - return new IProject[] {project}; - } - - List result = new ArrayList(); - IVirtualComponent component = ComponentCore.createComponent(project); - if (component != null) { - IVirtualComponent[] refComponents = component.getReferencingComponents(); - for (int i = 0; i < refComponents.length; i++) { - if (isEARProject(refComponents[i].getProject())) - result.add(refComponents[i].getProject()); - } - } - return (IProject[]) result.toArray(new IProject[result.size()]); - } - - /** - * Return all projects in workspace of the specified type - * - * @param type - - * use one of the static strings on this class as a type - * @return IProject[] - */ - public static IProject[] getAllProjectsInWorkspaceOfType(String type) { - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - List result = new ArrayList(); - for (int i = 0; i < projects.length; i++) { - if (isProjectOfType(projects[i], type)) - result.add(projects[i]); - } - return (IProject[]) result.toArray(new IProject[result.size()]); - } - - public static String getJ2EEComponentType(IVirtualComponent component) { - if (null != component) { - if (component.isBinary()) { - if (isApplicationClientComponent(component)) - return APPLICATION_CLIENT; - else if (isDynamicWebComponent(component)) - return DYNAMIC_WEB; - else if (isEJBComponent(component)) - return EJB; - else if (isJCAComponent(component)) - return JCA; - else - return UTILITY; - } - return getJ2EEProjectType(component.getProject()); - } - return ""; //$NON-NLS-1$ - } - - public static String getJ2EEProjectType(IProject project) { - if (null != project && project.isAccessible()) { - IFacetedProject facetedProject = null; - try { - facetedProject = ProjectFacetsManager.create(project); - } catch (CoreException e) { - return ""; //$NON-NLS-1$ - } - if (isApplicationClientProject(facetedProject)) - return APPLICATION_CLIENT; - else if (isDynamicWebProject(facetedProject)) - return DYNAMIC_WEB; - else if (isEJBProject(facetedProject)) - return EJB; - else if (isEARProject(facetedProject)) - return ENTERPRISE_APPLICATION; - else if (isJCAProject(facetedProject)) - return JCA; - else if (isStaticWebProject(facetedProject)) - return STATIC_WEB; - else if (isUtilityProject(facetedProject)) - return UTILITY; - } - return ""; //$NON-NLS-1$ - } - /** - * Returns the J2EE Module version based on the DD XML file - * @param project - * @return version String - */ - public static String getJ2EEDDProjectVersion(IProject project) { - int type = J2EEVersionConstants.UNKNOWN; - String ddURI = null; - if (J2EEProjectUtilities.isEARProject(project)) { - type = J2EEVersionConstants.APPLICATION_TYPE; - ddURI = J2EEConstants.APPLICATION_DD_URI; - } else if (J2EEProjectUtilities.isEJBProject(project)) { - type = J2EEVersionConstants.EJB_TYPE; - ddURI = J2EEConstants.EJBJAR_DD_URI; - } else if (J2EEProjectUtilities.isApplicationClientProject(project)) { - type = J2EEVersionConstants.APPLICATION_CLIENT_TYPE; - ddURI = J2EEConstants.APP_CLIENT_DD_URI; - } else if (J2EEProjectUtilities.isJCAProject(project)) { - type = J2EEVersionConstants.CONNECTOR_TYPE; - ddURI = J2EEConstants.RAR_DD_URI; - } else if (J2EEProjectUtilities.isDynamicWebProject(project)) { - type = J2EEVersionConstants.WEB_TYPE; - ddURI = J2EEConstants.WEBAPP_DD_URI; - } - - if(type != J2EEVersionConstants.UNKNOWN){ - IVirtualComponent comp = ComponentCore.createComponent(project); - if (comp != null) { - IVirtualFile vFile = comp.getRootFolder().getFile(new Path(ddURI)); - if(vFile.exists()){ - InputStream in= null; - try{ - in = vFile.getUnderlyingFile().getContents(); - JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(in); - int vers = (quickPeek.getVersion() == J2EEVersionConstants.UNKNOWN) ? getJEEVersion(project) : quickPeek.getVersion(); - return J2EEVersionUtil.convertVersionIntToString(vers); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } finally { - if(in != null){ - try { - in.close(); - } catch (IOException e) { - Logger.getLogger().logError(e); - } - } - } - - } - else - return J2EEVersionUtil.convertVersionIntToString(getJEEVersion(project)); - } - } - - return null; - } - - - private static int getJEEVersion(IProject project) { - if (isEARProject(project) || isApplicationClientProject(project)) - return J2EEVersionConstants.VERSION_5_0; - if (isEJBProject(project)) - return J2EEVersionConstants.VERSION_3_0; - if (isDynamicWebProject(project)) - return J2EEVersionConstants.VERSION_2_5; - return J2EEVersionConstants.UNKNOWN; - - } - - public static IRuntime getServerRuntime(IProject project) throws CoreException { - if (project == null) - return null; - IFacetedProject facetedProject = ProjectFacetsManager.create(project); - if (facetedProject == null) - return null; - org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime = facetedProject.getRuntime(); - if (runtime == null) - return null; - return FacetUtil.getRuntime(runtime); - } - - /** - * Returns the J2EE Module version based on the project Facet installed - * @param project - * @return version String - */ - public static String getJ2EEProjectVersion(IProject project) { - String type = getJ2EEProjectType(project); - IFacetedProject facetedProject = null; - IProjectFacet facet = null; - try { - facetedProject = ProjectFacetsManager.create(project); - facet = ProjectFacetsManager.getProjectFacet(type); - } catch (Exception e) { - // Not Faceted project or not J2EE Project - } - if (facet != null && facetedProject.hasProjectFacet(facet)) - return facetedProject.getInstalledVersion(facet).getVersionString(); - return null; - } - - public static JavaProjectMigrationOperation createFlexJavaProjectForProjectOperation(IProject project) { - IDataModel model = DataModelFactory.createDataModel(new JavaProjectMigrationDataModelProvider()); - model.setProperty(IJavaProjectMigrationDataModelProperties.PROJECT_NAME, project.getName()); - return new JavaProjectMigrationOperation(model); - } - - public static JavaProjectMigrationOperation createFlexJavaProjectForProjectOperation(IProject project, boolean addToEAR) { - IDataModel model = DataModelFactory.createDataModel(new JavaProjectMigrationDataModelProvider()); - model.setProperty(IJavaProjectMigrationDataModelProperties.PROJECT_NAME, project.getName()); - model.setBooleanProperty(IJavaProjectMigrationDataModelProperties.ADD_TO_EAR, addToEAR); - return new JavaProjectMigrationOperation(model); - } - - /** - * Retrieve all the source containers for a given virtual workbench component - * - * @param vc - * @return the array of IPackageFragmentRoots - */ - public static IPackageFragmentRoot[] getSourceContainers(IProject project) { - IJavaProject jProject = JemProjectUtilities.getJavaProject(project); - if (jProject == null) - return new IPackageFragmentRoot[0]; - List list = new ArrayList(); - IVirtualComponent vc = ComponentCore.createComponent(project); - IPackageFragmentRoot[] roots; - try { - roots = jProject.getPackageFragmentRoots(); - for (int i = 0; i < roots.length; i++) { - if (roots[i].getKind() != IPackageFragmentRoot.K_SOURCE) - continue; - IResource resource = roots[i].getResource(); - if (null != resource) { - IVirtualResource[] vResources = ComponentCore.createResources(resource); - boolean found = false; - for (int j = 0; !found && j < vResources.length; j++) { - if (vResources[j].getComponent().equals(vc)) { - if (!list.contains(roots[i])) - list.add(roots[i]); - found = true; - } - } - } - } - } catch (JavaModelException e) { - Logger.getLogger().logError(e); - } - return (IPackageFragmentRoot[]) list.toArray(new IPackageFragmentRoot[list.size()]); - } - - /** - * Retrieve all the output containers for a given virtual component. - * - * @param vc - * @return array of IContainers for the output folders - */ - public static IContainer[] getOutputContainers(IProject project) { - List result = new ArrayList(); - try { - if (!project.hasNature(JavaCore.NATURE_ID)) - return new IContainer[] {}; - } catch (Exception e) { - } - IPackageFragmentRoot[] sourceContainers = getSourceContainers(project); - for (int i = 0; i < sourceContainers.length; i++) { - IContainer outputFolder = getOutputContainer(project, sourceContainers[i]); - if (outputFolder != null && !result.contains(outputFolder)) - result.add(outputFolder); - } - return (IContainer[]) result.toArray(new IContainer[result.size()]); - } - - public static IContainer getOutputContainer(IProject project, IPackageFragmentRoot sourceContainer) { - try { - IJavaProject jProject = JavaCore.create(project); - IPath outputPath = sourceContainer.getRawClasspathEntry().getOutputLocation(); - if (outputPath == null) { - if (jProject.getOutputLocation().segmentCount() == 1) - return project; - return project.getFolder(jProject.getOutputLocation().removeFirstSegments(1)); - } - return project.getFolder(outputPath.removeFirstSegments(1)); - } catch (Exception e) { - } - return null; - } - - /** - * - * @param name - * @return - * @description the passed name should have either lib or var as its first segment e.g. - * lib/D:/foo/foo.jar or var/<CLASSPATHVAR>/foo.jar - */ - public static IPath getResolvedPathForArchiveComponent(String name) { - - URI uri = URI.createURI(name); - - String resourceType = uri.segment(0); - URI contenturi = ModuleURIUtil.trimToRelativePath(uri, 1); - String contentName = contenturi.toString(); - - if (resourceType.equals("lib")) { //$NON-NLS-1$ - // module:/classpath/lib/D:/foo/foo.jar - return Path.fromOSString(contentName); - - } else if (resourceType.equals("var")) { //$NON-NLS-1$ - - // module:/classpath/var/<CLASSPATHVAR>/foo.jar - String classpathVar = contenturi.segment(0); - URI remainingPathuri = ModuleURIUtil.trimToRelativePath(contenturi, 1); - String remainingPath = remainingPathuri.toString(); - - String[] classpathvars = JavaCore.getClasspathVariableNames(); - boolean found = false; - for (int i = 0; i < classpathvars.length; i++) { - if (classpathVar.equals(classpathvars[i])) { - found = true; - break; - } - } - if (found) { - IPath path = JavaCore.getClasspathVariable(classpathVar); - if (path != null ){ - URI finaluri = URI.createURI(path.toOSString() + IPath.SEPARATOR + remainingPath); - return Path.fromOSString(finaluri.toString()); - } - } - } - return null; - } - - public static List getAllJavaNonFlexProjects() throws CoreException { - List nonFlexJavaProjects = new ArrayList(); - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - for (int i = 0; i < projects.length; i++) { - if (projects[i].isAccessible() && projects[i].hasNature(JavaCore.NATURE_ID) && !projects[i].hasNature(IModuleConstants.MODULE_NATURE_ID)) { - nonFlexJavaProjects.add(projects[i]); - } - } - return nonFlexJavaProjects; - } - - /** - * This method will retrieve the context root for the associated workbench module which is used - * by the server at runtime. This method is not yet completed as the context root has to be - * abstracted and added to the workbenchModule model. This API will not change though. Returns - * null for now. - * - * @return String value of the context root for runtime of the associated module - */ - public static String getServerContextRoot(IProject project) { - return ComponentUtilities.getServerContextRoot(project); - } - - /** - * This method will set the context root on the associated workbench module with the given - * string value passed in. This context root is used by the server at runtime. This method is - * not yet completed as the context root still needs to be abstracted and added to the workbench - * module model. This API will not change though. Does nothing as of now. - * - * @param contextRoot - * string - */ - public static void setServerContextRoot(IProject project, String contextRoot) { - ComponentUtilities.setServerContextRoot(project, contextRoot); - } - - /** - * @param project - * @return true, if jee version 5.0 (or their respective ejb, web, app versions) - * , it must be noted that this method only looks at the facet & their versions to determine - * the jee level. It does not read deployment descriptors for performance reasons. - */ - public static boolean isJEEProject(IProject project){ - boolean ret = false; - - IFacetedProject facetedProject; - try { - facetedProject = ProjectFacetsManager.create(project); - if (facetedProject == null) - return false; - if(isEARProject(facetedProject)){ - IProjectFacet earFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EAR_MODULE); - ret = facetedProject.hasProjectFacet(earFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionConstants.JEE_5_0_ID))); - } else if(isDynamicWebProject(facetedProject)){ - IProjectFacet webFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE); - ret = facetedProject.hasProjectFacet(webFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToWebVersionID(J2EEVersionConstants.JEE_5_0_ID)))); - } else if(isEJBProject(facetedProject)){ - IProjectFacet ejbFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EJB_MODULE); - ret = facetedProject.hasProjectFacet(ejbFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToEJBVersionID(J2EEVersionConstants.JEE_5_0_ID)))); - } else if(isApplicationClientProject(facetedProject)){ - IProjectFacet appFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_APPCLIENT_MODULE); - ret = facetedProject.hasProjectFacet(appFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionConstants.JEE_5_0_ID))); - } - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return ret; - } - - /** - * @param project - * @return true, if j2ee version 1.2, 1.3, 1.4 (or their respective ejb, web, app versions) - * , it must be noted that this method only looks at the facet & their versions to determine - * the j2ee level. It does not read deployment descriptors for performance reasons. - */ - public static boolean isLegacyJ2EEProject(IProject project){ - boolean ret = false; - - IFacetedProject facetedProject; - try { - facetedProject = ProjectFacetsManager.create(project); - if (facetedProject == null) - return false; - - if(isEARProject(facetedProject)){ - IProjectFacet earFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EAR_MODULE); - ret = (facetedProject.hasProjectFacet(earFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionConstants.J2EE_1_4_ID))) - || facetedProject.hasProjectFacet(earFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionConstants.J2EE_1_3_ID))) - || facetedProject.hasProjectFacet(earFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionConstants.J2EE_1_2_ID))) - ); - } else if(isDynamicWebProject(facetedProject)){ - IProjectFacet webFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE); - ret = (facetedProject.hasProjectFacet(webFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToWebVersionID(J2EEVersionConstants.J2EE_1_4_ID)))) - || facetedProject.hasProjectFacet(webFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToWebVersionID(J2EEVersionConstants.J2EE_1_3_ID)))) - || facetedProject.hasProjectFacet(webFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToWebVersionID(J2EEVersionConstants.J2EE_1_2_ID)))) - ); - } else if(isEJBProject(facetedProject)){ - IProjectFacet ejbFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EJB_MODULE); - ret = (facetedProject.hasProjectFacet(ejbFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToEJBVersionID(J2EEVersionConstants.J2EE_1_4_ID)))) - || facetedProject.hasProjectFacet(ejbFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToEJBVersionID(J2EEVersionConstants.J2EE_1_3_ID)))) - || facetedProject.hasProjectFacet(ejbFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToEJBVersionID(J2EEVersionConstants.J2EE_1_2_ID)))) - ); - } else if(isApplicationClientProject(facetedProject)){ - IProjectFacet appFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_APPCLIENT_MODULE); - ret = (facetedProject.hasProjectFacet(appFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionConstants.J2EE_1_4_ID))) - || facetedProject.hasProjectFacet(appFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionConstants.J2EE_1_3_ID))) - || facetedProject.hasProjectFacet(appFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionConstants.J2EE_1_2_ID))) - ); - } else if(isJCAProject(facetedProject)){ - IProjectFacet jcaFacet = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_CONNECTOR_MODULE); - ret = (facetedProject.hasProjectFacet(jcaFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToConnectorVersionID(J2EEVersionConstants.J2EE_1_4_ID)))) - || facetedProject.hasProjectFacet(jcaFacet.getVersion(J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertJ2EEVersionIDToConnectorVersionID(J2EEVersionConstants.J2EE_1_3_ID)))) - ); - } else if(isUtilityProject(facetedProject)){ - // not sure if there is a better way - ret = true; - } - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return ret; - } - - /** - * This method will return the an IVirtualComponent for the given module name. The method take - * either moduleName or moduleName + ".module_extension" (module_extension = ".jar" || ".war" || - * ".rar") which allows users to get a IVirtualComponent for a given entry in an application.xml - * - * @return - a IVirtualComponent for module name - */ - public static IVirtualComponent getModule(IVirtualComponent earComponent, String moduleName) { - if (moduleName == null) - return null; - if (moduleName.endsWith(IJ2EEModuleConstants.JAR_EXT) || moduleName.endsWith(IJ2EEModuleConstants.WAR_EXT) || moduleName.endsWith(IJ2EEModuleConstants.RAR_EXT)) - moduleName = moduleName.substring(0, (moduleName.length() - IJ2EEModuleConstants.JAR_EXT.length())); - IVirtualReference[] references = getComponentReferences(earComponent); - for (int i = 0; i < references.length; i++) { - IVirtualComponent component = references[i].getReferencedComponent(); - if (component.getName().equals(moduleName)) { - return component; - } - } - return null; - } - - /** - * This method will return the list of IVirtualReferences for the J2EE module components - * contained in this EAR application. - * - * @return - an array of IVirtualReferences for J2EE modules in the EAR - */ - public static IVirtualReference[] getJ2EEModuleReferences(IVirtualComponent earComponent) { - List j2eeTypes = new ArrayList(); - j2eeTypes.add(J2EEProjectUtilities.APPLICATION_CLIENT); - j2eeTypes.add(J2EEProjectUtilities.JCA); - j2eeTypes.add(J2EEProjectUtilities.EJB); - j2eeTypes.add(J2EEProjectUtilities.DYNAMIC_WEB); - return getComponentReferences(earComponent, j2eeTypes); - } - - /** - * This method will return the list of IVirtualReferences for all of the components contained in - * an EAR application. - * - * @return - an array of IVirtualReferences for components in the EAR - */ - public static IVirtualReference[] getComponentReferences(IVirtualComponent earComponent) { - return getComponentReferences(earComponent, Collections.EMPTY_LIST); - } - - /** - * This method will return the IVirtualReference to the component of the given name - * - * @return - IVirtualReference or null if not found - */ - public static IVirtualReference getComponentReference(IVirtualComponent earComponent, String componentName) { - IVirtualReference[] refs = getComponentReferences(earComponent, Collections.EMPTY_LIST); - for (int i = 0; i < refs.length; i++) { - IVirtualReference reference = refs[i]; - if (reference.getReferencedComponent().getName().equals(componentName)) - return reference; - - } - return null; - } - - private static IVirtualReference[] getComponentReferences(IVirtualComponent earComponent, List componentTypes) { - List components = getComponentReferencesAsList(earComponent, componentTypes); - if(components.size() > 0) - return (IVirtualReference[]) components.toArray(new IVirtualReference[components.size()]); - return NO_REFERENCES; - } - - /** - * - * @param componentTypes - * @return A List of {@link IVirtualReference}s. - * - * This method is copied from EARArtifactEdit. Any bug fixes should occur in both locations. - */ - private static List getComponentReferencesAsList(IVirtualComponent earComponent, List componentTypes) { - List components = new ArrayList(); - if (earComponent != null && J2EEProjectUtilities.isEARProject(earComponent.getProject())) { - IVirtualReference[] refComponents = earComponent.getReferences(); - for (int i = 0; i < refComponents.length; i++) { - IVirtualComponent module = refComponents[i].getReferencedComponent(); - if (module == null) - continue; - // if component types passed in is null then return all components - if (componentTypes == null || componentTypes.size() == 0) - components.add(refComponents[i]); - else { - if (componentTypes.contains(J2EEProjectUtilities.getJ2EEComponentType(module))) { - components.add(refComponents[i]); - } - } - } - } - return components; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/ManifestFileCreationAction.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/ManifestFileCreationAction.java deleted file mode 100644 index 78e2cddfa..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/ManifestFileCreationAction.java +++ /dev/null @@ -1,41 +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.internal.project; - -import java.io.IOException; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jem.util.emf.workbench.WorkbenchByteArrayOutputStream; - -public class ManifestFileCreationAction { - - public static final String MANIFEST_HEADER = "Manifest-Version: 1.0\r\nClass-Path: \r\n\r\n"; //$NON-NLS-1$ - - /** - * Constructor for ManifestFileCreationAction. - */ - public ManifestFileCreationAction() { - super(); - } - - public static void createManifestFile(IFile file, IProject aJ2EEProject) throws CoreException, IOException { - try { - WorkbenchByteArrayOutputStream out = new WorkbenchByteArrayOutputStream(file); - out.write(MANIFEST_HEADER.getBytes()); - out.close(); - - } catch (IOException ioe) { - throw ioe; - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/ProjectSupportResourceHandler.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/ProjectSupportResourceHandler.java deleted file mode 100644 index 9da142847..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/ProjectSupportResourceHandler.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.project; - -import org.eclipse.osgi.util.NLS; - -public class ProjectSupportResourceHandler extends NLS { - private static final String BUNDLE_NAME = "projectsupport";//$NON-NLS-1$ - - private ProjectSupportResourceHandler() { - // Do not instantiate - } - - public static String Folder_name_cannot_be_the_same_as_Java_source_folder_5; - public static String Target_Update_Op; - public static String Operation_failed_due_to_SA_ERROR_; - public static String Creating_Web_Project____UI_; - public static String Could_not_rename_____2; - public static String A_web_project_must_be_open_and_must_exist_for_properties_to_be_edited_30; - public static String Operation_failed_due_to_IO_ERROR_; - public static String Cannot_clone_TaglibInfo_1_EXC_; - public static String Syntax_Error_in_the_links_UI_; - public static String Sync_WLP_Op; - public static String Generated_by_Web_Tooling_23; - public static String _1concat_EXC_; - public static String File_Serving_Enabler_7; - public static String Auto_Generated___File_Enabler_9; - public static String Not_a_web_project_29; - public static String Names_cannot_begin_or_end_with_whitespace_5; - public static String The_character_is_invalid_in_a_context_root; - public static String Folder_name_cannot_be_the_same_as_Java_class_folder_6; - public static String The_path_for_the_links_sta_EXC_; - public static String Operation_failed_due_to_Ja_ERROR_; - public static String Folder_name_cannot_be_empty_2; - public static String Error_importing_Module_Fil_EXC_; - public static String Operation_failed_due_to_Co_ERROR_; - public static String Folder_names_cannot_be_equal_4; - public static String Could_not_read_TLD_15; - public static String Folder_name_is_not_valid; - public static String Invalid_Servlet_Level_set_on_WebNature_3_EXC_; - public static String Context_Root_cannot_be_empty_2; - public static String Error_while_saving_links_s_EXC_; - public static String Sychronize_Class_Path_UI_; - public static String UNABLE_TO_LOAD_MODULE_ERROR_; - public static String Catalog_Lib_Directory__UI_; - public static String Update_ClassPath__UI_; - public static String Set_ClassPath__UI_; - public static String Names_cannot_contain_whitespace_; - public static String Importing_archive; - public static String Exporting_archive; - - - static { - NLS.initializeMessages(BUNDLE_NAME, ProjectSupportResourceHandler.class); - } - - public static String getString(String key, Object[] args) { - return NLS.bind(key, args); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/WTPJETEmitter.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/WTPJETEmitter.java deleted file mode 100644 index da8ccab00..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/WTPJETEmitter.java +++ /dev/null @@ -1,601 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Mar 17, 2004 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.project; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ProjectScope; -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.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.IScopeContext; -import org.eclipse.emf.codegen.CodeGenPlugin; -import org.eclipse.emf.codegen.jet.JETCompiler; -import org.eclipse.emf.codegen.jet.JETEmitter; -import org.eclipse.emf.codegen.jet.JETException; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaModel; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.launching.JavaRuntime; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPluginResourceHandler; -import org.eclipse.osgi.util.ManifestElement; -import org.osgi.framework.Bundle; -import org.osgi.framework.Constants; - -/** - * @author schacher, mdelder - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class WTPJETEmitter extends JETEmitter { - - public static final String PROJECT_NAME = ".JETEmitters"; //$NON-NLS-1$ - private Map variables; - - private boolean intelligentLinkingEnabled = false; - - private JETCompiler jetCompiler; - - /** - * @param templateURI - */ - public WTPJETEmitter(String templateURI) { - super(templateURI); - } - - /** - * @param templateURIPath - * @param relativeTemplateURI - */ - public WTPJETEmitter(String[] templateURIPath, String relativeTemplateURI) { - super(templateURIPath, relativeTemplateURI); - } - - /** - * @param templateURI - * @param classLoader - */ - public WTPJETEmitter(String templateURI, ClassLoader classLoader) { - super(templateURI, classLoader); - try { - initialize(new NullProgressMonitor()); - } catch (JETException e) { - e.printStackTrace(); - } - } - - /** - * @param templateURIPath - * @param relativeTemplateURI - * @param classLoader - */ - public WTPJETEmitter(String[] templateURIPath, String relativeTemplateURI, ClassLoader classLoader) { - super(templateURIPath, relativeTemplateURI, classLoader); - } - - /** - * @param templateURIPath - * @param relativeTemplateURI - * @param classLoader - * @param encoding - */ - public WTPJETEmitter(String[] templateURIPath, String relativeTemplateURI, ClassLoader classLoader, String encoding) { - super(templateURIPath, relativeTemplateURI, classLoader, encoding); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.codegen.jet.JETEmitter#initialize(org.eclipse.core.runtime.IProgressMonitor) - */ - public void initialize(IProgressMonitor progressMonitor) throws JETException { - - progressMonitor.beginTask("", 10); //$NON-NLS-1$ - progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_GeneratingJETEmitterFor_message", new Object[]{templateURI})); //$NON-NLS-1$ - - try { - // This ensures that the JRE variables are initialized. - try { - JavaRuntime.getDefaultVMInstall(); - } catch (Throwable throwable) { - // This is kind of nasty to come here. - URL jreURL = Platform.find(Platform.getBundle("org.eclipse.emf.codegen"),new Path("plugin.xml")); //$NON-NLS-1$ //$NON-NLS-2$ - IPath jrePath = new Path(Platform.asLocalURL(jreURL).getFile()); - jrePath = jrePath.removeLastSegments(1).append(new Path("../../jre/lib/rt.jar")); //$NON-NLS-1$ - if (!jrePath.equals(JavaCore.getClasspathVariable(JavaRuntime.JRELIB_VARIABLE))) { - JavaCore.setClasspathVariable(JavaRuntime.JRELIB_VARIABLE, jrePath, null); - } - } - - /* - * final JETCompiler jetCompiler = templateURIPath == null ? new - * MyJETCompiler(templateURI, encoding) : - */ - - getJetCompiler(); - - progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETParsing_message", new Object[]{jetCompiler.getResolvedTemplateURI()})); //$NON-NLS-1$ - jetCompiler.parse(); - progressMonitor.worked(1); - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - jetCompiler.generate(outputStream); - final InputStream contents = new ByteArrayInputStream(outputStream.toByteArray()); - - final IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IJavaModel javaModel = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); - if (!javaModel.isOpen()) { - javaModel.open(new SubProgressMonitor(progressMonitor, 1)); - } else { - progressMonitor.worked(1); - } - - final IProject project = workspace.getRoot().getProject(getProjectName()); - progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETPreparingProject_message", new Object[]{project.getName()})); //$NON-NLS-1$ - - IJavaProject javaProject; - if (!project.exists()) { - javaProject = createJavaProject(progressMonitor, workspace, project); - - initializeJavaProject(progressMonitor, project, javaProject); - - javaProject.close(); - } else { - project.open(new SubProgressMonitor(progressMonitor, 5)); - javaProject = JavaCore.create(project); - List rawClassPath = Arrays.asList(javaProject.getRawClasspath()); - for (int i=0; i<rawClassPath.size(); i++) { - IClasspathEntry entry = (IClasspathEntry) rawClassPath.get(i); - if (entry.getEntryKind()==IClasspathEntry.CPE_LIBRARY) - classpathEntries.add(entry); - } - } - - IPackageFragmentRoot sourcePackageFragmentRoot = openJavaProjectIfNecessary(progressMonitor, project, javaProject); - - String packageName = jetCompiler.getSkeleton().getPackageName(); - StringTokenizer stringTokenizer = new StringTokenizer(packageName, "."); //$NON-NLS-1$ - IProgressMonitor subProgressMonitor = new SubProgressMonitor(progressMonitor, 1); - subProgressMonitor.beginTask("", stringTokenizer.countTokens() + 4); //$NON-NLS-1$ - subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_CreateTargetFile_message")); //$NON-NLS-1$ - IContainer sourceContainer = (IContainer) sourcePackageFragmentRoot.getCorrespondingResource(); - while (stringTokenizer.hasMoreElements()) { - String folderName = stringTokenizer.nextToken(); - sourceContainer = sourceContainer.getFolder(new Path(folderName)); - if (!sourceContainer.exists()) { - ((IFolder) sourceContainer).create(false, true, new SubProgressMonitor(subProgressMonitor, 1)); - } - } - IFile targetFile = sourceContainer.getFile(new Path(jetCompiler.getSkeleton().getClassName() + ".java")); //$NON-NLS-1$ - if (!targetFile.exists()) { - subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreating_message", new Object[]{targetFile.getFullPath()})); //$NON-NLS-1$ - targetFile.create(contents, true, new SubProgressMonitor(subProgressMonitor, 1)); - } else { - subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", new Object[]{targetFile.getFullPath()})); //$NON-NLS-1$ - targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1)); - } - - boolean errors = performBuild(project, subProgressMonitor, targetFile); - - if (!errors) { - loadClass(workspace, project, javaProject, packageName, subProgressMonitor); - } - - subProgressMonitor.done(); - } catch (CoreException exception) { - throw new JETException(exception); - } catch (Exception exception) { - throw new JETException(exception); - } finally { - progressMonitor.done(); - } - - } - - /** - * @param progressMonitor - * @param project - * @param javaProject - * @return - * @throws JavaModelException - */ - protected IPackageFragmentRoot openJavaProjectIfNecessary(IProgressMonitor progressMonitor, final IProject project, IJavaProject javaProject) throws JavaModelException { - progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETOpeningJavaProject_message", new Object[]{project.getName()})); //$NON-NLS-1$ - javaProject.open(new SubProgressMonitor(progressMonitor, 1)); - - IPackageFragmentRoot[] packageFragmentRoots = javaProject.getPackageFragmentRoots(); - IPackageFragmentRoot sourcePackageFragmentRoot = null; - for (int j = 0; j < packageFragmentRoots.length; ++j) { - IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[j]; - if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_SOURCE) { - sourcePackageFragmentRoot = packageFragmentRoot; - break; - } - } - return sourcePackageFragmentRoot; - } - - /** - * @param progressMonitor - * @param project - * @param javaProject - * @throws CoreException - * @throws JavaModelException - */ - protected void initializeJavaProject(IProgressMonitor progressMonitor, final IProject project, IJavaProject javaProject) throws CoreException, JavaModelException { - progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETInitializingProject_message", new Object[]{project.getName()})); //$NON-NLS-1$ - IClasspathEntry classpathEntry = JavaCore.newSourceEntry(new Path("/" + project.getName() + "/src")); //$NON-NLS-1$ //$NON-NLS-2$ - - //IClasspathEntry jreClasspathEntry = JavaCore.newVariableEntry(new Path(JavaRuntime.JRELIB_VARIABLE), new Path(JavaRuntime.JRESRC_VARIABLE), new Path(JavaRuntime.JRESRCROOT_VARIABLE)); - IClasspathEntry jreClasspathEntry = JavaRuntime.getDefaultJREContainerEntry(); - - List classpath = new ArrayList(); - classpath.add(classpathEntry); - classpath.add(jreClasspathEntry); - classpath.addAll(classpathEntries); - - IFolder sourceFolder = project.getFolder(new Path("src")); //$NON-NLS-1$ - if (!sourceFolder.exists()) { - sourceFolder.create(false, true, new SubProgressMonitor(progressMonitor, 1)); - } - IFolder runtimeFolder = project.getFolder(new Path("runtime")); //$NON-NLS-1$ - if (!runtimeFolder.exists()) { - runtimeFolder.create(false, true, new SubProgressMonitor(progressMonitor, 1)); - } - - IClasspathEntry[] classpathEntryArray = (IClasspathEntry[]) classpath.toArray(new IClasspathEntry[classpath.size()]); - - javaProject.setRawClasspath(classpathEntryArray, new SubProgressMonitor(progressMonitor, 1)); - - javaProject.setOutputLocation(new Path("/" + project.getName() + "/runtime"), new SubProgressMonitor(progressMonitor, 1)); //$NON-NLS-1$ //$NON-NLS-2$ - - // appended from previous implementation - createClasspathEntries(project); - - IScopeContext context = new ProjectScope( project ); - IEclipsePreferences prefs = context.getNode( JavaCore.PLUGIN_ID ); - prefs.put( JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE ); - } - - /** - * @param progressMonitor - * @param workspace - * @param project - * @return - * @throws CoreException - */ - private IJavaProject createJavaProject(IProgressMonitor progressMonitor, final IWorkspace workspace, final IProject project) throws CoreException { - IJavaProject javaProject; - progressMonitor.subTask("JET creating project " + project.getName()); //$NON-NLS-1$ - project.create(new SubProgressMonitor(progressMonitor, 1)); - progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreatingProject_message", new Object[]{project.getName()})); //$NON-NLS-1$ - IProjectDescription description = workspace.newProjectDescription(project.getName()); - description.setNatureIds(new String[]{JavaCore.NATURE_ID}); - description.setLocation(null); - project.open(new SubProgressMonitor(progressMonitor, 1)); - project.setDescription(description, new SubProgressMonitor(progressMonitor, 1)); - - javaProject = JavaCore.create(project); - return javaProject; - } - - /** - * @param workspace - * @param project - * @param javaProject - * @param packageName - * @param subProgressMonitor - * @throws JavaModelException - * @throws MalformedURLException - * @throws ClassNotFoundException - * @throws SecurityException - */ - protected void loadClass(final IWorkspace workspace, final IProject project, IJavaProject javaProject, String packageName, IProgressMonitor subProgressMonitor) throws JavaModelException, MalformedURLException, ClassNotFoundException, SecurityException { - //IContainer targetContainer = - // workspace.getRoot().getFolder(javaProject.getOutputLocation()); - - subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", new Object[]{jetCompiler.getSkeleton().getClassName() + ".class"})); //$NON-NLS-1$ //$NON-NLS-2$ - - // Construct a proper URL for relative lookup. - // - URL url = new File(project.getLocation() + "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/").toURL(); //$NON-NLS-1$ //$NON-NLS-2$ - URLClassLoader theClassLoader = new URLClassLoader(new URL[]{url}, classLoader); - Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") + jetCompiler.getSkeleton().getClassName()); //$NON-NLS-1$ //$NON-NLS-2$ - String methodName = jetCompiler.getSkeleton().getMethodName(); - Method[] methods = theClass.getDeclaredMethods(); - for (int i = 0; i < methods.length; ++i) { - if (methods[i].getName().equals(methodName)) { - setMethod(methods[i]); - break; - } - } - } - - /** - * @param project - * @param subProgressMonitor - * @param targetFile - * @return - * @throws CoreException - */ - protected boolean performBuild(final IProject project, IProgressMonitor subProgressMonitor, IFile targetFile) throws CoreException { - subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", new Object[]{project.getName()})); //$NON-NLS-1$ - project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(subProgressMonitor, 1)); - - IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); - boolean errors = false; - for (int i = 0; i < markers.length; ++i) { - IMarker marker = markers[i]; - if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) { - errors = true; - subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " + (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[]{targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER)}))); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - return errors; - } - - /** - * Create the correct classpath entries for the given project - * - * @param project - */ - protected void createClasspathEntries(IProject project) { - Assert.isNotNull(project, "A valid project is required in order to append to a classpath"); //$NON-NLS-1$ - String variableName = null; - String pluginId = null; - for (Iterator variablesKeyIterator = getVariables().keySet().iterator(); variablesKeyIterator.hasNext();) { - variableName = (String) variablesKeyIterator.next(); - pluginId = (String) getVariables().get(variableName); - if (hasOutputDirectory(pluginId)) - addLinkedFolderAsLibrary(project, variableName, pluginId); - else - addRuntimeJarsAsLibrary(project, pluginId); - } - } - - /** - * @param pluginId - * @return - */ - protected boolean hasOutputDirectory(String pluginId) { - Bundle bundle = Platform.getBundle(pluginId); - URL outputDirectory = Platform.find(bundle,new Path("bin")); //$NON-NLS-1$ - if (outputDirectory == null) - return false; - URL installLocation = null; - try { - installLocation = Platform.asLocalURL(outputDirectory); - } catch (IOException e) { - Logger.getLogger().logWarning(J2EEPluginResourceHandler.getString("Install_Location_Error_", new Object[]{installLocation}) + e); //$NON-NLS-1$ - } - File outputDirectoryFile = new File(installLocation.getPath());// new File(location); - return outputDirectoryFile.canRead() && outputDirectoryFile.isDirectory() && outputDirectoryFile.listFiles().length > 0; - } - - /** - * @param project - * @param variableName - * @param pluginId - */ - protected void addRuntimeJarsAsLibrary(IProject project, String pluginId) { - ManifestElement[] elements = null; - Bundle bundle = Platform.getBundle(pluginId); - try { - String requires = (String) bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH); - elements = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, requires); - } catch (Exception e) { - Logger.getLogger().logError(e); - elements = new ManifestElement[0]; - } - IPath runtimeLibFullPath = null; - URL fullurl = null; - if (elements == null) { - if (bundle.getLocation().endsWith(".jar")) //$NON-NLS-1$ - runtimeLibFullPath = getJarredPluginPath(bundle); - appendToClassPath(runtimeLibFullPath,project); - return; - } - for (int i = 0; i < elements.length; i++) { - String value = elements[i].getValue(); - if (".".equals(value)) //$NON-NLS-1$ - value = "/"; //$NON-NLS-1$ - fullurl = Platform.getBundle(pluginId).getEntry(value); - // fix the problem with leading slash that caused dup classpath entries - if (fullurl==null) continue; - try { - runtimeLibFullPath = new Path(Platform.asLocalURL(fullurl).getPath()); - } catch (Exception e) { - Logger.getLogger().logError(e); - } - //TODO handle jar'ed plugins, this is a hack for now, need to find proper bundle API - if (bundle.getLocation().endsWith(".jar")) //$NON-NLS-1$ - runtimeLibFullPath = getJarredPluginPath(bundle); - if (!"jar".equals(runtimeLibFullPath.getFileExtension()) && !"zip".equals(runtimeLibFullPath.getFileExtension())) //$NON-NLS-1$ //$NON-NLS-2$ - continue; - appendToClassPath(runtimeLibFullPath,project); - } - } - - private void appendToClassPath(IPath runtimeLibFullPath, IProject project) { - IClasspathEntry entry = null; - entry = JavaCore.newLibraryEntry(runtimeLibFullPath, null,null,null,new IClasspathAttribute[]{},false); - try { - if (!classpathEntries.contains(entry)) - classpathEntries.add(entry); - //J2EEProjectUtilities.appendJavaClassPath(project, entry); - } catch (Exception e) { - Logger.getLogger().logError("Problem appending \"" + entry.getPath() + "\" to classpath of Project \"" + project.getName() + "\"."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - Logger.getLogger().logError(e); - } - } - - private IPath getJarredPluginPath(Bundle bundle) { - Path runtimeLibFullPath = null; - String jarPluginLocation = bundle.getLocation().substring(7); - Path jarPluginPath = new Path(jarPluginLocation); - // handle case where jars are installed outside of eclipse installation - if (jarPluginPath.isAbsolute()) - runtimeLibFullPath = jarPluginPath; - // handle normal case where all plugins under eclipse install - else { - String installPath = Platform.getInstallLocation().getURL().getPath(); - runtimeLibFullPath = new Path(installPath+"/"+jarPluginLocation); //$NON-NLS-1$ - } - return runtimeLibFullPath; - } - - /** - * @param progressMonitor - */ - protected void updateProgress(IProgressMonitor progressMonitor, String key) { - progressMonitor.subTask(getMessage(key)); - } - - /** - * @param progressMonitor - */ - protected void updateProgress(IProgressMonitor progressMonitor, String key, Object[] args) { - progressMonitor.subTask(getMessage(key, args)); - } - - protected String getMessage(String key) { - return CodeGenPlugin.getPlugin().getString(key); - } - - protected String getMessage(String key, Object[] args) { - return CodeGenPlugin.getPlugin().getString(key, args); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.codegen.jet.JETEmitter#addVariable(java.lang.String, java.lang.String) - */ - public void addVariable(String variableName, String pluginID) throws JETException { - if (!isIntelligentLinkingEnabled()) - super.addVariable(variableName, pluginID); - else { - getVariables().put(variableName, pluginID); - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IProject project = workspace.getRoot().getProject(getProjectName()); - if (project != null && project.exists()) - createClasspathEntries(project); - } - - } - - /** - * @return - */ - private boolean isIntelligentLinkingEnabled() { - return intelligentLinkingEnabled; - } - - /** - * @return - */ - private Map getVariables() { - if (variables == null) - variables = new HashMap(); - return variables; - } - - protected void addLinkedFolderAsLibrary(IProject project, String variableName, String pluginID) { - try { - URL outputDirectory = Platform.find(Platform.getBundle(pluginID),new Path("bin")); //$NON-NLS-1$ -// IPluginDescriptor pluginDescriptor = Platform.getPlugin(pluginID).getDescriptor(); -// URL outputDirectory = pluginDescriptor.find(new Path("bin")); //$NON-NLS-1$ - String pathString = Platform.asLocalURL(outputDirectory).getPath(); - if (pathString.endsWith("/")) //$NON-NLS-1$ - pathString = pathString.substring(0, pathString.length() - 1); - if (pathString.startsWith("/")) //$NON-NLS-1$ - pathString = pathString.substring(1, pathString.length()); - IPath path = new Path(pathString).makeAbsolute(); - - String binDirectoryVariable = variableName + "_BIN"; //$NON-NLS-1$ - IFolder linkedDirectory = project.getFolder(binDirectoryVariable); - if (!linkedDirectory.exists()) { - linkedDirectory.createLink(path, IResource.ALLOW_MISSING_LOCAL, null); - linkedDirectory.setDerived(true); - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - IClasspathEntry entry = JavaCore.newLibraryEntry(linkedDirectory.getFullPath(), null,null,null,new IClasspathAttribute[]{},false); - - if (!classpathEntries.contains(entry)) - classpathEntries.add(entry); - //J2EEProjectUtilities.appendJavaClassPath(project, entry); - - } catch (Exception e) { - Logger.getLogger().logError(e); - } - } - - /** - * @param intelligentLinkingEnabled - * The intelligentLinkingEnabled to set. - */ - public void setIntelligentLinkingEnabled(boolean intelligentLinkingEnabled) { - this.intelligentLinkingEnabled = intelligentLinkingEnabled; - } - - protected JETCompiler getJetCompiler() { - try { - if (jetCompiler == null) { - jetCompiler = templateURIPath == null ? new MyJETCompiler(templateURI, encoding) : new MyJETCompiler(templateURIPath, templateURI, encoding); - } - } catch (JETException e) { - Logger.getLogger().logError(e); - } - return jetCompiler; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/test.jpage b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/test.jpage deleted file mode 100644 index e69de29bb..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/project/test.jpage +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/rename/ClasspathRenameInfo.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/rename/ClasspathRenameInfo.java deleted file mode 100644 index ba2780c43..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/rename/ClasspathRenameInfo.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.internal.rename; - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; - -/** - * A simple structure that remembers for a given project, the manifest entries to be deleted and the - * build path entries to be deleted - */ -public class ClasspathRenameInfo { - /** - * The project from which the dependencies will be removed - */ - protected IProject targetProject; - /** - * The literal manifest entries to be removed; String - */ - protected List manifestEntries; - /** - * The project references to be removed from the build path; IProject - */ - protected List referencedProjects; - - public ClasspathRenameInfo(IProject project) { - super(); - targetProject = project; - } - - /** - * Gets the manifestEntries. - * - * @return Returns a List - */ - public List getManifestEntries() { - if (manifestEntries == null) - manifestEntries = new ArrayList(); - return manifestEntries; - } - - - /** - * Gets the referencedProjects. - * - * @return Returns a List - */ - public List getReferencedProjects() { - if (referencedProjects == null) - referencedProjects = new ArrayList(); - return referencedProjects; - } - - - /** - * Gets the targetProject. - * - * @return Returns a IProject - */ - public IProject getTargetProject() { - return targetProject; - } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/rename/RenameOptions.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/rename/RenameOptions.java deleted file mode 100644 index 3041a2415..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/rename/RenameOptions.java +++ /dev/null @@ -1,165 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.internal.rename; - - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class RenameOptions { - protected boolean isEARRename; - protected boolean renameProjects; - protected boolean renameModules; - protected boolean renameModuleDependencies; - protected List selectedProjects; - /** Applicable for EAR rename */ - protected List selectedReferencedProjects; - protected String newName = null; - protected String newContextRoot = null; - protected boolean bogus; - - /** - * Constructor for RenameOptions. - */ - public RenameOptions() { - super(); - } - - - public boolean shouldRenameModules() { - return renameModules; - } - - - public void setRenameModules(boolean renameModulesFromAllEARs) { - this.renameModules = renameModulesFromAllEARs; - } - - - public boolean shouldRenameProjects() { - return renameProjects; - } - - - public void setRenameProjects(boolean renameProjects) { - this.renameProjects = renameProjects; - } - - - public boolean shouldRenameModuleDependencies() { - return renameModuleDependencies; - } - - - public void setRenameModuleDependencies(boolean renameReferencesFromModuleDependencies) { - this.renameModuleDependencies = renameReferencesFromModuleDependencies; - } - - public List getModuleAndUtilityProjects() { - if (isEARRename) - return getSelectedReferencedProjects(); - return getSelectedProjects(); - } - - public List getAllProjectsToRename() { - List result = new ArrayList(); - result.addAll(getSelectedProjects()); - result.addAll(getSelectedReferencedProjects()); - return result; - } - - /** - * Gets the selectedProjects. - * - * @return Returns a List - */ - public List getSelectedProjects() { - if (selectedProjects == null) - return Collections.EMPTY_LIST; - return selectedProjects; - } - - /** - * Sets the selectedProjects. - * - * @param selectedProjects - * The selectedProjects to set - */ - public void setSelectedProjects(List selectedProjects) { - this.selectedProjects = selectedProjects; - } - - /** - * Gets the selectedReferencedProjects. - * - * @return Returns a List - */ - public List getSelectedReferencedProjects() { - if (selectedReferencedProjects == null) - return Collections.EMPTY_LIST; - return selectedReferencedProjects; - } - - /** - * Sets the selectedReferencedProjects. - * - * @param selectedReferencedProjects - * The selectedReferencedProjects to set - */ - public void setSelectedReferencedProjects(List selectedReferencedProjects) { - this.selectedReferencedProjects = selectedReferencedProjects; - } - - public boolean isEARRename() { - return isEARRename; - } - - public void setIsEARRename(boolean isEARRename) { - this.isEARRename = isEARRename; - } - - /** - * Gets the newName. - * - * @return Returns a String - */ - public String getNewName() { - return newName; - } - - /** - * Sets the newName. - * - * @param newName - * The newName to set - */ - public void setNewName(String newName) { - this.newName = newName; - } - - /** - * Gets the newContextRoot. - * - * @return Returns a String - */ - public String getNewContextRoot() { - return newContextRoot; - } - - /** - * Sets the newContextRoot. - * - * @param newContextRoot - * The newContextRoot to set - */ - public void setNewContextRoot(String newContextRoot) { - this.newContextRoot = newContextRoot; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/IServerTargetConstants.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/IServerTargetConstants.java deleted file mode 100644 index d54ae2061..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/IServerTargetConstants.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Aug 6, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.servertarget; - - -/** - * @author vijayb - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public interface IServerTargetConstants { - String EAR_TYPE = "j2ee.ear"; //$NON-NLS-1$ - String WEB_TYPE = "j2ee.web"; //$NON-NLS-1$ - String WEB_PORTAL_TYPE = "j2ee.web.portal"; //$NON-NLS-1$ - String EJB_TYPE = "j2ee.ejb"; //$NON-NLS-1$ - String APP_CLIENT_TYPE = "j2ee.appclient"; //$NON-NLS-1$ - String CONNECTOR_TYPE = "j2ee.connector"; //$NON-NLS-1$ - String J2EE_12 = "1.2"; //$NON-NLS-1$ - String J2EE_13 = "1.3"; //$NON-NLS-1$ - String J2EE_14 = "1.4"; //$NON-NLS-1$ - String SERVER_FILE_NAME = ".server"; //$NON-NLS-1$ - String aesV4ServerTargetId = "com.ibm.etools.websphere.aes.v4";//$NON-NLS-1$ - String v5ServerTargetId = "com.ibm.etools.websphere.serverTarget.base.v5";//$NON-NLS-1$ - String v51ServerTargetId = "com.ibm.etools.websphere.serverTarget.base.v51";//$NON-NLS-1$ - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/ITargetRuntimeExtensionHandler.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/ITargetRuntimeExtensionHandler.java deleted file mode 100644 index 5b7882d8c..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/ITargetRuntimeExtensionHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Feb 5, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.servertarget; - -import org.eclipse.core.resources.IProject; - -/** - * @author vijayb - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public interface ITargetRuntimeExtensionHandler { - public boolean removeTargetRuntimeClasspath(IProject project); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/J2EEProjectServerTargetDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/J2EEProjectServerTargetDataModelProvider.java deleted file mode 100644 index 1a5802930..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/J2EEProjectServerTargetDataModelProvider.java +++ /dev/null @@ -1,299 +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.internal.servertarget; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EECreationResourceHandler; -import org.eclipse.jst.j2ee.project.datamodel.properties.IJ2EEProjectServerTargetDataModelProperties; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.ServerUtil; -import org.eclipse.wst.server.core.internal.ResourceManager; - -public class J2EEProjectServerTargetDataModelProvider extends AbstractDataModelProvider implements IJ2EEProjectServerTargetDataModelProperties { - - private static final String DEFAULT_TARGET_ID = "org.eclipse.jst.server.core.runtimeType"; //$NON-NLS-1$ - - public void init() { - model.setProperty(RUNTIME_TARGET_ID, getDefaultServerTargetID()); - super.init(); - } - - public IDataModelOperation getDefaultOperation() { - return new J2EEProjectServerTargetOp(model); - } - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PROJECT_NAME); - propertyNames.add(RUNTIME_TARGET_ID); - propertyNames.add(J2EE_VERSION_ID); - propertyNames.add(DEPLOYMENT_TYPE_ID); - propertyNames.add(UPDATE_MODULES); - return propertyNames; - } - - public IProject getProject() { - String name = (String) getProperty(PROJECT_NAME); - if (name != null && name.length() > 0) - return ResourcesPlugin.getWorkspace().getRoot().getProject(name); - return null; - } - - public IRuntime getRuntimeTarget() { - String serverTargetId = (String) getProperty(RUNTIME_TARGET_ID); - return ResourceManager.getInstance().getRuntime(serverTargetId); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#getDefaultProperty(java.lang.String) - */ - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(RUNTIME_TARGET_ID)) - return getDefaultServerTargetID(); - else if (propertyName.equals(J2EE_VERSION_ID)) - return getDefaultVersionID(); - else if (propertyName.equals(UPDATE_MODULES)) { - return Boolean.TRUE; - } - return super.getDefaultProperty(propertyName); - } - - private Integer getDefaultVersionID() { - return new Integer(J2EEVersionConstants.J2EE_1_4_ID); - } - - /** - * @return - */ - private Object getDefaultServerTargetID() { - List targets = getValidServerTargets(); - if (!targets.isEmpty()) { - IRuntime target = null; - for (int i = targets.size() - 1; i < targets.size() && i >= 0; i--) { - target = (IRuntime) targets.get(i); - if (DEFAULT_TARGET_ID.equals(target.getId())) - return target.getId(); - } - if (target != null) - return target.getId(); - } - return null; - } - - /** - * This should only be used by clients that need to interact with the Server tooling directly. - * The return value corresponds to the type id associated with a runtime target. - * - * @return - */ - public String computeTypeId() { - int type = -1; - if (getDataModel().isPropertySet(DEPLOYMENT_TYPE_ID)) - type = getIntProperty(DEPLOYMENT_TYPE_ID); - // else { - // J2EENature nature = J2EENature.getRegisteredRuntime(getProject()); - // if (nature != null) - // type = nature.getDeploymentDescriptorType(); - // else - // type = getIntProperty(DEPLOYMENT_TYPE_ID); - // } - return computeTypeId(type); - } - - /** - * @param deploymentDescriptorType2 - * @return - */ - private String computeTypeId(int deploymentDescriptorType) { - switch (deploymentDescriptorType) { - case XMLResource.APPLICATION_TYPE : - return IServerTargetConstants.EAR_TYPE; - case XMLResource.APP_CLIENT_TYPE : - return IServerTargetConstants.APP_CLIENT_TYPE; - case XMLResource.EJB_TYPE : - return IServerTargetConstants.EJB_TYPE; - case XMLResource.WEB_APP_TYPE : - return IServerTargetConstants.WEB_TYPE; - case XMLResource.RAR_TYPE : - return IServerTargetConstants.CONNECTOR_TYPE; - } - return null; - } - - /** - * This is only to be used by clients that need to interact with the Server tooling directly. - * The return value corresponds to the version id associated with a runtime target. - */ - public String computeVersionId() { - int version = -1; - if (getDataModel().isPropertySet(J2EE_VERSION_ID)) - version = getIntProperty(J2EE_VERSION_ID); - // else { - // J2EENature nature = J2EENature.getRegisteredRuntime(getProject()); - // if (nature != null) - // version = nature.getJ2EEVersion(); - // else - // version = getIntProperty(J2EE_VERSION_ID); - // } - return computeVersionId(version); - } - - /** - * @param version - * @return - */ - private String computeVersionId(int version) { - switch (version) { - case J2EEVersionConstants.J2EE_1_2_ID : - return IServerTargetConstants.J2EE_12; - case J2EEVersionConstants.J2EE_1_3_ID : - return IServerTargetConstants.J2EE_13; - case J2EEVersionConstants.J2EE_1_4_ID : - return IServerTargetConstants.J2EE_14; - } - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#doGetValidPropertyValues(java.lang.String) - */ - public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { - if (propertyName.equals(RUNTIME_TARGET_ID)) - return getValidServerTargetDescriptors(); - return super.getValidPropertyDescriptors(propertyName); - } - - private DataModelPropertyDescriptor[] getValidServerTargetDescriptors() { - List targets = getValidServerTargets(); - DataModelPropertyDescriptor[] descriptors = null; - if (!targets.isEmpty()) { - int serverTargetListSize = targets.size(); - descriptors = new DataModelPropertyDescriptor[serverTargetListSize]; - for (int i = 0; i < targets.size(); i++) { - IRuntime runtime = (IRuntime) targets.get(i); - descriptors[i] = new DataModelPropertyDescriptor(runtime.getId(), runtime.getName()); - } - } else { - descriptors = new DataModelPropertyDescriptor[0]; - } - return descriptors; - } - - public boolean propertySet(String propertyName, Object propertyValue) { - if (propertyName.equals(J2EE_VERSION_ID)) { - IRuntime target = getServerTargetByID(getStringProperty(RUNTIME_TARGET_ID)); - if (target == null) - setProperty(RUNTIME_TARGET_ID, null); - model.notifyPropertyChange(RUNTIME_TARGET_ID, IDataModel.VALID_VALUES_CHG); - } else if (RUNTIME_TARGET_ID.equals(propertyName)) { - setProperty(RUNTIME_TARGET_ID, propertyValue); - } - return true; - } - - - private IRuntime getServerTargetByID(String id) { - List targets = getValidServerTargets(); - IRuntime target; - for (int i = 0; i < targets.size(); i++) { - target = (IRuntime) targets.get(i); - if (id.equals(target.getId())) - return target; - } - return null; - } - - /** - * @return - */ - private List getValidServerTargets() { - List validServerTargets = null; - // TODO: api is needed from the server target helper to get all server targets - // validServerTargets = ServerTargetHelper.getServerTargets(IServerTargetConstants.EAR_TYPE, - // IServerTargetConstants.J2EE_14); - validServerTargets = getServerTargets("", ""); //$NON-NLS-1$ //$NON-NLS-2$ - if (validServerTargets != null && validServerTargets.isEmpty()) - validServerTargets = null; - if (validServerTargets == null) - return Collections.EMPTY_LIST; - return validServerTargets; - } - - public static List getServerTargets(String type, String version) { - List targets = Arrays.asList(ServerUtil.getRuntimes(type, version)); - return targets; - } - - /** - * @return - */ - // private List getValidServerTargets() { - // List validServerTargets = null; - // String type = computeTypeId(); - // if (type != null) { - // String version = computeVersionId(); - // if (version != null) { - // validServerTargets = ServerTargetHelper.getServerTargets(type, version); - // if (validServerTargets != null && validServerTargets.isEmpty()) - // validServerTargets = null; - // } - // } - // if (validServerTargets == null) - // return Collections.EMPTY_LIST; - // return validServerTargets; - // } - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#doValidateProperty(java.lang.String) - */ - public IStatus validate(String propertyName) { - if (propertyName.equals(RUNTIME_TARGET_ID)) - return validateServerTarget(); - return super.validate(propertyName); - } - - /** - * @return - */ - private IStatus validateServerTarget() { - List targets = getValidServerTargets(); - if (targets.isEmpty()) { - return J2EEPlugin.newErrorStatus(J2EECreationResourceHandler.ServerTargetDataModel_UI_7, null); - } - IRuntime target = getRuntimeTarget(); - if (target == null) { - return J2EEPlugin.newErrorStatus(J2EECreationResourceHandler.ServerTargetDataModel_UI_8, null); - } else if (!targets.contains(target)) { - return J2EEPlugin.newErrorStatus(J2EECreationResourceHandler.ServerTargetDataModel_UI_9, null); - } - return OK_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/J2EEProjectServerTargetOp.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/J2EEProjectServerTargetOp.java deleted file mode 100644 index 215063985..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/J2EEProjectServerTargetOp.java +++ /dev/null @@ -1,70 +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.internal.servertarget; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.project.datamodel.properties.IJ2EEProjectServerTargetDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.internal.ResourceManager; - -public class J2EEProjectServerTargetOp extends AbstractDataModelOperation { - - /** - * @param operationDataModel - */ - public J2EEProjectServerTargetOp(IDataModel model) { - super(model); - // TODO Auto-generated constructor stub - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - String serverTargetId = model.getStringProperty(IJ2EEProjectServerTargetDataModelProperties.RUNTIME_TARGET_ID); - IRuntime runtime = ResourceManager.getInstance().getRuntime(serverTargetId); - IProject project = null; - String name = model.getStringProperty(IJ2EEProjectServerTargetDataModelProperties.PROJECT_NAME); - if (name != null && name.length() > 0) - project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); - if (runtime != null && project != null) { - try { - //ServerCore.getProjectProperties(project).setRuntimeTarget(runtime, monitor); - if (model.getBooleanProperty(IJ2EEProjectServerTargetDataModelProperties.UPDATE_MODULES) - && project.hasNature(IModuleConstants.MODULE_NATURE_ID)) { - //ServerTargetHelper.setNewServerTargetForEARModules(runtime, project); - //ServerTargetHelper.setNewServerTargetForEARUtilityJars(runtime, project); - } - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - return OK_STATUS; - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/ServerTargetHelper.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/ServerTargetHelper.java deleted file mode 100644 index 879a73588..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/ServerTargetHelper.java +++ /dev/null @@ -1,476 +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 - *******************************************************************************/ -/* - * Created on Aug 15, 2003 - * - * To change the template for this generated file go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.servertarget; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.server.core.ServerUtil; - -//import com.ibm.etools.j2ee.internal.project.EAREditModel; -//import com.ibm.etools.j2ee.internal.project.EARNatureRuntime; - -/** - * @author vijayb - * @deprecated - Use server core api to set Runtime Targets. Use artifact edit api to - * get to any j2ee related methods in the class. - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public class ServerTargetHelper { - public static final String JAVA_NATURE_ID = "org.eclipse.jdt.core.javanature"; //$NON-NLS-1$ - - public static final String SERVER_CONTAINER = "org.eclipse.jst.server.core.container"; //$NON-NLS-1$ - - /** - * - */ - public ServerTargetHelper() { - super(); - // TODO Auto-generated constructor stub - } - - public static void cleanUpNonServerTargetClasspath(IProject project) { - List existingClasspathEntries = ServerTargetHelper.getExistingNonServerTargetClasspath(project); - if (!existingClasspathEntries.isEmpty()) - ServerTargetHelper.removeNonSeverTargetClasspathEntries(project, existingClasspathEntries); - } - - /** - * @param existingClasspathEntries - */ - public static void removeNonSeverTargetClasspathEntries(IProject project, List existingClasspathEntries) { - try { - JemProjectUtilities.removeFromJavaClassPath(project, existingClasspathEntries); - } catch (JavaModelException jme) { - Logger.getLogger().logError(jme); - } - } - - /** - * @param project - */ - // public static void syncNoServerTargetForEARModules(IProject project) { - // removeServerTargetForEARModuleProjects(project); - // removeServerTargetForEARUtilsProject(project); - // } - /** - * @param project - */ - // public static void removeServerTargetForEAR(IProject project, boolean - // updateModules) { - // //We don't need to remove a server target anyomre as it need to be - // // there - // //ServerTargetManager.removeServerTarget(project, null); - // if (updateModules) { - // removeServerTargetForEARModuleProjects(project); - // removeServerTargetForEARUtilsProject(project); - // } - // } - /** - * @param project - */ - // private static void removeServerTargetForEARModuleProjects(IProject - // project) { - // List moduleProjects = - // ServerTargetHelper.getAllEarModuleProjects(project); - // if (!moduleProjects.isEmpty()) { - // for (int i = 0; i < moduleProjects.size(); i++) { - // IProject moduleProject = (IProject) moduleProjects.get(i); - // ServerTargetType tt = - // ServerTargetManager.getServerTargetType(moduleProject); - // if (tt != null) { - // J2EEJavaProjectInfo info = getNewJ2EEProjectInfo(moduleProject); - // if (info != null) { - // info.setProject(moduleProject); - // try { - // info.calculateServerClasspathEntries(); - // info.getJavaProject().setRawClasspath(info.getClasspathEntries(), null); - // } catch (JavaModelException jme) { - // Logger.getLogger().logTrace(jme); - // } - // } - // } - // } - // } - // } - /** - * @param project - */ - // private static void removeServerTargetForEARUtilsProject(IProject - // project) { - // EARNatureRuntime nature = EARNatureRuntime.getRuntime(project); - // EAREditModel editModel = null; - // Object key = new ServerTargetHelper(); - // try { - // editModel = nature.getEarEditModelForRead(key); - // List utilProjects = - // ServerTargetHelper.getAllEarUtilityProjects(editModel, project); - // if (!utilProjects.isEmpty()) { - // for (int i = 0; i < utilProjects.size(); i++) { - // IProject moduleProject = (IProject) utilProjects.get(i); - // //We don't need to remove a server target anyomre as it need to be there - // //ServerTargetType existingTargetType = - // // ServerTargetManager.getServerTargetType(moduleProject); - // //if (existingTargetType != null) { - // //if (!editModel.isEjbClientJarProject(moduleProject)) - // //We don't need to remove a server target anyomre as it - // // need to be there - // //ServerTargetManager.removeServerTarget(moduleProject,null); - // //else - // // removeServerTargetForEJBClientJar(moduleProject); - // } - // } - // } finally { - // editModel.releaseAccess(key); - // } - // } - /** - * @param moduleProject - */ - // public static void removeServerTargetForEJBClientJar(IProject - // ejbClientJarProject) { - // EjbModuleExtension ejbExt = EarModuleManager.getEJBModuleExtension(); - // J2EEJavaProjectInfo info = ejbExt.createProjectInfo(); - // if (info != null) { - // info.setProject(ejbClientJarProject); - // try { - // info.calculateServerClasspathEntries(); - // info.getJavaProject().setRawClasspath(info.getClasspathEntries(), null); - // } catch (JavaModelException jme) { - // Logger.getLogger().logTrace(jme); - // } - // } - // } - // public static void removeServerTargetOnProject(IProject project, String - // projectType) { - // setServerClassPathForJ2EEProject(project, projectType); - // } - /** - * @param project - */ - // public static void setServerClassPathForJ2EEProject(IProject project, - // String projectType) { - // try { - // J2EEJavaProjectInfo info = getNewJ2EEProjectInfo(project, projectType); - // if (info != null) { - // info.setProject(project); - // info.calculateServerClasspathEntries(); - // info.getJavaProject().setRawClasspath(info.getClasspathEntries(), null); - // } - // } catch (JavaModelException jme) { - // Logger.getLogger().logError(jme); - // } - // } - // public static J2EEJavaProjectInfo getNewJ2EEProjectInfo(IProject project, - // String projectType) - // { - // if (projectType.equals(IServerTargetConstants.APP_CLIENT_TYPE)) - // return new ApplicationClientProjectInfo(); - // else if (projectType.equals(IServerTargetConstants.WEB_TYPE)) { - // WebModuleExtension webExt = EarModuleManager.getWebModuleExtension(); - // J2EEJavaProjectInfo info = webExt.createProjectInfo(); - // String webNature = J2EENature.getRegisteredRuntimeID(project); - // info.setJ2EEVersion(webNature.equals(J2EEVersionConstants.VERSION_1_3_TEXT) - // ? - // J2EEVersionConstants.J2EE_1_3_ID : J2EEVersionConstants.J2EE_1_2_ID); - // return info; - // } else if (projectType.equals(IServerTargetConstants.EJB_TYPE)) { - // EjbModuleExtension ejbExt = EarModuleManager.getEJBModuleExtension(); - // return ejbExt.createProjectInfo(); - // } else if (projectType.equals(IServerTargetConstants.CONNECTOR_TYPE)) { - // JcaModuleExtension jcaExt = EarModuleManager.getJCAModuleExtension(); - // return jcaExt.createProjectInfo(); - // } - // return null; - // } - // public static J2EEJavaProjectInfo getNewJ2EEProjectInfo(IProject project) - // { - // if (J2EENature.hasRuntime(project, IEJBNatureConstants.EJB_NATURE_IDS)) { - // EjbModuleExtension ejbExt = EarModuleManager.getEJBModuleExtension(); - // return ejbExt.createProjectInfo(); - // } else if (J2EENature.hasRuntime(project, - // IWebNatureConstants.J2EE_NATURE_ID)) { - // WebModuleExtension webExt = EarModuleManager.getWebModuleExtension(); - // return webExt.createProjectInfo(); - // } else if (ApplicationClientNatureRuntime.hasRuntime(project)) - // return new ApplicationClientProjectInfo(); - // else if (J2EENature.hasRuntime(project, - // IConnectorNatureConstants.CONNECTOR_NATURE_ID)) { - // JcaModuleExtension jcaExt = EarModuleManager.getJCAModuleExtension(); - // return jcaExt.createProjectInfo(); - // } - // return null; - // } -// public static void setNewServerTargetForEARModules(IRuntime newServerTarget, IProject project) { -// List moduleProjects = ServerTargetHelper.getAllEarModuleProjects(project); -// if (!moduleProjects.isEmpty()) { -// for (int i = 0; i < moduleProjects.size(); i++) { -// IProject moduleProject = (IProject) moduleProjects.get(i); -// String[] projectAttr = ServerTargetHelper.getProjectTypeAndJ2EELevel(moduleProject); -// if (projectAttr[0] != null && projectAttr[1] != null) { -// IRuntime existingTargetType = ServerCore.getProjectProperties(moduleProject).getRuntimeTarget(); -// if (existingTargetType != null) { -// if (!existingTargetType.getId().equals(newServerTarget.getId())) -// setServerTargetForModuleProject(newServerTarget, moduleProject, projectAttr); -// // TODO Move the WLP sync to this method -// } else -// setServerTargetForModuleProject(newServerTarget, moduleProject, projectAttr); -// } -// } -// } -// } - -// public static void setServerTargetForModuleProject(IRuntime newServerTarget, IProject moduleProject, String[] projectAttr) { -// ServerTargetHelper.cleanUpNonServerTargetClasspath(moduleProject); -// setServerTarget(moduleProject, newServerTarget, null); -// } - -// public static List getWebProjectsInEAR(IProject earProject) { -// List moduleProjects = ServerTargetHelper.getAllEarModuleProjects(earProject); -// if (!moduleProjects.isEmpty()) { -// List webProjects = new ArrayList(); -// for (int i = 0; i < moduleProjects.size(); i++) { -// IProject project = (IProject) moduleProjects.get(i); -// WebModuleExtension webExt = EarModuleManager.getWebModuleExtension(); -// if (webExt.hasRuntime(project)) -// webProjects.add(project); -// } -// return webProjects; -// } -// return Collections.EMPTY_LIST; -// } - - /** - * @param newServerTarget - * @param tt - * @param project - */ -// public static void setNewServerTargetForEARUtilityJars(IRuntime newServerTarget, IProject project) { -// EARNatureRuntime nature = EARNatureRuntime.getRuntime(project); -// EAREditModel editModel = null; -// Object key = new ServerTargetHelper(); -// try { -// editModel = nature.getEarEditModelForRead(key); -// List utilProjects = ServerTargetHelper.getAllEarUtilityProjects(editModel, project); -// if (!utilProjects.isEmpty()) { -// for (int i = 0; i < utilProjects.size(); i++) { -// IProject moduleProject = (IProject) utilProjects.get(i); -// IRuntime existingTargetType = ServerCore.getProjectProperties(moduleProject).getRuntimeTarget(); -// if (existingTargetType != null) { -// if (!existingTargetType.getId().equals(newServerTarget.getId())) { -// setServerTargetForUtilProject(newServerTarget, moduleProject); -// } -// } else { -// setServerTargetForUtilProject(newServerTarget, moduleProject); -// } -// } -// } -// } finally { -// editModel.releaseAccess(key); -// } -// } - -// public static void setServerTargetForUtilProject(IRuntime newServerTarget, IProject moduleProject) { -// ServerTargetHelper.cleanUpNonServerTargetClasspath(moduleProject); -// setServerTarget(moduleProject, newServerTarget, null); -// } - -// public static void setServerTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) { -// try { -// ServerCore.getProjectProperties(project).setRuntimeTarget(runtime, monitor); -// } catch (CoreException ce) { -// Logger.getLogger().logError(ce); -// } -// } - - /** - * @param earProject - */ -// public static List getAllEarModuleProjects(IProject earProject) { -// EARNatureRuntime nature = EARNatureRuntime.getRuntime(earProject); -// EAREditModel editModel = null; -// List moduleProjects = new ArrayList(); -// Object key = new ServerTargetHelper(); -// try { -// editModel = nature.getEarEditModelForRead(key); -// Set allModuleProjects = editModel.getModuleMappedModuleProjects(); -// if (!allModuleProjects.isEmpty()) -// moduleProjects.addAll(allModuleProjects); -// return moduleProjects; -// } finally { -// if (editModel != null) -// editModel.releaseAccess(key); -// } -// } -// - public static String[] getProjectTypeAndJ2EELevel(IProject project) { - String[] projectAttr = new String[2]; -// boolean isJ2EE13 = true; -// if (EARNatureRuntime.hasRuntime(project)) { -// projectAttr[0] = IServerTargetConstants.EAR_TYPE; -// isJ2EE13 = EARNatureRuntime.getRuntime(project).isJ2EE1_3(); -// } else if (J2EENature.hasRuntime(project, IEJBNatureConstants.EJB_NATURE_IDS)) { -// projectAttr[0] = IServerTargetConstants.EJB_TYPE; -// isJ2EE13 = J2EENature.getRuntime(project, IEJBNatureConstants.EJB_NATURE_IDS).isJ2EE1_3(); -// } else if (J2EENature.hasRuntime(project, IWebNatureConstants.J2EE_NATURE_ID)) { -// projectAttr[0] = IServerTargetConstants.WEB_TYPE; -// isJ2EE13 = J2EENature.getRuntime(project, IWebNatureConstants.J2EE_NATURE_ID).isJ2EE1_3(); -// } else if (J2EENature.hasRuntime(project,IApplicationClientNatureConstants.NATURE_ID)) { -// projectAttr[0] = IServerTargetConstants.APP_CLIENT_TYPE; -// isJ2EE13 = J2EENature.getRuntime(project,IApplicationClientNatureConstants.NATURE_ID).isJ2EE1_3(); -// } else if (J2EENature.hasRuntime(project, IConnectorNatureConstants.NATURE_ID)) { -// projectAttr[0] = IServerTargetConstants.CONNECTOR_TYPE; -// isJ2EE13 = J2EENature.getRuntime(project, IConnectorNatureConstants.NATURE_ID).isJ2EE1_3(); -// } else if (hasJavaNature(project)) -// projectAttr[0] = null; -// if (projectAttr[0] != null && projectAttr[0].length() > 0) { -// if (isJ2EE13) -// projectAttr[1] = IServerTargetConstants.J2EE_13; -// else -// projectAttr[1] = IServerTargetConstants.J2EE_12; -// } - return projectAttr; - } - - /** - * @param project - * @return - */ - public static boolean hasJavaNature(IProject project) { - try { - return project.hasNature(JAVA_NATURE_ID); - } catch (CoreException ce) { - Logger.getLogger().logTrace(ce); - } - return false; - } - - /** - * @param earProject - */ -// public static List getAllEarUtilityProjects(EAREditModel earEditModel, IProject earProject) { -// List utilityProjects = new ArrayList(); -// Set utilProjects = earEditModel.getModuleMappedUtilityJarProjects(); -// if (!utilProjects.isEmpty()) -// utilityProjects.addAll(utilProjects); -// return utilityProjects; -// } - - public static int getExistingServerTargetIndex(List validServerTargets, IProject project) { - if (validServerTargets != null) { - IRuntime st = ServerCore.getProjectProperties(project).getRuntimeTarget(); - if (st != null) { - for (int i = 0; i < validServerTargets.size(); i++) { - if (((IRuntime) validServerTargets.get(i)).getId() == st.getId()) - return i; - } - } - } - return -1; - } - - public static List getExistingNonServerTargetClasspath(IProject project) { - IJavaProject javaProject = null; - List list = new ArrayList(); - try { - javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID); - } catch (Exception e) { - } - if (javaProject != null) { - try { - IClasspathEntry[] cp = javaProject.getRawClasspath(); - int size = cp.length; - for (int i = 0; i < size; i++) { - int entryKind = cp[i].getEntryKind(); - if (entryKind != IClasspathEntry.CPE_SOURCE && entryKind != IClasspathEntry.CPE_LIBRARY && entryKind != IClasspathEntry.CPE_PROJECT && (entryKind == IClasspathEntry.CPE_VARIABLE && isWASVariable(cp[i])) && (entryKind != IClasspathEntry.CPE_CONTAINER || !cp[i].getPath().segment(0).equals(SERVER_CONTAINER))) { - list.add(cp[i]); - } - } - } catch (Exception e) { - } - return list; - } - return list; - } - - /** - * @param entry - * @return - */ - private static boolean isWASVariable(IClasspathEntry entry) { - // TODO This is no longer valid in the base. - // IPath path = entry.getPath(); - // if (path != null && path.segmentCount() != 0) { - // String classpathVariable = path.segment(0); - // return - // classpathVariable.equals(IEJBNatureConstants.WAS_PLUGINDIR_VARIABLE) - // || - // classpathVariable.equals(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE) - // || - // classpathVariable.equals(IEJBNatureConstants.SERVERJDK_50_PLUGINDIR_VARIABLE) - // || - // classpathVariable.equals(IEJBNatureConstants.SERVERJDK_PLUGINDIR_VARIABLE) - // || classpathVariable.equals(J2EEPlugin.SOAP_PLUGINDIR_VARIABLE) - // || classpathVariable.equals(J2EEPlugin.SOAPSEC_PLUGINDIR_VARIABLE); - // //|| classpathVariable.equals(J2EEPlugin.XERCES_IMPL_VARIABLE) - // //|| classpathVariable.equals(J2EEPlugin.XERCES_PLUGINDIR_VARIABLE) - // //|| classpathVariable.equals(J2EEPlugin.WORF_PLUGINDIR_VARIABLE) - // //|| classpathVariable.equals(J2EEPlugin.MAIL_CLASSPATH_VARIABLE) - // //|| - // classpathVariable.equals(J2EEPlugin.ACTIVATION_CLASSPATH_VARIABLE); - // } - return false; - } - - /** - * @param earProject - * @param st - * @return - */ -// public static boolean serverTargetValidForEAR(IProject earProject, IRuntime st) { -// return !(J2EENature.hasRuntime(earProject, IEARNatureConstants.NATURE_ID) && st.getId().equals(IServerTargetConstants.aesV4ServerTargetId)); -// } - - public static List getServerTargets(String type, String version) { - List targets = Arrays.asList(ServerUtil.getRuntimes(type, version)); - return targets; - } - /* - * public static ITargetType getV50TargetType(IProject project, IServerTarget v50ServerTarget) { - * if (J2EENature.hasRuntime(project, IEARNatureConstants.NATURE_ID)) return - * ServerTargetManager.getTargetType(v50ServerTarget, IServerTargetConstants.EAR_TYPE); if - * (J2EENature.hasRuntime(project, IApplicationClientNatureConstants.NATURE_ID)) return - * ServerTargetManager.getTargetType(v50ServerTarget, IServerTargetConstants.EAR_TYPE); else if - * (J2EENature.hasRuntime(project, IEJBNatureConstants.NATURE_ID)) return - * ServerTargetManager.getTargetType(v50ServerTarget, IServerTargetConstants.EJB_TYPE); else if - * (J2EENature.hasRuntime(project, IWebNatureConstants.J2EE_NATURE_ID)) return - * ServerTargetManager.getTargetType(v50ServerTarget, IServerTargetConstants.WEB_TYPE); return - * null; } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/TargetRuntimeExtension.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/TargetRuntimeExtension.java deleted file mode 100644 index 26334b1d3..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/servertarget/TargetRuntimeExtension.java +++ /dev/null @@ -1,62 +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 - *******************************************************************************/ -/* - * Created on Feb 5, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.servertarget; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.Plugin; - -/** - * @author vijayb - * @deprecated - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class TargetRuntimeExtension { - String groupID; - String className; - IConfigurationElement configElement; - Plugin plugin; - - /** - * - */ - public TargetRuntimeExtension() { - super(); - } - - public TargetRuntimeExtension(Plugin aPlugin, IConfigurationElement element, String groupId, String handlerClass) { - super(); - plugin = aPlugin; - configElement = element; - groupID = groupId; - className = handlerClass; - } - - /** - * @return - */ - public String getGroupId() { - return groupID; - } - - /** - * @param string - */ - public void setGroupId(String string) { - groupID = string; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/datamodel/properties/IJ2EEProjectServerTargetDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/datamodel/properties/IJ2EEProjectServerTargetDataModelProperties.java deleted file mode 100644 index 735a26fa9..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/datamodel/properties/IJ2EEProjectServerTargetDataModelProperties.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.datamodel.properties; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties; - -public interface IJ2EEProjectServerTargetDataModelProperties extends IDataModelProperties{ - - /** - * required, type String - */ - public static final String PROJECT_NAME = "IJ2EEProjectServerTargetDataModelProperties.PROJECT_NAME"; //$NON-NLS-1$ - /** - * required, not defaulted. If null, will not run. - */ - public static final String RUNTIME_TARGET_ID = "IJ2EEProjectServerTargetDataModelProperties.RUNTIME_TARGET_ID"; //$NON-NLS-1$ - /** - * Optional - This needs to be set if the PROJECT_NAME does not exist. - * - * @link J2EEVersionConstants - */ - public static final String J2EE_VERSION_ID = "IJ2EEProjectServerTargetDataModelProperties.J2EE_VERSION_ID"; //$NON-NLS-1$ - - /** - * optional, default true, type Boolean. Set this to true if the operation is supposed to update - * all dependent modules and projects in an ear if the passed project name is an ear project - */ - public static final String UPDATE_MODULES = "IJ2EEProjectServerTargetDataModelProperties.UPDATE_MODULES"; //$NON-NLS-1$ - - /** - * Optional - This needs to be set if the PROJECT_NAME does not exist. - * - * @link XMLResource#APP_CLIENT_TYPE - * @link XMLResource#APPLICATION_TYPE - * @link XMLResource#EJB_TYPE - * @link XMLResource#RAR_TYPE - * @link XMLResource#WEB_APP_TYPE - */ - public static final String DEPLOYMENT_TYPE_ID = "IJ2EEProjectServerTargetDataModelProperties.DD_TYPE_ID"; //$NON-NLS-1$ - - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetConstants.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetConstants.java deleted file mode 100644 index 340582a7b..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetConstants.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.j2ee.project.facet; - -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -public interface IJ2EEFacetConstants { - - //moduleTypes - public static final String ENTERPRISE_APPLICATION = IModuleConstants.JST_EAR_MODULE; - public static final IProjectFacet ENTERPRISE_APPLICATION_FACET = ProjectFacetsManager.getProjectFacet(ENTERPRISE_APPLICATION); - public static final IProjectFacetVersion ENTERPRISE_APPLICATION_12 = ENTERPRISE_APPLICATION_FACET.getVersion("1.2"); //$NON-NLS-1$ - public static final IProjectFacetVersion ENTERPRISE_APPLICATION_13 = ENTERPRISE_APPLICATION_FACET.getVersion("1.3"); //$NON-NLS-1$ - public static final IProjectFacetVersion ENTERPRISE_APPLICATION_14 = ENTERPRISE_APPLICATION_FACET.getVersion("1.4"); //$NON-NLS-1$ - public static final IProjectFacetVersion ENTERPRISE_APPLICATION_50 = ENTERPRISE_APPLICATION_FACET.getVersion("5.0"); //$NON-NLS-1$ - - public static final String APPLICATION_CLIENT = IModuleConstants.JST_APPCLIENT_MODULE; - public static final IProjectFacet APPLICATION_CLIENT_FACET = ProjectFacetsManager.getProjectFacet(APPLICATION_CLIENT); - public static final IProjectFacetVersion APPLICATION_CLIENT_12 = APPLICATION_CLIENT_FACET.getVersion("1.2"); //$NON-NLS-1$ - public static final IProjectFacetVersion APPLICATION_CLIENT_13 = APPLICATION_CLIENT_FACET.getVersion("1.3"); //$NON-NLS-1$ - public static final IProjectFacetVersion APPLICATION_CLIENT_14 = APPLICATION_CLIENT_FACET.getVersion("1.4"); //$NON-NLS-1$ - public static final IProjectFacetVersion APPLICATION_CLIENT_50 = APPLICATION_CLIENT_FACET.getVersion("5.0"); //$NON-NLS-1$ - - public static final String EJB = IModuleConstants.JST_EJB_MODULE; - public static final IProjectFacet EJB_FACET = ProjectFacetsManager.getProjectFacet(EJB); - public static final IProjectFacetVersion EJB_11 = EJB_FACET.getVersion("1.1"); //$NON-NLS-1$ - public static final IProjectFacetVersion EJB_20 = EJB_FACET.getVersion("2.0"); //$NON-NLS-1$ - public static final IProjectFacetVersion EJB_21 = EJB_FACET.getVersion("2.1"); //$NON-NLS-1$ - public static final IProjectFacetVersion EJB_30 = EJB_FACET.getVersion("3.0"); //$NON-NLS-1$ - - public static final String DYNAMIC_WEB = IModuleConstants.JST_WEB_MODULE; - public static final IProjectFacet DYNAMIC_WEB_FACET = ProjectFacetsManager.getProjectFacet(DYNAMIC_WEB); - public static final IProjectFacetVersion DYNAMIC_WEB_22 = DYNAMIC_WEB_FACET.getVersion("2.2"); //$NON-NLS-1$ - public static final IProjectFacetVersion DYNAMIC_WEB_23 = DYNAMIC_WEB_FACET.getVersion("2.3"); //$NON-NLS-1$ - public static final IProjectFacetVersion DYNAMIC_WEB_24 = DYNAMIC_WEB_FACET.getVersion("2.4"); //$NON-NLS-1$ - public static final IProjectFacetVersion DYNAMIC_WEB_25 = DYNAMIC_WEB_FACET.getVersion("2.5"); //$NON-NLS-1$ - - public static final String DYNAMIC_WEB_XDOCLET = "jst.web.xdoclet"; //$NON-NLS-1$ - - public static final String UTILITY = IModuleConstants.JST_UTILITY_MODULE; - public static final IProjectFacet UTILITY_FACET = ProjectFacetsManager.getProjectFacet(UTILITY); - public static final IProjectFacetVersion UTILITY_FACET_10 = UTILITY_FACET.getVersion("1.0"); //$NON-NLS-1$ - - public static final String JCA = IModuleConstants.JST_CONNECTOR_MODULE; - public static final IProjectFacet JCA_FACET = ProjectFacetsManager.getProjectFacet(JCA); - - public static final String STATIC_WEB = IModuleConstants.WST_WEB_MODULE; - - public static final String JAVA = IModuleConstants.JST_JAVA; -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetInstallDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetInstallDataModelProperties.java deleted file mode 100644 index d4db236c2..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetInstallDataModelProperties.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.project.facet; - -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetInstallDataModelProperties; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; - -public interface IJ2EEFacetInstallDataModelProperties extends IFacetInstallDataModelProperties, IJ2EEFacetConstants { - - //TODO this property should probably be deleted - public static final String RUNTIME_TARGET_ID = "IJ2EEFacetInstallDataModelProperties.RUNTIME_TARGET_ID"; //$NON-NLS-1$ - - public static final String FACET_RUNTIME = IFacetProjectCreationDataModelProperties.FACET_RUNTIME; - - /** - * boolean property for Java EE 5 projects, to create/not create a deployment descriptor, - * The default value is false - */ - public static final String GENERATE_DD = "IJ2EEFacetInstallDataModelProperties.GENERATE_DD"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetProjectCreationDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetProjectCreationDataModelProperties.java deleted file mode 100644 index 9ab7ec1d0..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEFacetProjectCreationDataModelProperties.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; - -public interface IJ2EEFacetProjectCreationDataModelProperties - extends IFacetProjectCreationDataModelProperties{ - - public static final String ADD_TO_EAR = "IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR"; //$NON-NLS-1$ - public static final String EAR_PROJECT_NAME = "IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME"; //$NON-NLS-1$ - public static final String MODULE_URI = "IJ2EEFacetProjectCreationDataModelProperties.MODULE_URI"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEModuleFacetInstallDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEModuleFacetInstallDataModelProperties.java deleted file mode 100644 index 97adec782..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/IJ2EEModuleFacetInstallDataModelProperties.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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 IJ2EEModuleFacetInstallDataModelProperties extends IJ2EEFacetInstallDataModelProperties{ - - public static final String ADD_TO_EAR = "IJ2EEFacetInstallDataModelProperties.ADD_TO_EAR"; //$NON-NLS-1$ - public static final String EAR_PROJECT_NAME = "IJ2EEFacetInstallDataModelProperties.EAR_PROJECT_NAME"; //$NON-NLS-1$ - public static final String CONFIG_FOLDER = "IJ2EEFacetInstallDataModelProperties.CONFIG_FOLDER"; //$NON-NLS-1$ - public static final String LAST_EAR_NAME = "IJ2EEModuleFacetInstallDataModelProperties.LAST_EAR_NAME"; //$NON-NLS-1$ - public static final String MODULE_URI = "IJ2EEModuleFacetInstallDataModelProperties.MODULE_URI"; //$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetInstallDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetInstallDataModelProvider.java deleted file mode 100644 index ddda96da1..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetInstallDataModelProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.project.facet; - -import java.util.Set; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -public abstract class J2EEFacetInstallDataModelProvider extends FacetInstallDataModelProvider implements IJ2EEFacetInstallDataModelProperties{ - - public Set getPropertyNames() { - Set names = super.getPropertyNames(); - names.add(RUNTIME_TARGET_ID); - names.add(FACET_RUNTIME); - // added for jee projects that make deployment descriptors optional - names.add(GENERATE_DD); - return names; - } - - protected final int getJ2EEVersion() { - return convertFacetVersionToJ2EEVersion((IProjectFacetVersion) getProperty(FACET_VERSION)); - } - - protected abstract int convertFacetVersionToJ2EEVersion(IProjectFacetVersion version); - - protected IStatus validateFolderName(String folderName) { - // the directory is not required, but if the name is entered ensure that it - // contains only valid characters. - if (folderName == null || folderName.length() == 0) { - return OK_STATUS; - } - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IPath path = new Path(folderName); - for (int i = 0, max = path.segmentCount(); i < max; i++) { - IStatus status = workspace.validateName(path.segment(i), IResource.FOLDER); - if (! status.isOK()) - return status; - } - - // all of the potential segments of the folder have been verified - return OK_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetInstallDelegate.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetInstallDelegate.java deleted file mode 100644 index 293b63b3d..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetInstallDelegate.java +++ /dev/null @@ -1,182 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.project.facet; - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -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.jem.util.UIContextDetermination; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.frameworks.CommonFrameworksPlugin; -import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider; -import org.eclipse.jst.j2ee.application.internal.operations.IAddComponentToEnterpriseApplicationDataModelProperties; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.earcreation.EarFacetInstallDataModelProvider; -import org.eclipse.jst.j2ee.internal.project.ManifestFileCreationAction; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.operation.FacetProjectCreationOperation; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.internal.emf.resource.RendererFactory; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action.Type; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; -import org.eclipse.wst.project.facet.ProductManager; - -public abstract class J2EEFacetInstallDelegate { - - protected static void addToClasspath(final IJavaProject jproj, final IClasspathEntry entry) throws CoreException { - final IClasspathEntry[] current = jproj.getRawClasspath(); - final IClasspathEntry[] updated = new IClasspathEntry[current.length + 1]; - System.arraycopy(current, 0, updated, 0, current.length); - updated[current.length] = entry; - jproj.setRawClasspath(updated, null); - } - - protected void installEARFacet(String j2eeVersionText, String earProjectName, IRuntime runtime, IProgressMonitor monitor){ - - IProject project = ProjectUtilities.getProject(earProjectName); - if( project.exists()) - return; - - IFacetedProject facetProj; - try { - facetProj = ProjectFacetsManager.create(earProjectName, - null, monitor); - if(null != runtime){ - facetProj.setRuntime(runtime, monitor); - } - - IDataModel earFacetInstallDataModel = DataModelFactory.createDataModel(new EarFacetInstallDataModelProvider()); - earFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, earProjectName); - earFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, j2eeVersionText); - - Set actions = new HashSet(); - actions.add(new IFacetedProject.Action((Type) earFacetInstallDataModel.getProperty(IFacetDataModelProperties.FACET_TYPE), - (IProjectFacetVersion) earFacetInstallDataModel.getProperty(IFacetDataModelProperties.FACET_VERSION), - earFacetInstallDataModel)); - - - facetProj.modify(actions, null); - facetProj.setFixedProjectFacets(Collections.singleton(EARFacetUtils.EAR_FACET)); - - try { - FacetProjectCreationOperation.addDefaultFactets(facetProj, runtime); - } catch (ExecutionException e) { - Logger.getLogger().logError(e); - } - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } - - protected void createManifest(IProject project, IContainer aFolder, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { - - IFile file = aFolder.getFile(new Path(J2EEConstants.MANIFEST_URI)); - if (file.exists()) return; - try { - ManifestFileCreationAction.createManifestFile(file, project); - } catch (CoreException e) { - Logger.getLogger().log(e); - } catch (IOException e) { - Logger.getLogger().log(e); - } - } - - protected void addToEar(IVirtualComponent earComp, IVirtualComponent j2eeComp, String moduleURI ){ - final IDataModel dataModel = DataModelFactory.createDataModel(new AddComponentToEnterpriseApplicationDataModelProvider()); - Map map = (Map)dataModel.getProperty(IAddComponentToEnterpriseApplicationDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP); - map.put(j2eeComp, moduleURI); - - dataModel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComp); - - List modList = (List) dataModel.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - modList.add(j2eeComp); - dataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modList); - try { - dataModel.getDefaultOperation().execute(null, null); - } catch (ExecutionException e) { - Logger.getLogger().logError(e); - } - } - - protected void installAndAddModuletoEAR( String j2eeVersionText, - String earProjectName, - IRuntime runtime, - IProject moduleProject, - String moduleURI, - IProgressMonitor monitor ){ - - installEARFacet(j2eeVersionText, - earProjectName, - runtime, - monitor); - - final IVirtualComponent c = ComponentCore.createComponent( moduleProject ); - final IProject earProject = ProjectUtilities.getProject( earProjectName ); - final IVirtualComponent earComp = ComponentCore.createComponent( earProject ); - - if( UIContextDetermination.getCurrentContext() == UIContextDetermination.HEADLESS_CONTEXT ){ - boolean isValidating = RendererFactory.getDefaultRendererFactory().isValidating(); - try{ - if( isValidating ){ - RendererFactory.getDefaultRendererFactory().setValidating(false); - } - addToEar( earComp, c, moduleURI ); - }finally{ - RendererFactory.getDefaultRendererFactory().setValidating(isValidating); - } - } - else - addToEar( earComp, c, moduleURI ); - } - - /** - * This method will set the output property on the model element for the given component. - * If the single root structure is set for optimized use, the output folder will be the - * content root. Otherwise the default will be used. This may be overrided by specific - * J2EE modules to do more appropriate behaviour. - * - * @param model - * @param component - */ - protected void setOutputFolder(IDataModel model, IVirtualComponent component) { - String outputFolder = null; - // If using single root structure, set output folder to be the content folder - if (ProductManager.shouldUseSingleRootStructure()) - outputFolder = model.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER); - // Otherwise just use the product default for java output path - else - outputFolder = CommonFrameworksPlugin.getDefault().getPluginPreferences().getString(CommonFrameworksPlugin.OUTPUT_FOLDER); - component.setMetaProperty("java-output-path", outputFolder ); //$NON-NLS-1$ - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetProjectCreationDataModelProvider.java deleted file mode 100644 index e5d71500e..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetProjectCreationDataModelProvider.java +++ /dev/null @@ -1,211 +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.j2ee.project.facet; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; -import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModelProviderNew; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonMessages; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -public class J2EEFacetProjectCreationDataModelProvider extends FacetProjectCreationDataModelProvider implements IJ2EEFacetProjectCreationDataModelProperties { - - private static Set<IProjectFacet> MODULE_FACETS = new HashSet<IProjectFacet>(); - - static - { - for( IProjectFacetVersion fv : ProjectFacetsManager.getGroup( "modules" ).getMembers() ) - { - MODULE_FACETS.add( fv.getProjectFacet() ); - } - } - - public J2EEFacetProjectCreationDataModelProvider() { - super(); - } - - public void init() { - super.init(); - } - - public Object getDefaultProperty(String propertyName) { - if (EAR_PROJECT_NAME.equals(propertyName)) { - IDataModel nestedJ2EEFacetDataModel = getJ2EEFacetModel(); - if (nestedJ2EEFacetDataModel!=null) - return nestedJ2EEFacetDataModel.getProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME); - } - return super.getDefaultProperty(propertyName); - } - - public Set getPropertyNames() { - Set names = super.getPropertyNames(); - names.add(EAR_PROJECT_NAME); - names.add(ADD_TO_EAR); - names.add(MODULE_URI); - return names; - } - - public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { - if (FACET_RUNTIME.equals(propertyName) && getBooleanProperty(ADD_TO_EAR)) { - DataModelPropertyDescriptor[] descriptors = super.getValidPropertyDescriptors(propertyName); - List list = new ArrayList(); - for (int i = 0; i < descriptors.length; i++) { - IRuntime rt = (IRuntime) descriptors[i].getPropertyValue(); - if (rt == null || rt.supports(EARFacetUtils.EAR_FACET)) { - list.add(descriptors[i]); - } - } - descriptors = new DataModelPropertyDescriptor[list.size()]; - for (int i = 0; i < descriptors.length; i++) { - descriptors[i] = (DataModelPropertyDescriptor) list.get(i); - } - return descriptors; - } - return super.getValidPropertyDescriptors(propertyName); - } - - public boolean propertySet(String propertyName, Object propertyValue) { - if (EAR_PROJECT_NAME.equals(propertyName) || ADD_TO_EAR.equals(propertyName)) { - IDataModel nestedJ2EEFacetDataModel = getJ2EEFacetModel(); - if(null != nestedJ2EEFacetDataModel){ - if(EAR_PROJECT_NAME.equals(propertyName)){ - nestedJ2EEFacetDataModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME, propertyValue); - } else { - nestedJ2EEFacetDataModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, propertyValue); - } - - } - if (getBooleanProperty(ADD_TO_EAR)) { - IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME)); - if (status.isOK()) { - IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME)); - if (earProject != null) { - IFacetedProject facetdEarProject; - try { - facetdEarProject = ProjectFacetsManager.create(earProject); - if (facetdEarProject != null) { - setProperty(FACET_RUNTIME, facetdEarProject.getRuntime()); - } - } catch (CoreException e) { - e.printStackTrace(); - } - } - } - } - if (ADD_TO_EAR.equals(propertyName)) { - model.notifyPropertyChange(FACET_RUNTIME, IDataModel.VALID_VALUES_CHG); - } - model.notifyPropertyChange(FACET_RUNTIME, IDataModel.ENABLE_CHG); - } - return super.propertySet(propertyName, propertyValue); - } - - protected IDataModel getJ2EEFacetModel() - { - final IFacetedProjectWorkingCopy fpjwc - = (IFacetedProjectWorkingCopy) this.model.getProperty( FACETED_PROJECT_WORKING_COPY ); - - for( IProjectFacet moduleFacet : MODULE_FACETS ) - { - if( fpjwc.hasProjectFacet( moduleFacet ) ) - { - final IFacetedProject.Action action - = fpjwc.getProjectFacetAction( IFacetedProject.Action.Type.INSTALL, moduleFacet ); - - return (IDataModel) action.getConfig(); - } - } - - return null; - } - - public boolean isPropertyEnabled(String propertyName) { - if (FACET_RUNTIME.equals(propertyName)) { - if (getBooleanProperty(ADD_TO_EAR)) { - IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME)); - if (status.isOK()) { - IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME)); - if (earProject != null) { - IFacetedProject facetdEarProject; - try { - facetdEarProject = ProjectFacetsManager.create(earProject); - if (facetdEarProject != null) { - return false; - } - } catch (CoreException e) { - e.printStackTrace(); - } - } - } - } - return true; - } - return super.isPropertyEnabled(propertyName); - } - - public IStatus validate(String propertyName) { - if (ADD_TO_EAR.equals(propertyName) || EAR_PROJECT_NAME.equals(propertyName) || FACET_PROJECT_NAME.equals(propertyName)) { - if (model.getBooleanProperty(ADD_TO_EAR)) { - IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME)); - if (!status.isOK()) - return status; - if (getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME).equals(getStringProperty(EAR_PROJECT_NAME))) { - String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.SAME_MODULE_AND_EAR_NAME, new Object[]{getStringProperty(EAR_PROJECT_NAME)}); - return WTPCommonPlugin.createErrorStatus(errorMessage); - } - } - } - return super.validate(propertyName); - } - - protected IStatus validateEAR(String earName) { - if (earName.indexOf("#") != -1 || earName.indexOf("/") != -1) { //$NON-NLS-1$ //$NON-NLS-2$ - String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.ERR_INVALID_CHARS); - return WTPCommonPlugin.createErrorStatus(errorMessage); - } else if (earName == null || earName.equals("")) { //$NON-NLS-1$ - String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.ERR_EMPTY_MODULE_NAME); - return WTPCommonPlugin.createErrorStatus(errorMessage); - } - - IStatus status = ProjectCreationDataModelProviderNew.validateProjectName(earName); - //check for the deleted case, the project is deleted from the workspace but still exists in the - //file system. - if( status.isOK()){ - IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME)); - if( !earProject.exists() ){ - IPath path = ResourcesPlugin.getWorkspace().getRoot().getLocation(); - path = path.append(earName); - status = ProjectCreationDataModelProviderNew.validateExisting(earName, path.toOSString()); - } - } - return status; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetRuntimeChangedDelegate.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetRuntimeChangedDelegate.java deleted file mode 100644 index a58fbe941..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetRuntimeChangedDelegate.java +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * Konstantin Komissarchik - 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.jst.common.project.facet.core.ClasspathHelper; -import org.eclipse.wst.common.project.facet.core.IDelegate; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public final class J2EEFacetRuntimeChangedDelegate - - implements IDelegate - -{ - public void execute( final IProject project, - final IProjectFacetVersion fv, - final Object cfg, - final IProgressMonitor monitor ) - - throws CoreException - - { - if( monitor != null ) - { - monitor.beginTask( "", 1 ); - } - - try - { - ClasspathHelper.removeClasspathEntries( project, fv ); - - if( ! ClasspathHelper.addClasspathEntries( project, fv ) ) - { - // TODO: Support the no runtime case. - // ClasspathHelper.addClasspathEntries( project, fv, <something> ); - } - - if( monitor != null ) - { - monitor.worked( 1 ); - } - } - finally - { - if( monitor != null ) - { - monitor.done(); - } - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEModuleFacetInstallDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEModuleFacetInstallDataModelProvider.java deleted file mode 100644 index 103f03198..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEModuleFacetInstallDataModelProvider.java +++ /dev/null @@ -1,247 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.project.facet; - -import java.util.ArrayList; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPreferences; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties.FacetDataModelMap; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModelProviderNew; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonMessages; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; -import org.eclipse.wst.project.facet.ProductManager; - -public abstract class J2EEModuleFacetInstallDataModelProvider extends J2EEFacetInstallDataModelProvider implements IJ2EEModuleFacetInstallDataModelProperties { - - /** - * An internal Boolean property used to prohibit adding this module to an EAR. This is set on - * the nested models when used during EAR creation since EAR creation handles adding to the EAR - */ - public static final String PROHIBIT_ADD_TO_EAR = "J2EEModuleFacetInstallDataModelProvider.PROHIBIT_ADD_TO_EAR"; //$NON-NLS-1$ - - public Set getPropertyNames() { - Set names = super.getPropertyNames(); - names.add(ADD_TO_EAR); - names.add(PROHIBIT_ADD_TO_EAR); - names.add(CONFIG_FOLDER); - names.add(EAR_PROJECT_NAME); - names.add(LAST_EAR_NAME); - names.add(MODULE_URI); - // added for jee modules that make deployment descriptors optional - names.add(IJ2EEFacetInstallDataModelProperties.GENERATE_DD); - return names; - } - - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(PROHIBIT_ADD_TO_EAR)) { - return Boolean.FALSE; - } else if (propertyName.equals(ADD_TO_EAR)) { - return new Boolean( J2EEPlugin.getDefault().getJ2EEPreferences().getBoolean(J2EEPreferences.Keys.ADD_TO_EAR_BY_DEFAULT) && isEARSupportedByRuntime()); - } else if (propertyName.equals(EAR_PROJECT_NAME)) { - if (model.isPropertySet(LAST_EAR_NAME)) { - IProject project = ProjectUtilities.getProject(getStringProperty(LAST_EAR_NAME)); - if (project.exists() && project.isAccessible()) - return project.getName(); - } - DataModelPropertyDescriptor[] descs = getValidPropertyDescriptors(EAR_PROJECT_NAME); - if (descs.length > 0) { - DataModelPropertyDescriptor desc = descs[0]; - String eARName = desc.getPropertyDescription(); - if (eARName != null && !eARName.equals("")) { //$NON-NLS-1$ - return eARName; - } else { - return getDataModel().getStringProperty(FACET_PROJECT_NAME) + "EAR"; //$NON-NLS-1$ - } - } else { - return getDataModel().getStringProperty(FACET_PROJECT_NAME) + "EAR"; //$NON-NLS-1$ - } - } - return super.getDefaultProperty(propertyName); - } - - public boolean propertySet(String propertyName, Object propertyValue) { - if (propertyName.equals(PROHIBIT_ADD_TO_EAR)) { - setBooleanProperty(ADD_TO_EAR, false); - } - if (FACET_PROJECT_NAME.equals(propertyName)) { - if (getBooleanProperty(ADD_TO_EAR)) { - if (!model.isPropertySet(EAR_PROJECT_NAME)) { - model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG); - } - } - } else if (FACET_VERSION.equals(propertyName)) { - model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG); - } else if (propertyName.equals(CONFIG_FOLDER)) { - IDataModel masterModel = (IDataModel) model.getProperty(MASTER_PROJECT_DM); - if (masterModel != null) { - FacetDataModelMap map = (FacetDataModelMap) masterModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); - IDataModel javaModel = map.getFacetDataModel(JAVA); - if (javaModel != null) { - javaModel.setProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME, propertyValue); - // If applicable, react to the change in content folder to update the output folder for single root structures - if (ProductManager.shouldUseSingleRootStructure()) - javaModel.setProperty(IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME,propertyValue); - } - } - } else if ((EAR_PROJECT_NAME.equals(propertyName) || ADD_TO_EAR.equals(propertyName)) && getBooleanProperty(ADD_TO_EAR)) { - IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME)); - if (status.isOK()) { - IProject project = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME)); - if (project.exists() && project.isAccessible() && J2EEProjectUtilities.isEARProject(project)) { - try { - IFacetedProject facetProj = ProjectFacetsManager.create(project, false, new NullProgressMonitor()); - setProperty(FACET_RUNTIME, facetProj.getRuntime()); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } - } - model.notifyPropertyChange(FACET_RUNTIME, IDataModel.ENABLE_CHG); - } else if (LAST_EAR_NAME.equals(propertyName)) { - model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG); - } else if (propertyName.equals(IFacetProjectCreationDataModelProperties.FACET_RUNTIME)) { - model.notifyPropertyChange(ADD_TO_EAR, IDataModel.VALID_VALUES_CHG); - model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG); - } - - if (ADD_TO_EAR.equals(propertyName)) { - IStatus stat = model.validateProperty(propertyName); - if (stat != OK_STATUS) { - return true; - } - model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG); - } - - return super.propertySet(propertyName, propertyValue); - } - - public boolean isPropertyEnabled(String propertyName) { - if (ADD_TO_EAR.equals(propertyName)) { - return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime(); - } - if (EAR_PROJECT_NAME.equals(propertyName)) { - return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime() && getBooleanProperty(ADD_TO_EAR); - } - return super.isPropertyEnabled(propertyName); - } - - public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { - if (EAR_PROJECT_NAME.equals(propertyName)) { - int j2eeVersion = getJ2EEVersion(); - return getEARPropertyDescriptors(j2eeVersion); - } - return super.getValidPropertyDescriptors(propertyName); - } - - protected DataModelPropertyDescriptor[] getEARPropertyDescriptors(int j2eeVersion) { - StructureEdit mc = null; - ArrayList earDescriptorList = new ArrayList(); - - IProject[] projs = ProjectUtilities.getAllProjects(); - - for (int index = 0; index < projs.length; index++) { - IProject flexProject = projs[index]; - try { - if (flexProject != null) { - if (ModuleCoreNature.isFlexibleProject(flexProject)) { - IVirtualComponent comp = ComponentCore.createComponent(flexProject); - if (J2EEProjectUtilities.isEARProject(comp.getProject())) { - String sVer = J2EEProjectUtilities.getJ2EEProjectVersion(comp.getProject()); - int ver = J2EEVersionUtil.convertVersionStringToInt(sVer); - if (j2eeVersion <= ver) { - DataModelPropertyDescriptor desc = new DataModelPropertyDescriptor(comp.getProject().getName()); - earDescriptorList.add(desc); - } - } - } - } - } finally { - if (mc != null) - mc.dispose(); - } - } - DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[earDescriptorList.size()]; - for (int i = 0; i < descriptors.length; i++) { - DataModelPropertyDescriptor desc = (DataModelPropertyDescriptor) earDescriptorList.get(i); - descriptors[i] = new DataModelPropertyDescriptor(desc.getPropertyDescription(), desc.getPropertyDescription()); - } - return descriptors; - } - - public IStatus validate(String name) { - if (name.equals(EAR_PROJECT_NAME) && getBooleanProperty(ADD_TO_EAR)) { - IStatus status = validateEAR(getStringProperty(EAR_PROJECT_NAME)); - if (!status.isOK()) - return status; - final IFacetedProjectWorkingCopy fpjwc = (IFacetedProjectWorkingCopy) getProperty(FACETED_PROJECT_WORKING_COPY); - if(fpjwc.getProjectName().equals(getStringProperty(EAR_PROJECT_NAME))){ - String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.SAME_MODULE_AND_EAR_NAME, new Object [] {getStringProperty(EAR_PROJECT_NAME) }); - return WTPCommonPlugin.createErrorStatus(errorMessage); - } - } else if (name.equals(CONFIG_FOLDER)) { - String folderName = model.getStringProperty(CONFIG_FOLDER); - if (folderName == null || folderName.length() == 0 || folderName.equals("/") || folderName.equals("\\")) { - // all folders which meet the criteria of "CONFIG_FOLDER" are required - String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.SOURCEFOLDER_EMPTY); - return WTPCommonPlugin.createErrorStatus(errorMessage); - } else { - return validateFolderName(folderName); - } - } else if (name.equals(ADD_TO_EAR)) { - if (!isEARSupportedByRuntime()) { - String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.MODULE_NOT_SUPPORTED); - return WTPCommonPlugin.createErrorStatus(errorMessage); - } - } - return super.validate(name); - } - - protected IStatus validateEAR(String earName) { - if (earName == null || earName.equals("")) { //$NON-NLS-1$ - String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.ERR_EMPTY_MODULE_NAME); - return WTPCommonPlugin.createErrorStatus(errorMessage); - } else if (earName.indexOf("#") != -1 || earName.indexOf("/") != -1) { //$NON-NLS-1$ //$NON-NLS-2$ - String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.ERR_INVALID_CHARS); - return WTPCommonPlugin.createErrorStatus(errorMessage); - } - return (ProjectCreationDataModelProviderNew.validateProjectName(earName)); - } - - private boolean isEARSupportedByRuntime() { - boolean ret = true; - IRuntime rt = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); - if (rt != null) - ret = rt.supports(EARFacetUtils.EAR_FACET); - return ret; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/J2EEModulePostImportHandler.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/J2EEModulePostImportHandler.java deleted file mode 100644 index d99420ee2..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/J2EEModulePostImportHandler.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 9, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal; - -import org.eclipse.core.resources.IProject; - -/** - * @author jsholl - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public interface J2EEModulePostImportHandler { - - public void moduleImported(IProject moduleProject); - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/J2EEModulePostImportHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/J2EEModulePostImportHelper.java deleted file mode 100644 index 1f8398793..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/J2EEModulePostImportHelper.java +++ /dev/null @@ -1,158 +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 - *******************************************************************************/ -/* - * Created on Jun 9, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal; - -import java.util.ArrayList; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPluginResourceHandler; - - -/** - * @author jsholl - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public class J2EEModulePostImportHelper { - - private static final String WEB = J2EEPluginResourceHandler.J2EEModulePostImportHelper_0; - private static final String EJB = J2EEPluginResourceHandler.J2EEModulePostImportHelper_1; - private static final String APP_CLIENT = J2EEPluginResourceHandler.J2EEModulePostImportHelper_2; - private static final String CONNECTOR = J2EEPluginResourceHandler.J2EEModulePostImportHelper_3; - - private static IConfigurationElement[] webExtensions = null; - private static IConfigurationElement[] ejbExtensions = null; - private static IConfigurationElement[] appClientExtensions = null; - private static IConfigurationElement[] connectorExtensions = null; - - private static boolean firstTimeLoading = true; - - public static void notifyWebExtensions(IProject project) { - if (webExtensions == null) { - loadConfiguration(WEB); - } - notifyExtensions(webExtensions, project); - } - - public static void notifyEjbExtensions(IProject project) { - if (ejbExtensions == null) { - loadConfiguration(EJB); - } - notifyExtensions(ejbExtensions, project); - } - - public static void notifyAppClientExtensions(IProject project) { - if (appClientExtensions == null) { - loadConfiguration(APP_CLIENT); - } - notifyExtensions(appClientExtensions, project); - } - - public static void notifyConnectorExtensions(IProject project) { - if (connectorExtensions == null) { - loadConfiguration(CONNECTOR); - } - notifyExtensions(connectorExtensions, project); - } - - private static void notifyExtensions(IConfigurationElement[] postImportElement, IProject project) { - for (int i = 0; i < postImportElement.length; i++) { - try { - J2EEModulePostImportHandler postCreate = (J2EEModulePostImportHandler) postImportElement[i].createExecutableExtension("className"); //$NON-NLS-1$ - postCreate.moduleImported(project); - } catch (CoreException e) { - e.printStackTrace(); - } - } - } - - private static void loadConfiguration(final String loadingModuleType) { - boolean shouldLogErrors = firstTimeLoading; - firstTimeLoading = false; - - IExtension[] importExtensions =Platform.getExtensionRegistry().getExtensionPoint("J2EEModulePostImport").getExtensions(); //$NON-NLS-1$ - - ArrayList interestedExtensions = new ArrayList(); - for (int i = 0; i < importExtensions.length; i++) { - IExtension extension = importExtensions[i]; - IConfigurationElement[] configElements = extension.getConfigurationElements(); - boolean isExtensionInterested = false; - IConfigurationElement postImportElement = null; - int moduleCount = 0; - for (int j = 0; j < configElements.length; j++) { - try { - IConfigurationElement element = configElements[j]; - if (element.getName().equalsIgnoreCase("postImport")) { //$NON-NLS-1$ - postImportElement = element; - } else if (element.getName().equalsIgnoreCase(("module"))) { //$NON-NLS-1$ - moduleCount++; - if (!isExtensionInterested) { - String moduleType = element.getAttribute("type"); //$NON-NLS-1$ - if (WEB == loadingModuleType && WEB.equalsIgnoreCase(moduleType)) { - isExtensionInterested = true; - } else if (EJB == loadingModuleType && EJB.equalsIgnoreCase(moduleType)) { - isExtensionInterested = true; - } else if (APP_CLIENT == loadingModuleType && APP_CLIENT.equalsIgnoreCase(moduleType)) { - isExtensionInterested = true; - } else if (CONNECTOR == loadingModuleType && CONNECTOR.equalsIgnoreCase(moduleType)) { - isExtensionInterested = true; - } - } - } - } catch (Exception e) { - if (shouldLogErrors) { - e.printStackTrace(); - } - } - } - - //if no module types are defined the default is to listen to all of them. - if (!isExtensionInterested && 0 == moduleCount) { - isExtensionInterested = true; - } - - if (isExtensionInterested) { - try { - //try instantiating the class before adding it to the list. - postImportElement.createExecutableExtension("className"); //$NON-NLS-1$ - interestedExtensions.add(postImportElement); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - IConfigurationElement[] configElements = new IConfigurationElement[interestedExtensions.size()]; - for (int i = 0; i < configElements.length; i++) { - configElements[i] = (IConfigurationElement) interestedExtensions.get(i); - } - if (WEB == loadingModuleType) { - webExtensions = configElements; - } else if (EJB == loadingModuleType) { - ejbExtensions = configElements; - } else if (APP_CLIENT == loadingModuleType) { - appClientExtensions = configElements; - } else if (CONNECTOR == loadingModuleType) { - connectorExtensions = configElements; - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/ResourceTypeReaderHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/ResourceTypeReaderHelper.java deleted file mode 100644 index c6494bfa1..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/ResourceTypeReaderHelper.java +++ /dev/null @@ -1,174 +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 - *******************************************************************************/ -/* - * Created on 10-Oct-03 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal; - -import java.util.ArrayList; -import java.util.Arrays; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; - -/** - * @author sapnam - * - * This helper class was created for ResourceRefTypeReader and ResourceEnvRefTypeReader to read all - * valid types from extensions of each and to return a array of String to populate the Ref 'Type' - * fields. - */ -public class ResourceTypeReaderHelper { - private static String extensionPoint; - private static String typeAttributeName; - private static final String USAGE_TYPE = "type"; //$NON-NLS-1$ - private static final String USAGE_ATTRIBUTE_NAME = "usage"; //$NON-NLS-1$ - private static final String USAGE_COMMON = "Common"; //$NON-NLS-1$ - private static final String USAGE_EJB = "EJB Jar"; //$NON-NLS-1$ - private static final String SERVER_TARGET_IDS_ATTRIBUTE_NAME = "target-server-ids"; //$NON-NLS-1$ - private static final String SERVER_TARGET_IDS_SEPARATOR = ","; //$NON-NLS-1$ - private boolean isEJBJar; - - public static final int RESOURCE_REF = 0; - public static final int RESOURCE_ENV_REF = 1; - - private static final String[] EXTENSION_POINTS = {"org.eclipse.jst.j2ee.resourceRefType", "org.eclipse.jst.j2ee.resourceEnvRefType"};//$NON-NLS-1$ //$NON-NLS-2$ - - public static String[] getAllReferences(int refType, String serverTargetID, boolean isEJBJar, String[] baseItems) { - String extensionPointLocal = EXTENSION_POINTS[refType]; - ResourceTypeReaderHelper reader = new ResourceTypeReaderHelper(extensionPointLocal, USAGE_TYPE, isEJBJar); - String[] extendedItems = null == serverTargetID ? reader.getResTypes() : reader.getResTypes(serverTargetID); - String[] allItems = null; - if (null == extendedItems || 0 == extendedItems.length) { - allItems = baseItems; - } else { - allItems = new String[baseItems.length + extendedItems.length]; - System.arraycopy(baseItems, 0, allItems, 0, baseItems.length); - System.arraycopy(extendedItems, 0, allItems, baseItems.length, extendedItems.length); - } - Arrays.sort(allItems); - return allItems; - } - - - private ResourceTypeReaderHelper(String extPoint, String typeAttName, boolean ejbJar) { - extensionPoint = extPoint; - typeAttributeName = typeAttName; - isEJBJar = ejbJar; - } - - private IExtensionPoint getExtensionPoint() { - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IExtensionPoint exPoint = registry.getExtensionPoint(extensionPoint); - return exPoint; - } - - private ArrayList processExtensions() { - IExtension[] allExtensions = getExtensionPoint().getExtensions(); - ArrayList tempTypes = new ArrayList(); - for (int x = 0; x < allExtensions.length; ++x) { - IExtension config = allExtensions[x]; - IConfigurationElement[] cElems = config.getConfigurationElements(); - for (int i = 0; i < cElems.length; i++) { - if (getValidTypes(cElems[i]) != null) { - tempTypes.add(getValidTypes(cElems[i])); - } - } - } - return tempTypes; - } - - - /** - * @return an array of string containing valid Resource Ref or Resource Env Ref types. - */ - public String[] getResTypes() { - ArrayList types = processExtensions(); - String[] allTypes = new String[types.size()]; - for (int z = 0; z < types.size(); z++) { - allTypes[z] = (String) types.get(z); - } - return allTypes; - } - - private ArrayList processExtensions(String targetServer) { - IExtension[] allExtensions = getExtensionPoint().getExtensions(); - ArrayList tempTypes = new ArrayList(); - for (int x = 0; x < allExtensions.length; ++x) { - IExtension config = allExtensions[x]; - IConfigurationElement[] cElems = config.getConfigurationElements(); - for (int i = 0; i < cElems.length; i++) { - if (getValidTypes(cElems[i], targetServer) != null) { - tempTypes.add(getValidTypes(cElems[i], targetServer)); - } - } - } - return tempTypes; - } - - /** - * @param element - * A configuration element. - * @return A valid Type - */ - private Object getValidTypes(IConfigurationElement element, String targetServer) { - String elementServerIDs = element.getAttribute(SERVER_TARGET_IDS_ATTRIBUTE_NAME); - if (null == elementServerIDs || isValidTargeted(elementServerIDs, targetServer)) { - String usage = element.getAttribute(USAGE_ATTRIBUTE_NAME); - if (usage.equals(USAGE_COMMON)) { - return element.getAttribute(typeAttributeName); - } else if (isEJBJar && usage.equals(USAGE_EJB)) { - return element.getAttribute(typeAttributeName); - } - } - return null; - } - - /** - * @param element - * A configuration element. - * @return A valid Type - */ - private Object getValidTypes(IConfigurationElement element) { - return getValidTypes(element, null); - } - - /** - * @return an array of string containing valid Resource Ref or Resource Env Ref types. - */ - public String[] getResTypes(String targetServer) { - ArrayList types = processExtensions(targetServer); - String[] allTypes = new String[types.size()]; - for (int z = 0; z < types.size(); z++) { - allTypes[z] = (String) types.get(z); - } - return allTypes; - } - - private boolean isValidTargeted(String attribute, String targetServerId) { - if (attribute == null || targetServerId == null) - return false; - if (attribute.trim().equalsIgnoreCase(targetServerId.trim())) - return true; - if (attribute.indexOf(targetServerId.trim() + SERVER_TARGET_IDS_SEPARATOR) >= 0) - return true; - if (attribute.trim().length() > (targetServerId.trim().length() + 1) && attribute.substring(attribute.trim().length() - targetServerId.length()).equalsIgnoreCase(targetServerId.trim())) - return true; - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/DeployerRegistry.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/DeployerRegistry.java deleted file mode 100644 index d07999503..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/DeployerRegistry.java +++ /dev/null @@ -1,194 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Mar 30, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.deploy; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.server.core.IRuntime; - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class DeployerRegistry { - /** - * - */ - private static DeployerRegistry INSTANCE; - private HashMap deployModuleExtensions = new HashMap(); - - public DeployerRegistry() { - super(); - } - - /** - * @param deployer - * @param serverTarget - * @param natureID - */ - public void register(IConfigurationElement deployer, List serverTargets, List natures) { - HashMap targetDeployers; - for (Iterator iter = natures.iterator(); iter.hasNext();) { - String natureID = (String) iter.next(); - for (Iterator iterator = serverTargets.iterator(); iterator.hasNext();) { - String runtimeID = (String) iterator.next(); - targetDeployers = getDeployModuleExtensions(natureID); - getTargetDeployers(targetDeployers, runtimeID).add(deployer); - } - } - } - - private List getDeployers(String natureID, String serverTarget) { - HashMap targetDeployers = getDeployModuleExtensions(natureID); - return getTargetDeployers(targetDeployers, serverTarget); - } - - public static DeployerRegistry instance() { - if (INSTANCE == null) { - INSTANCE = new DeployerRegistry(); - readRegistry(); - } - return INSTANCE; - } - - /** - * - */ - private static void readRegistry() { - DeployerRegistryReader reader = new DeployerRegistryReader(); - reader.readRegistry(); - } - - /** - * @return a list of IVirtualComponent's - */ - public static List getSelectedModules(Object[] mySelections) { - List modules = new ArrayList(); - for (int i = 0; i < mySelections.length; i++) { - Object object = mySelections[i]; - if (object instanceof EObject) { - object = ProjectUtilities.getProject(object); - } - if (object instanceof IProject) { - IVirtualComponent component = ComponentCore.createComponent((IProject)object); - IModelProvider modelProvider = null; - - modelProvider = ModelProviderManager.getModelProvider(component.getProject()); - if (modelProvider == null) - continue; - // we just happen to know it - EObject root = (EObject) modelProvider.getModelObject(); - - if (root == null || modules.contains(component)) - continue; - // Order Ears first... - if (J2EEProjectUtilities.isEARProject(component.getProject())) - modules.add(0, component); - else - modules.add(component); - - } - } - return modules; - } - - /** - * @param targetDeployers - * @param serverTarget - */ - private List getTargetDeployers(HashMap targetDeployers, String serverTarget) { - if (targetDeployers.get(serverTarget) == null) - targetDeployers.put(serverTarget, new ArrayList()); - return (List) targetDeployers.get(serverTarget); - } - - /** - * @param natureID - * @return - */ - private HashMap getDeployModuleExtensions(String natureID) { - if (getDeployModuleExtensions().get(natureID) == null) - getDeployModuleExtensions().put(natureID, new HashMap()); - return (HashMap) getDeployModuleExtensions().get(natureID); - } - - /** - * @return Returns the deployExtensions. - */ - public HashMap getDeployModuleExtensions() { - return deployModuleExtensions; - } - - /** - * @param deployExtensions - * The deployExtensions to set. - */ - public void setDeployModuleExtensions(HashMap deployExtensions) { - this.deployModuleExtensions = deployExtensions; - } - - /** - * @param module - * @param runtime - * @return - */ - public List getDeployModuleExtensions(EObject module, IRuntime runtime) { - IVirtualComponent comp = ComponentUtilities.findComponent(module); - return getDeployModuleExtensions(comp.getProject(), runtime); - } - - /** - * @param module - * @param runtime - * @return - */ - public List getDeployModuleExtensions(IProject project, IRuntime runtime) { - String typeID = ""; //$NON-NLS-1$ - if (J2EEProjectUtilities.isEARProject(project)) - typeID = J2EEProjectUtilities.ENTERPRISE_APPLICATION; - else if (J2EEProjectUtilities.isApplicationClientProject(project)) - typeID = J2EEProjectUtilities.APPLICATION_CLIENT; - else if (J2EEProjectUtilities.isDynamicWebProject(project)) - typeID = J2EEProjectUtilities.DYNAMIC_WEB; - else if (J2EEProjectUtilities.isStaticWebProject(project)) - typeID = J2EEProjectUtilities.STATIC_WEB; - else if (J2EEProjectUtilities.isEJBProject(project)) - typeID = J2EEProjectUtilities.EJB; - else if (J2EEProjectUtilities.isJCAProject(project)) - typeID = J2EEProjectUtilities.JCA; - else if (J2EEProjectUtilities.isUtilityProject(project)) - typeID = J2EEProjectUtilities.UTILITY; - String runtimeID = runtime.getRuntimeType().getId(); - return getDeployers(typeID, runtimeID); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/DeployerRegistryReader.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/DeployerRegistryReader.java deleted file mode 100644 index c384cfc85..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/DeployerRegistryReader.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Mar 29, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.deploy; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class DeployerRegistryReader extends RegistryReader { - /** - * @param registry - * @param plugin - * @param extensionPoint - */ - static final String J2EE_DEPLOYER_EXTENSION_POINT = "DeployerExtension"; //$NON-NLS-1$ - static final String TARGET_SERVER_RUNTIME_ID = "runtime_server_id"; //$NON-NLS-1$ - static final String RUNTIME = "runtime"; //$NON-NLS-1$ - static final String DEPLOYER = "deployer"; //$NON-NLS-1$ - public static final String DEPLOYER_CLASS = "deployer_class"; //$NON-NLS-1$ - static final String MODULE_TYPE_NATURE_ID = "module_nature_id"; //$NON-NLS-1$ - static final String NATURE = "nature"; //$NON-NLS-1$ - static final String COMPONENT_TYPE_ID = "component_type"; //$NON-NLS-1$ - static final String COMPONENT = "component"; //$NON-NLS-1$ - - public DeployerRegistryReader() { - super(J2EEPlugin.PLUGIN_ID, J2EE_DEPLOYER_EXTENSION_POINT); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement) - */ - public boolean readElement(IConfigurationElement element) { - if (!element.getName().equals(DEPLOYER)) - return false; - List runtimeList = new ArrayList(); - List natureandcomponents = new ArrayList(); - IConfigurationElement[] runtimes = element.getChildren(RUNTIME); - for (int i = 0; i < runtimes.length; i++) { - IConfigurationElement runtime = runtimes[i]; - String serverTarget = runtime.getAttribute(TARGET_SERVER_RUNTIME_ID); - runtimeList.add(serverTarget); - } - IConfigurationElement[] natures = element.getChildren(NATURE); - for (int i = 0; i < natures.length; i++) { - IConfigurationElement nature = natures[i]; - String natureID = nature.getAttribute(MODULE_TYPE_NATURE_ID); - natureandcomponents.add(natureID); - } - IConfigurationElement[] components = element.getChildren(COMPONENT); - for (int i = 0; i < components.length; i++) { - IConfigurationElement component = components[i]; - String compType = component.getAttribute(COMPONENT_TYPE_ID); - natureandcomponents.add(compType); - } - - String deployer = element.getAttribute(DEPLOYER_CLASS); - if (deployer != null) { - DeployerRegistry.instance().register(element, runtimeList, natureandcomponents); - return true; - } - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/FatalDeployerException.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/FatalDeployerException.java deleted file mode 100644 index 4ad2fe783..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/FatalDeployerException.java +++ /dev/null @@ -1,63 +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 - *******************************************************************************/ -/* - * Created on Mar 30, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.deploy; - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class FatalDeployerException extends Exception { - /** - * Warning clean-up 12/05/2005 - */ - private static final long serialVersionUID = -7991505439979201757L; - - /** - * - */ - public FatalDeployerException() { - super(); - // TODO Auto-generated constructor stub - } - - /** - * @param message - */ - public FatalDeployerException(String message) { - super(message); - // TODO Auto-generated constructor stub - } - - /** - * @param message - * @param cause - */ - public FatalDeployerException(String message, Throwable cause) { - super(message, cause); - // TODO Auto-generated constructor stub - } - - /** - * @param cause - */ - public FatalDeployerException(Throwable cause) { - super(cause); - // TODO Auto-generated constructor stub - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployHelper.java deleted file mode 100644 index 2168ead88..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployHelper.java +++ /dev/null @@ -1,145 +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 - *******************************************************************************/ -/* - * Created on Aug 4, 2004 - */ -package org.eclipse.jst.j2ee.internal.deploy; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.client.ApplicationClient; -import org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.jca.Connector; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.internal.emf.utilities.ICommandContext; - -/** - * @author cbridgha - * - */ -public class J2EEDeployHelper { - - /** - * @param resource - * @param context - * @returns first EJBJar found in the project - */ - public static EJBJar getEJBJar(IResource resource, ICommandContext context) { - EnterpriseArtifactEdit edit = null; - try { - if (resource instanceof IProject) { - IVirtualComponent comp = ComponentCore.createComponent((IProject)resource); - if (J2EEProjectUtilities.isEJBProject(comp.getProject())) { - edit = (EnterpriseArtifactEdit)ComponentUtilities.getArtifactEditForRead(comp); - return (EJBJar)edit.getDeploymentDescriptorRoot(); - } - } - } finally { - if (edit != null) - edit.dispose(); - } - return null; - } - - /** - * @param resource - * @param context - * @return - */ - public static Application getApplication(IResource resource, ICommandContext context) { - EnterpriseArtifactEdit edit = null; - try { - if (resource instanceof IProject) { - IVirtualComponent comp = ComponentCore.createComponent((IProject)resource); - if (J2EEProjectUtilities.isEARProject(comp.getProject())) { - edit = (EnterpriseArtifactEdit)ComponentUtilities.getArtifactEditForRead(comp); - return (Application)edit.getDeploymentDescriptorRoot(); - } - } - } finally { - if (edit != null) - edit.dispose(); - } - return null; - } - - /** - * @param resource - * @param context - * @return - */ - public static ApplicationClient getAppClient(IResource resource, ICommandContext context) { - EnterpriseArtifactEdit edit = null; - try { - if (resource instanceof IProject) { - IVirtualComponent comp = ComponentCore.createComponent((IProject)resource); - if (J2EEProjectUtilities.isApplicationClientProject(comp.getProject())) { - edit = (EnterpriseArtifactEdit)ComponentUtilities.getArtifactEditForRead(comp); - return (ApplicationClient)edit.getDeploymentDescriptorRoot(); - } - } - } finally { - if (edit != null) - edit.dispose(); - } - return null; - } - - /** - * @param resource - * @param context - * @return - */ - public static WebApp getWebApp(IResource resource, ICommandContext context) { - EnterpriseArtifactEdit edit = null; - try { - if (resource instanceof IProject) { - IVirtualComponent comp = ComponentCore.createComponent((IProject)resource); - if (J2EEProjectUtilities.isDynamicWebProject(comp.getProject())) { - edit = (EnterpriseArtifactEdit)ComponentUtilities.getArtifactEditForRead(comp); - return (WebApp)edit.getDeploymentDescriptorRoot(); - } - } - } finally { - if (edit != null) - edit.dispose(); - } - return null; - } - - /** - * @param resource - * @param context - * @return - */ - public static Connector getConnector(IResource resource, ICommandContext context) { - EnterpriseArtifactEdit edit = null; - try { - if (resource instanceof IProject) { - IVirtualComponent comp = ComponentCore.createComponent((IProject)resource); - if (J2EEProjectUtilities.isJCAProject(comp.getProject())) { - edit = (EnterpriseArtifactEdit)ComponentUtilities.getArtifactEditForRead(comp); - return (Connector)edit.getDeploymentDescriptorRoot(); - } - } - } finally { - if (edit != null) - edit.dispose(); - } - return null; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployOperation.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployOperation.java deleted file mode 100644 index 41a744d30..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployOperation.java +++ /dev/null @@ -1,234 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 - *******************************************************************************/ -/* - * Created on Apr 1, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.deploy; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPluginResourceHandler; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.internal.emf.utilities.CommandContext; -import org.eclipse.wst.common.internal.emf.utilities.ICommand; -import org.eclipse.wst.common.internal.emf.utilities.ICommandContext; -import org.eclipse.wst.server.core.IRuntime; - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class J2EEDeployOperation extends AbstractDataModelOperation { - - private Object[] selection; - private IStatus multiStatus; - private IProject currentProject; - - /** - * - */ - public J2EEDeployOperation(Object[] deployableObjects) { - super(); - selection = deployableObjects; - // TODO Auto-generated constructor stub - } - - public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - - public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - // TODO Auto-generated method stub - return null; - } - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperation#execute(org.eclipse.core.runtime.IProgressMonitor) - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - DeployerRegistry reg = DeployerRegistry.instance(); - List components = getSelectedModules(selection); - monitor.beginTask(J2EEPluginResourceHandler.J2EEDeployOperation_UI_0, components.size()); - for (int i = 0; i < components.size(); i++) { - IVirtualComponent component = null; - component = (IVirtualComponent) components.get(i); - IProject proj = component.getProject(); - IRuntime runtime = null; - try { - runtime = J2EEProjectUtilities.getServerRuntime(proj); - } - catch (CoreException e) { - J2EEPlugin.getDefault().getLog().log(e.getStatus()); - } - if (runtime == null) - continue; - List visitors = reg.getDeployModuleExtensions(proj, runtime); - deploy(visitors, component, monitor); - monitor.worked(1); - } - return getMultiStatus(); - } - - /** - * @param visitors - * @param module - */ - private void deploy(List visitors, IVirtualComponent component, IProgressMonitor monitor) { - IProject proj = component.getProject(); - for (int i = 0; i < visitors.size(); i++) { - if (!(visitors.get(i) instanceof IConfigurationElement)) - continue; - ICommand dep = null; - try { - dep = (ICommand) ((IConfigurationElement) visitors.get(i)).createExecutableExtension(DeployerRegistryReader.DEPLOYER_CLASS); - } catch (Exception e) { - e.printStackTrace(); - continue; - } - - if (dep == null) continue; - dep.init(selection); - - monitor.setTaskName(J2EEPluginResourceHandler.getString(J2EEPluginResourceHandler.J2EEDeployOperation_1_UI_, new Object[]{proj.getName(), dep.getClass().getName()})); - try { - IModelProvider modelProvider = ModelProviderManager.getModelProvider(proj); - // we just happen to know it - EObject eObject = (EObject) modelProvider.getModelObject(); - - if(eObject == null) continue; - - ICommandContext ctx = new CommandContext(monitor, null, eObject.eResource().getResourceSet()); - - dep.execute(proj, null, ctx); - addOKStatus(dep.getClass().getName()); - } catch (CoreException ex) { - Logger.getLogger().logError(ex); - Throwable statusException = (ex.getStatus().getException() != null) ? ex.getStatus().getException() : ex; - addErrorStatus(ex.getStatus(), dep.getClass().getName(), statusException); - continue; - } - } - } - - /** - * @param proj - * @param name - */ - private void addOKStatus(String DeployerName) { - - IStatus statusLocal = new Status(IStatus.OK, " ", IStatus.OK, (J2EEPluginResourceHandler.getString("J2EEDeployOperation_2_UI_", new Object[]{DeployerName})), null); //$NON-NLS-1$ //$NON-NLS-2$ - //TODO - getMultiStatus().add(statusLocal); - - } - - /** - * @param exceptionStatus - * @param proj - * @param name - */ - private void addErrorStatus(IStatus exceptionStatus, String DeployerName, Throwable ex) { - - Throwable mainCause = null; - if (exceptionStatus instanceof MultiStatus) { - IStatus[] stati = ((MultiStatus) exceptionStatus).getChildren(); - for (int i = 0; 1 < stati.length; i++) { - addErrorStatus(stati[i], DeployerName, stati[i].getException()); - } - } - mainCause = (ex.getCause() != null) ? ex.getCause() : ex; - - //String errorNotes = (mainCause != null && mainCause.getMessage() != null) ? mainCause.getMessage() : ""; - - String message = J2EEPluginResourceHandler.bind(J2EEPluginResourceHandler.J2EEDeployOperation_3_UI_,DeployerName, ""); //$NON-NLS-1$ - IStatus statusLocal = new Status(IStatus.ERROR, J2EEPlugin.getPlugin().getPluginID(), IStatus.ERROR, message, mainCause); //$NON-NLS-1$ - getMultiStatus().add(statusLocal); - - - - } - - private IStatus getMainStatus(IProject proj) { - - IStatus aStatus = new MultiStatus(J2EEPlugin.getPlugin().getPluginID(), IStatus.OK, J2EEPluginResourceHandler.getString(J2EEPluginResourceHandler.J2EEDeployOperation_4_UI_, new Object[]{proj.getName()}), null); - - return aStatus; - } - - /** - * @return Returns the multiStatus. - */ - public MultiStatus getMultiStatus() { - if (multiStatus == null) - multiStatus = getMainStatus(currentProject); - return (MultiStatus)multiStatus; - } - - /** - * @param multiStatus - * The multiStatus to set. - */ - public void setMultiStatus(IStatus newStatus) { - this.multiStatus = newStatus; - } - - protected List getSelectedModules(Object[] mySelections) { - List components = new ArrayList(); - for (int i = 0; i < mySelections.length; i++) { - Object object = mySelections[i]; - if (object instanceof EObject) { - object = ProjectUtilities.getProject(object); - currentProject = (IProject)object; - } - if (object instanceof IProject) { - currentProject = (IProject)object; - IVirtualComponent component = ComponentCore.createComponent((IProject)object); - if (components.contains(component)){ - continue; - } - // Order Ears first... - if (J2EEProjectUtilities.isEARProject(component.getProject())) { - components.add(0,component); - } - else { - components.add(component); - } - } - } - return components; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployer.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployer.java deleted file mode 100644 index b6ad428d8..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployer.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.internal.deploy; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.client.ApplicationClient; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.jca.Connector; -import org.eclipse.jst.j2ee.webapplication.WebApp; - - -/* - * Deployer interface for the J2EEDeploymentFramework - */ -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - * @deprecated - Change to use the org.eclipse.wst.common.emf.utilities.ICommand interface - */ -public interface J2EEDeployer { - /* - * This will contain the multi-selection of objects to deploy. This selection could be used to - * filter elements within a Module. Any other setup code should be done here... - */ - void init(Object[] selection); - - /* - * This will visit each extension's deploy operation on the deployable object. A Multi-Status - * should be returned - */ - IStatus visit(EJBJar deployable) throws FatalDeployerException; - - IStatus visit(ApplicationClient deployable) throws FatalDeployerException; - - IStatus visit(Application deployable) throws FatalDeployerException; - - IStatus visit(WebApp deployable) throws FatalDeployerException; - - IStatus visit(Connector deployable) throws FatalDeployerException; - - /* - * Any cleanup should be done here... - */ - void finish(); - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployableAdapterUtil.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployableAdapterUtil.java deleted file mode 100644 index f1467a2e6..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployableAdapterUtil.java +++ /dev/null @@ -1,208 +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.internal.deployables; - -import java.util.Arrays; -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualResource; -import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.IModuleArtifact; -import org.eclipse.wst.server.core.ServerUtil; -import org.eclipse.wst.server.core.util.NullModuleArtifact; - -/** - * Creates the Object adapter for ear projects. - */ -public class EnterpriseApplicationDeployableAdapterUtil { - - /** - * Constructor for EnterpriseApplicationDeployableObjectAdapter. - */ - public EnterpriseApplicationDeployableAdapterUtil() { - super(); - }// EnterpriseApplicationDeployableObjectAdapter - - /** - * Gets the object for a type of object. - * - * @param Object - * obj - Object to adapt. - */ - public static IModuleArtifact getModuleObject(Object obj) { - if (obj instanceof Application) - return getModuleObject((Application) obj); - if (obj instanceof IProject) - return getModuleObject((IProject) obj); - if (obj instanceof IFile) - return getModuleObject((IFile) obj); - return null; - }// getDeployableObject - - /** - * Gets the deployable object for ear instance. - * - * @param Application - * application - EAR instance. - */ - protected static IModuleArtifact getModuleObject(Application application) { - IModule dep = getModule(application); - return createModuleObject(dep); - }// getDeployableObject - - /** - * Gets the deployable object for project instances. - * - * @param IProject - * project - Project instance. - * @return IModuleObject - */ - protected static IModuleArtifact getModuleObject(IProject project) { - IModule dep = getModule(project,null); - return createModuleObject(dep); - }// getModuleObject - - /** - * Gets the deployable object for file instances. - * - * @param IFile - * file - File instance. - * @return IModuleObject - */ - protected static IModuleArtifact getModuleObject(IFile file) { - if (file.getProjectRelativePath().toString().endsWith(J2EEConstants.APPLICATION_DD_URI)) { - { - IVirtualResource[] resources = ComponentCore.createResources(file); - IVirtualComponent component = null; - if (resources[0] != null || resources.length <= 0) - component = resources[0].getComponent(); - return createModuleObject(getModule(file.getProject(), component)); - } - }// if - return null; - }// getModuleObject - - /** - * Gets the deployable object. - * - * @param EObject - * refObject - The current refObject. - * @return IModule - */ - protected static IModule getModule(EObject refObject) { - IProject proj = ProjectUtilities.getProject(refObject); - Resource servResource = refObject.eResource(); - IVirtualResource[] resources = null; - try { - IResource eclipeServResoruce = WorkbenchResourceHelper.getFile(servResource); - resources = ComponentCore.createResources(eclipeServResoruce); - } catch (Exception e) { - e.printStackTrace(); - } - IVirtualComponent component = null; - if (resources[0] != null) - component = resources[0].getComponent(); - return getModule(proj,component); - }// getModule - - - - protected static IModule getModuleProject(IProject project, Iterator iterator) { - IModule deployable = null; - while (iterator.hasNext()) { - Object next = iterator.next(); - if (next instanceof IModule) { - deployable = (IModule) next; - if (deployable.getProject().equals(project)) - return deployable; - } - } - return null; - } - - protected static IModule getModule(IProject project, IVirtualComponent component) { - IModule deployable = null; - Iterator iterator = Arrays.asList(ServerUtil.getModules(J2EEProjectUtilities.ENTERPRISE_APPLICATION)).iterator(); - String componentName = null; - if (component != null) - componentName = component.getName(); - else - return getModuleProject(project, iterator); - while (iterator.hasNext()) { - Object next = iterator.next(); - if (next instanceof IModule) { - deployable = (IModule) next; - if (deployable.getName().equals(componentName)) { - return deployable; - } - } - } - return null; - } - - /** - * Creates the deployable object. - * - * @param IModuleObject - * deployable - The current module object. - */ - protected static IModuleArtifact createModuleObject(IModule module) { - - if (module != null) { - return new NullModuleArtifact(module); - } - - return null; - }// createDeployableObject - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.IModuleArtifactAdapter#getId() - */ - public String getId() { - // TODO Auto-generated method stub - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.IModuleArtifactAdapter#getObjectClassName() - */ - public String getObjectClassName() { - // TODO Auto-generated method stub - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.IModuleArtifactAdapter#isPluginActivated() - */ - public boolean isPluginActivated() { - // TODO Auto-generated method stub - return false; - } - -}// EnterpriseApplicationDeployableObjectAdapter diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/FlexibleProjectServerUtil.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/FlexibleProjectServerUtil.java deleted file mode 100644 index 8330be32e..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/FlexibleProjectServerUtil.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.internal.deployables; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.server.core.IJ2EEModule; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.ServerUtil; - -public class FlexibleProjectServerUtil { - - public static IJ2EEModule getModuleDelegate(WorkbenchComponent component) { - IModule module = getModule(component); - return getModuleDelegate(module); - } - - public static IModule getModule(IProject project) { - return ServerUtil.getModule(project); - } - - public static IJ2EEModule getModuleDelegate(IModule module) { - return (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null); - } - - public static IModule getModule(WorkbenchComponent component) { - return getModule(StructureEdit.getContainingProject(component)); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEDeployableFactory.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEDeployableFactory.java deleted file mode 100644 index ab166aff6..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEDeployableFactory.java +++ /dev/null @@ -1,203 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.deployables; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.client.ApplicationClient; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.jca.Connector; -import org.eclipse.jst.j2ee.webapplication.WebApp; -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.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.model.ModuleDelegate; -import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate; - -/** - * J2EE module factory. - */ -public class J2EEDeployableFactory extends ProjectModuleFactoryDelegate { - protected Map moduleDelegates = new HashMap(5); - - public static final String ID = "org.eclipse.jst.j2ee.server"; //$NON-NLS-1$ - - public J2EEDeployableFactory() { - super(); - } - - protected IModule[] createModules(IProject project) { - try { - ModuleCoreNature nature = (ModuleCoreNature) project.getNature(IModuleConstants.MODULE_NATURE_ID); - if (nature != null) - return createModules(nature); - } catch (CoreException e) { - Logger.getLogger().write(e); - } - return null; - } - - protected IModule[] createModules(ModuleCoreNature nature) { - IProject project = nature.getProject(); - try { - IVirtualComponent comp = ComponentCore.createComponent(project); - return createModuleDelegates(comp); - } catch (Exception e) { - Logger.getLogger().write(e); - } - return null; - } - - public ModuleDelegate getModuleDelegate(IModule module) { - return (ModuleDelegate) moduleDelegates.get(module); - } - - protected IModule[] createModuleDelegates(IVirtualComponent component) { - List projectModules = new ArrayList(); - try { - if(J2EEProjectUtilities.isLegacyJ2EEProject(component.getProject())){ - IModule module = null; - String type = J2EEProjectUtilities.getJ2EEProjectType(component.getProject()); - String version = J2EEProjectUtilities.getJ2EEProjectVersion(component.getProject()); - module = createModule(component.getDeployedName(), component.getDeployedName(), type, version, component.getProject()); - J2EEFlexProjDeployable moduleDelegate = new J2EEFlexProjDeployable(component.getProject(), component); - moduleDelegates.put(module, moduleDelegate); - projectModules.add(module); - - // Check to add any binary modules - if (J2EEProjectUtilities.ENTERPRISE_APPLICATION.equals(type)) - projectModules.addAll(Arrays.asList(createBinaryModules(component))); - } else { - return null; - } - } catch (Exception e) { - Logger.getLogger().write(e); - } - return (IModule[]) projectModules.toArray(new IModule[projectModules.size()]); - } - - protected IModule[] createBinaryModules(IVirtualComponent component) { - List projectModules = new ArrayList(); - EARArtifactEdit earEdit = null; - try { - Application app = null; - IVirtualReference[] references = component.getReferences(); - for (int i=0; i<references.length; i++) { - IVirtualComponent moduleComponent = references[i].getReferencedComponent(); - // Is referenced component a J2EE binary module archive or binary utility project? - if (moduleComponent.isBinary()) { - // create an ear edit, app only if the module is binary prevents exceptions when there - // is no deployment descriptor in many cases see bug 174711 - if(earEdit == null){ - earEdit = EARArtifactEdit.getEARArtifactEditForRead(component.getProject()); - app = earEdit.getApplication(); - } - // Check if module URI exists on EAR DD for binary j2ee archive - Module j2eeModule = app.getFirstModule(references[i].getArchiveName()); - // If it is not a j2ee module and the component project is the ear, it is just an archive - // and we can ignore as it will be processed by the EAR deployable.members() method - if (j2eeModule == null && (moduleComponent.getProject() == component.getProject())) - continue; - - String moduleVersion = null; - String moduleType = null; - // Handle the binary J2EE module case - if(j2eeModule != null){ - ArtifactEdit moduleEdit = null; - try { - if (j2eeModule.isEjbModule()) { - moduleEdit = ComponentUtilities.getArtifactEditForRead(moduleComponent, J2EEProjectUtilities.EJB); - EJBJar ejbJar = (EJBJar) moduleEdit.getContentModelRoot(); - moduleType = J2EEProjectUtilities.EJB; - moduleVersion = ejbJar.getVersion(); - } - else if (j2eeModule.isWebModule()) { - moduleEdit = ComponentUtilities.getArtifactEditForRead(moduleComponent, J2EEProjectUtilities.DYNAMIC_WEB); - WebApp webApp = (WebApp) moduleEdit.getContentModelRoot(); - moduleType = J2EEProjectUtilities.DYNAMIC_WEB; - moduleVersion = webApp.getVersion(); - } - else if (j2eeModule.isConnectorModule()) { - moduleEdit = ComponentUtilities.getArtifactEditForRead(moduleComponent, J2EEProjectUtilities.JCA); - Connector connector = (Connector) moduleEdit.getContentModelRoot(); - moduleType = J2EEProjectUtilities.JCA; - moduleVersion = connector.getVersion(); - } - else if (j2eeModule.isJavaModule()) { - moduleEdit = ComponentUtilities.getArtifactEditForRead(moduleComponent, J2EEProjectUtilities.APPLICATION_CLIENT); - ApplicationClient appClient = (ApplicationClient) moduleEdit.getContentModelRoot(); - moduleType = J2EEProjectUtilities.APPLICATION_CLIENT; - moduleVersion = appClient.getVersion(); - } - } finally { - if (moduleEdit!=null) - moduleEdit.dispose(); - } - } else { // Handle the binary utility component outside the EAR case. - moduleVersion = J2EEProjectUtilities.UTILITY; - moduleType = J2EEVersionConstants.VERSION_1_0_TEXT; - } - - IModule nestedModule = createModule(moduleComponent.getDeployedName(), moduleComponent.getDeployedName(), moduleType, moduleVersion, moduleComponent.getProject()); - if (nestedModule!=null) { - J2EEFlexProjDeployable moduleDelegate = new J2EEFlexProjDeployable(moduleComponent.getProject(), moduleComponent); - moduleDelegates.put(nestedModule, moduleDelegate); - projectModules.add(nestedModule); - moduleDelegate.getURI(nestedModule); - } - } - } - } finally { - if (earEdit!=null) - earEdit.dispose(); - } - return (IModule[]) projectModules.toArray(new IModule[projectModules.size()]); - } - - /** - * Returns the list of resources that the module should listen to - * for state changes. The paths should be project relative paths. - * Subclasses can override this method to provide the paths. - * - * @return a possibly empty array of paths - */ - protected IPath[] getListenerPaths() { - return new IPath[] { - new Path(".project"), // nature - new Path(StructureEdit.MODULE_META_FILE_NAME), // component - new Path(".settings/org.eclipse.wst.common.project.facet.core.xml") // facets - }; - } - - protected void clearCache() { - moduleDelegates = new HashMap(5); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java deleted file mode 100644 index 65766356e..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java +++ /dev/null @@ -1,985 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.deployables; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Properties; -import java.util.Set; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.internal.EjbModuleExtensionHelper; -import org.eclipse.jst.j2ee.internal.IEJBModelExtenderManager; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyManifestUtil; -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.jst.server.core.IApplicationClientModule; -import org.eclipse.jst.server.core.IConnectorModule; -import org.eclipse.jst.server.core.IEJBModule; -import org.eclipse.jst.server.core.IEnterpriseApplication; -import org.eclipse.jst.server.core.IJ2EEModule; -import org.eclipse.jst.server.core.IWebModule; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.ComponentResource; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.ServerUtil; -import org.eclipse.wst.server.core.internal.ModuleFile; -import org.eclipse.wst.server.core.internal.ModuleFolder; -import org.eclipse.wst.server.core.model.IModuleFile; -import org.eclipse.wst.server.core.model.IModuleFolder; -import org.eclipse.wst.server.core.model.IModuleResource; -import org.eclipse.wst.web.internal.deployables.ComponentDeployable; -/** - * J2EE module superclass. - */ -public class J2EEFlexProjDeployable extends ComponentDeployable implements IJ2EEModule, IEnterpriseApplication, IApplicationClientModule, IConnectorModule, IEJBModule, IWebModule { - protected static final IPath WEB_CLASSES_PATH = new Path(J2EEConstants.WEB_INF_CLASSES); - protected static final IPath MANIFEST_PATH = new Path(J2EEConstants.MANIFEST_URI); - protected static IPath WEBLIB = new Path(J2EEConstants.WEB_INF_LIB).makeAbsolute(); - protected IPackageFragmentRoot[] cachedSourceContainers; - protected IContainer[] cachedOutputContainers; - protected HashMap cachedOutputMappings; - protected HashMap cachedSourceOutputPairs; - protected List classpathComponentDependencyURIs = new ArrayList(); - - /** - * Constructor for J2EEFlexProjDeployable. - * - * @param project - * @param aComponent - */ - public J2EEFlexProjDeployable(IProject project, IVirtualComponent aComponent) { - super(project, aComponent); - } - - - /** - * Constructor for J2EEFlexProjDeployable. - * - * @param project - */ - public J2EEFlexProjDeployable(IProject project) { - super(project); - } - - /** - * Returns the root folders for the resources in this module. - * - * @return a possibly-empty array of resource folders - */ - public IContainer[] getResourceFolders() { - List result = new ArrayList(); - IVirtualComponent vc = ComponentCore.createComponent(getProject()); - if (vc != null) { - IVirtualFolder vFolder = vc.getRootFolder(); - if (vFolder != null) { - IContainer[] underlyingFolders = vFolder.getUnderlyingFolders(); - result.addAll(Arrays.asList(underlyingFolders)); - } - } - return (IContainer[]) result.toArray(new IContainer[result.size()]); - } - - /** - * Returns the root folders containing Java output in this module. - * - * @return a possibly-empty array of Java output folders - */ - public IContainer[] getJavaOutputFolders() { - if (cachedOutputContainers == null) - cachedOutputContainers = getJavaOutputFolders(getProject()); - return cachedOutputContainers; - } - - public IContainer[] getJavaOutputFolders(IProject project) { - if (project == null) - return new IContainer[0]; - return J2EEProjectUtilities.getOutputContainers(project); - } - - protected boolean shouldIncludeUtilityComponent(IVirtualComponent virtualComp,IVirtualReference[] references, ArtifactEdit edit) { - // If the component module is an EAR we know all archives are filtered out of virtual component members - // and we will return only those archives which are not binary J2EE modules in the EAR DD. These J2EE modules will - // be returned by getChildModules() - if (J2EEProjectUtilities.isEARProject(component.getProject())) - return virtualComp != null && virtualComp.isBinary() && !isNestedJ2EEModule(virtualComp, references, (EARArtifactEdit)edit); - else - return super.shouldIncludeUtilityComponent(virtualComp, references, edit); - } - - protected void addUtilMember(IVirtualComponent parent, IVirtualReference reference, IPath runtimePath) { - // do not add classpath dependencies whose runtime path (../) maps to the parent component - if (!runtimePath.equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - super.addUtilMember(parent, reference, runtimePath); - } - } - - protected IModuleResource[] getBinaryModuleMembers() { - IPath archivePath = ((J2EEModuleVirtualArchiveComponent)component).getWorkspaceRelativePath(); - ModuleFile mf = null; - if (archivePath != null) { //In Workspace - IFile utilFile = ResourcesPlugin.getWorkspace().getRoot().getFile(archivePath); - mf = new ModuleFile(utilFile, utilFile.getName(), ((J2EEModuleVirtualArchiveComponent)component).getRuntimePath().makeRelative()); - } else { - File extFile = ((J2EEModuleVirtualArchiveComponent)component).getUnderlyingDiskFile(); - mf = new ModuleFile(extFile, extFile.getName(), ((J2EEModuleVirtualArchiveComponent)component).getRuntimePath().makeRelative()); - } - return new IModuleResource[] {mf}; - } - - public IModuleResource[] members() throws CoreException { - members.clear(); - classpathComponentDependencyURIs.clear(); - - // Handle binary components - if (component instanceof J2EEModuleVirtualArchiveComponent) - return getBinaryModuleMembers(); - - if (J2EEProjectUtilities.isEARProject(component.getProject())) { - // If an EAR, add classpath contributions for all referenced modules - addReferencedComponentClasspathDependencies(component, false); - } else { - if (J2EEProjectUtilities.isDynamicWebProject(component.getProject())) { - // If a web, add classpath contributions for all WEB-INF/lib modules - addReferencedComponentClasspathDependencies(component, true); - } - if (canExportClasspathComponentDependencies(component)){ - saveClasspathDependencyURIs(component); - } - } - - // If j2ee project structure is a single root structure, just return optimized members - if (isSingleRootStructure()) { - final IModuleResource[] resources = getOptimizedMembers(); - if (!classpathComponentDependencyURIs.isEmpty()) { - for (int i = 0; i < resources.length; i++) { - if (resources[i] instanceof IModuleFolder) { - IModuleFolder folder = (IModuleFolder) resources[i]; - if (folder.getName().equals(J2EEConstants.META_INF)) { - IModuleResource[] files = folder.members(); - for (int j = 0; j < files.length; j++) { - files[j] = replaceManifestFile((IModuleFile) files[j]); - } - } - } - } - } - return resources; - } - - cachedSourceContainers = J2EEProjectUtilities.getSourceContainers(getProject()); - try { - IPath javaPath = Path.EMPTY; - if (J2EEProjectUtilities.isDynamicWebProject(component.getProject())) - javaPath = WEB_CLASSES_PATH; - - if (component != null) { - IVirtualFolder vFolder = component.getRootFolder(); - IModuleResource[] mr = getMembers(vFolder, Path.EMPTY); - int size = mr.length; - for (int j = 0; j < size; j++) { - members.add(mr[j]); - } - } - - IContainer[] javaCont = getJavaOutputFolders(); - int size = javaCont.length; - for (int i = 0; i < size; i++) { - //If the java output is in the scope of the virtual component, ignore to avoid duplicates - if (ComponentCore.createResources(javaCont[i]).length > 0) - continue; - IModuleResource[] mr = getMembers(javaCont[i], javaPath, javaPath, javaCont); - int size2 = mr.length; - for (int j = 0; j < size2; j++) { - members.add(mr[j]); - } - } - - if (component != null) { - addUtilMembers(component); - List consumableMembers = getConsumableReferencedMembers(component); - if (!consumableMembers.isEmpty()) - members.addAll(consumableMembers); - } - - IModuleResource[] mr = new IModuleResource[members.size()]; - members.toArray(mr); - return mr; - } finally { - cachedSourceContainers = null; - cachedOutputContainers = null; - cachedOutputMappings = null; - cachedSourceOutputPairs = null; - } - } - - protected IModuleFile createModuleFile(IFile file, IPath path) { - // if this is the MANIFEST.MF file and we have classpath component dependencies, - // update it - return replaceManifestFile(super.createModuleFile(file, path)); - } - - protected IModuleFile replaceManifestFile(IModuleFile moduleFile) { - final IFile file = (IFile) moduleFile.getAdapter(IFile.class); - final IPath path = moduleFile.getModuleRelativePath(); - // if the MANIFEST.MF is being requested and we have classpath component dependencies, - // dynamically generate a customized MANIFEST.MF and return that - if (path.append(file.getName()).equals(MANIFEST_PATH) && !classpathComponentDependencyURIs.isEmpty()) { - final IProject project = file.getProject(); - final IPath workingLocation = project.getWorkingLocation(J2EEPlugin.PLUGIN_ID); - // create path to temp MANIFEST.MF - final IPath tempManifestPath = workingLocation.append(MANIFEST_PATH); - final File fsFile = tempManifestPath.toFile(); - if (!fsFile.exists()) { - // create parent dirs for temp MANIFEST.MF - final File parent = fsFile.getParentFile(); - if (!parent.exists()) { - if (!parent.mkdirs()) { - return moduleFile; - } - } - } - // create temp MANIFEST.MF using util method - try { - ClasspathDependencyManifestUtil.updateManifestClasspath(file, classpathComponentDependencyURIs, new FileOutputStream(fsFile)); - // create new ModuleFile that points to temp MANIFEST.MF - return new ModuleFile(fsFile, file.getName(), path); - } catch (IOException ioe) { - return moduleFile; - } - } - return moduleFile; - } - - protected IModuleResource[] handleJavaPath(IPath path, IPath javaPath, IPath curPath, IContainer[] javaCont, IModuleResource[] mr, IContainer cc) throws CoreException { - if (curPath.equals(javaPath)) { - int size = javaCont.length; - for (int i = 0; i < size; i++) { - IModuleResource[] mr2 = getMembers(javaCont[i], path.append(cc.getName()), null, null); - IModuleResource[] mr3 = new IModuleResource[mr.length + mr2.length]; - System.arraycopy(mr, 0, mr3, 0, mr.length); - System.arraycopy(mr2, 0, mr3, mr.length, mr2.length); - mr = mr3; - } - } else { - boolean containsFolder = false; - String name = javaPath.segment(curPath.segmentCount()); - int size = mr.length; - for (int i = 0; i < size && !containsFolder; i++) { - if (mr[i] instanceof IModuleFolder) { - IModuleFolder mf2 = (IModuleFolder) mr[i]; - if (name.equals(mf2.getName())) { - containsFolder = true; - } - } - } - - if (!containsFolder && javaCont.length > 0) { - ModuleFolder mf2 = new ModuleFolder(javaCont[0], name, curPath); - IModuleResource[] mrf = new IModuleResource[0]; - size = javaCont.length; - for (int i = 0; i < size; i++) { - IModuleResource[] mrf2 = getMembers(javaCont[i], javaPath, null, null); - IModuleResource[] mrf3 = new IModuleResource[mrf.length + mrf2.length]; - System.arraycopy(mrf, 0, mrf3, 0, mrf.length); - System.arraycopy(mrf2, 0, mrf3, mrf.length, mrf2.length); - mrf = mrf3; - } - - mf2.setMembers(mrf); - - IModuleResource[] mr3 = new IModuleResource[mr.length + 1]; - System.arraycopy(mr, 0, mr3, 0, mr.length); - mr3[mr.length] = mf2; - mr = mr3; - } - } - return mr; - } - - /** - * Returns the classpath as a list of absolute IPaths. - * - * @return an array of paths - */ - public IPath[] getClasspath() { - List paths = new ArrayList(); - IJavaProject proj = JemProjectUtilities.getJavaProject(getProject()); - URL[] urls = JemProjectUtilities.getClasspathAsURLArray(proj); - for (int i = 0; i < urls.length; i++) { - URL url = urls[i]; - paths.add(Path.fromOSString(url.getPath())); - } - return (IPath[]) paths.toArray(new IPath[paths.size()]); - } - - public String getJNDIName(String ejbName) { - if (!J2EEProjectUtilities.isEJBProject(component.getProject())) - return null; - EjbModuleExtensionHelper modHelper = null; - EJBJar jar = null; - ArtifactEdit ejbEdit = null; - try { - ejbEdit = ComponentUtilities.getArtifactEditForRead(component); - if (ejbEdit != null) { - jar = (EJBJar) ejbEdit.getContentModelRoot(); - modHelper = IEJBModelExtenderManager.INSTANCE.getEJBModuleExtension(null); - return modHelper == null ? null : modHelper.getJNDIName(jar, jar.getEnterpriseBeanNamed(ejbName)); - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (ejbEdit != null) - ejbEdit.dispose(); - } - return null; - } - - /** - * This method will handle a number of J2EE related scenarios. If this is an ear and a child module is passed in, - * the URI for that child module will be returned. If no child module was passed, the URI of the EAR is returned. - * If this is a child component and the module passed in is the EAR, we grab the module uri for this compared to that - * EAR. If no ear module is passed in we look for one and use it and return URI relative to found EAR. If no EAR's - * are found the URI is returned in a default manner. - * - * @return URI string - */ - public String getURI(IModule module) { - // If the component is an ear and the module passed in is a child module - if (component!=null && module!=null && J2EEProjectUtilities.isEARProject(component.getProject())) - return getContainedURI(module); - - IVirtualComponent ear = null; - String aURI = null; - // If the component is a child module and the module passed in is the ear - if (module != null && J2EEProjectUtilities.isEARProject(module.getProject())) - ear = ComponentCore.createComponent(module.getProject()); - // else if the component is a child module and the module passed in is null, search for first ear - else if (module==null && component != null) { - IProject[] earProjects = J2EEProjectUtilities.getReferencingEARProjects(component.getProject()); - if (earProjects.length>0) - ear = ComponentCore.createComponent(earProjects[0]); - } - // We have a valid ear and the component is a valid child - if (ear != null && component != null) { - EARArtifactEdit earEdit = null; - try { - earEdit = EARArtifactEdit.getEARArtifactEditForRead(ear); - if (earEdit != null) - aURI = earEdit.getModuleURI(component); - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (earEdit != null) - earEdit.dispose(); - } - } - // We have an ear component and no child module - else if (component!=null && J2EEProjectUtilities.isEARProject(component.getProject())) { - aURI = component.getDeployedName()+IJ2EEModuleConstants.EAR_EXT; - } - // We have child components but could not find valid ears - else if (component!=null && J2EEProjectUtilities.isDynamicWebProject(component.getProject())) { - if (module != null && J2EEProjectUtilities.isUtilityProject(module.getProject())) { - IVirtualComponent webComp = ComponentCore.createComponent(component.getProject()); - IVirtualReference reference = webComp.getReference(module.getProject().getName()); - aURI = ComponentUtilities.getDeployUriOfUtilComponent(reference); - }else{ - aURI = component.getDeployedName()+IJ2EEModuleConstants.WAR_EXT; - } - } - else if (component!=null && (J2EEProjectUtilities.isEJBProject(component.getProject()) || J2EEProjectUtilities.isApplicationClientProject(component.getProject()))) { - aURI = component.getDeployedName()+IJ2EEModuleConstants.JAR_EXT; - } - else if (component!=null && J2EEProjectUtilities.isJCAProject(component.getProject())) { - aURI = component.getDeployedName()+IJ2EEModuleConstants.RAR_EXT; - } - - if (aURI !=null && aURI.length()>1 && aURI.startsWith("/")) //$NON-NLS-1$ - aURI = aURI.substring(1); - return aURI; - } - - protected boolean isBinaryModuleArchive(IModule module) { - if (module!=null && module.getName().endsWith(IJ2EEModuleConstants.JAR_EXT) || module.getName().endsWith(IJ2EEModuleConstants.WAR_EXT) || - module.getName().endsWith(IJ2EEModuleConstants.RAR_EXT)) { - if (component!=null && J2EEProjectUtilities.isEARProject(component.getProject())) - return true; - } - return false; - } - - private String getContainedURI(IModule module) { - if (component instanceof J2EEModuleVirtualArchiveComponent || isBinaryModuleArchive(module)) - return new Path(module.getName()).lastSegment(); - - IVirtualComponent comp = ComponentCore.createComponent(module.getProject()); - String aURI = null; - if (comp!=null && component!=null && J2EEProjectUtilities.isEARProject(component.getProject())) { - EARArtifactEdit earEdit = null; - try { - earEdit = EARArtifactEdit.getEARArtifactEditForRead(component); - if (earEdit != null) - aURI = earEdit.getModuleURI(comp); - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (earEdit != null) - earEdit.dispose(); - } - } - if (aURI !=null && aURI.length()>1 && aURI.startsWith("/")) //$NON-NLS-1$ - aURI = aURI.substring(1); - return aURI; - } - - /** - * This method returns the context root property from the deployable project's .component file - */ - public String getContextRoot() { - Properties props = component.getMetaProperties(); - if(props.containsKey(J2EEConstants.CONTEXTROOT)) - return props.getProperty(J2EEConstants.CONTEXTROOT); - return component.getName(); - } - - /** - * This method is applicable for a web deployable. The module passed in should either be null or - * the EAR module the web deployable is contained in. It will return the context root from the EAR - * if it has one or return the .component value in the web project if it is standalone. - * - * @param module - * @return contextRoot String - */ - public String getContextRoot(IModule earModule) { - IProject deployProject = component.getProject(); - String contextRoot = null; - if (earModule == null) - return getContextRoot(); - else if (J2EEProjectUtilities.isEARProject(earModule.getProject()) && J2EEProjectUtilities.isDynamicWebProject(deployProject)) { - EARArtifactEdit edit = null; - try { - edit = EARArtifactEdit.getEARArtifactEditForRead(earModule.getProject()); - contextRoot = edit.getWebContextRoot(deployProject); - } finally { - if (edit!=null) - edit.dispose(); - } - } - return contextRoot; - } - - /** - * Find the source container, if any, for the given file. - * - * @param file - * @return IPackageFragmentRoot sourceContainer for IFile - */ - protected IPackageFragmentRoot getSourceContainer(IFile file) { - if (file == null) - return null; - IPackageFragmentRoot[] srcContainers = getSourceContainers(); - for (int i=0; i<srcContainers.length; i++) { - IPath srcPath = srcContainers[i].getPath(); - if (srcPath.isPrefixOf(file.getFullPath())) - return srcContainers[i]; - } - return null; - } - - /** - * Either returns value from cache or stores result as value in cache for the corresponding - * output container for the given source container. - * - * @param sourceContainer - * @return IContainer output container for given source container - */ - protected IContainer getOutputContainer(IPackageFragmentRoot sourceContainer) { - if (sourceContainer == null) - return null; - - HashMap pairs = getCachedSourceOutputPairs(); - IContainer output = (IContainer) pairs.get(sourceContainer); - if (output == null) { - output = J2EEProjectUtilities.getOutputContainer(getProject(), sourceContainer); - pairs.put(sourceContainer,output); - } - return output; - } - - private IPackageFragmentRoot[] getSourceContainers() { - if (cachedSourceContainers != null) - return cachedSourceContainers; - return J2EEProjectUtilities.getSourceContainers(getProject()); - } - - protected List getConsumableReferencedMembers(IVirtualComponent vc) throws CoreException { - List consumableMembers = new ArrayList(); - IVirtualReference[] refComponents = vc.getReferences(); - for (int i = 0; i < refComponents.length; i++) { - IVirtualReference reference = refComponents[i]; - if (reference != null && reference.getDependencyType()==IVirtualReference.DEPENDENCY_TYPE_CONSUMES) { - IVirtualComponent consumedComponent = reference.getReferencedComponent(); - if (consumedComponent!=null && isProjectOfType(consumedComponent.getProject(),IModuleConstants.JST_UTILITY_MODULE)) { - if (consumedComponent != null && consumedComponent.getRootFolder()!=null) { - IVirtualFolder vFolder = consumedComponent.getRootFolder(); - IModuleResource[] mr = getMembers(vFolder, reference.getRuntimePath().makeRelative()); - int size = mr.length; - for (int j = 0; j < size; j++) { - if (!members.contains(mr[j])) - members.add(mr[j]); - } - addUtilMembers(consumedComponent); - List childConsumableMembers = getConsumableReferencedMembers(consumedComponent); - if (!childConsumableMembers.isEmpty()) - members.addAll(childConsumableMembers); - } - - IContainer[] javaCont = getJavaOutputFolders(consumedComponent.getProject()); - int size = javaCont.length; - for (int j = 0; j < size; j++) { - IModuleResource[] mr = getMembers(javaCont[j], reference.getRuntimePath(), reference.getRuntimePath(), javaCont); - int size2 = mr.length; - for (int k = 0; k < size2; k++) { - if (!members.contains(mr[k])) - members.add(mr[k]); - } - } - } - } - } - return consumableMembers; - } - - protected IModule gatherModuleReference(IVirtualComponent component, IVirtualComponent targetComponent ) { - IModule module = super.gatherModuleReference(component, targetComponent); - // Handle binary module components - if (targetComponent instanceof J2EEModuleVirtualArchiveComponent) { - if (J2EEProjectUtilities.isEARProject(component.getProject()) || targetComponent.getProject()!=component.getProject()) - module = ServerUtil.getModule(J2EEDeployableFactory.ID+":"+targetComponent.getName()); //$NON-NLS-1$ - } - return module; - } - - /** - * Determine if the component is nested J2EE module on the application.xml of this EAR - * @param aComponent - * @return boolean is passed in component a nested J2EE module on this EAR - */ - private boolean isNestedJ2EEModule(IVirtualComponent aComponent, IVirtualReference[] references, EARArtifactEdit edit) { - if (edit==null) - return false; - Application app = edit.getApplication(); - IVirtualReference reference = getReferenceNamed(references,aComponent.getName()); - // Ensure module URI exists on EAR DD for binary archive - return app.getFirstModule(reference.getArchiveName()) != null; - } - - protected IVirtualReference getReferenceNamed(IVirtualReference[] references, String name) { - for (int i=0; i<references.length; i++) { - if (references[i].getReferencedComponent().getName().equals(name)) - return references[i]; - } - return null; - } - - protected ArtifactEdit getComponentArtifactEditForRead() { - return EARArtifactEdit.getEARArtifactEditForRead(component.getProject()); - } - - /** - * The references for J2EE module deployment are only those child modules of EARs or web modules - */ - protected IVirtualReference[] getReferences(IVirtualComponent aComponent) { - if (aComponent == null || aComponent.isBinary()) { - return new IVirtualReference[] {}; - } else if (J2EEProjectUtilities.isDynamicWebProject(aComponent.getProject())) { - return getWebLibModules((J2EEModuleVirtualComponent)aComponent); - } else if (J2EEProjectUtilities.isEARProject(aComponent.getProject())) { - return super.getReferences(aComponent); - } else { - return new IVirtualReference[] {}; - } - } - - /** - * This method will return the list of dependent modules which are utility jars in the web lib - * folder of the deployed path of the module. It will not return null. - * - * @return array of the web library dependent modules - */ - private IVirtualReference[] getWebLibModules(J2EEModuleVirtualComponent comp) { - List result = new ArrayList(); - IVirtualReference[] refComponents = comp.getNonManifestReferences(); - // Check the deployed path to make sure it has a lib parent folder and matchs the web.xml - // base path - for (int i = 0; i < refComponents.length; i++) { - if (refComponents[i].getRuntimePath().equals(WEBLIB)) - result.add(refComponents[i]); - } - return (IVirtualReference[]) result.toArray(new IVirtualReference[result.size()]); - } - - /* - * Add any classpath component dependencies from this component - */ - private void addReferencedComponentClasspathDependencies(final IVirtualComponent component, final boolean web) { - final IVirtualReference[] refs = component.getReferences(); - final Set absolutePaths = new HashSet(); - for (int i = 0; i < refs.length; i++) { - final IVirtualReference reference = refs[i]; - final IPath runtimePath = reference.getRuntimePath(); - final IVirtualComponent referencedComponent = reference.getReferencedComponent(); - - // if we are adding to a web project, only process references with the /WEB-INF/lib runtime path - if (web && !runtimePath.equals(WEBLIB)) { - continue; - } - - // if the reference cannot export dependencies, skip - if (!canExportClasspathComponentDependencies(referencedComponent)) { - continue; - } - - if (!referencedComponent.isBinary() && referencedComponent instanceof J2EEModuleVirtualComponent) { - final IVirtualReference[] cpRefs = ((J2EEModuleVirtualComponent) referencedComponent).getJavaClasspathReferences(); - for (int j = 0; j < cpRefs.length; j++) { - final IVirtualReference cpRef = cpRefs[j]; - - IPath cpRefRuntimePath = cpRef.getRuntimePath(); - // only process references with ../ mapping - if (cpRefRuntimePath.equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - // runtime path within deployed app will be runtime path of parent component - cpRefRuntimePath = runtimePath; - } - if (cpRef.getReferencedComponent() instanceof VirtualArchiveComponent) { - // want to avoid adding dups - final IPath absolutePath = ClasspathDependencyUtil.getClasspathVirtualReferenceLocation(cpRef); - if (absolutePaths.contains(absolutePath)) { - // have already added a member for this archive - continue; - } else { - addUtilMember(component, cpRef, cpRefRuntimePath); - absolutePaths.add(absolutePath); - } - } - } - } - } - } - - private boolean canExportClasspathComponentDependencies(IVirtualComponent component) { - final IProject project = component.getProject(); - // check for valid project type - if (J2EEProjectUtilities.isEJBProject(project) - || J2EEProjectUtilities.isDynamicWebProject(project) - || J2EEProjectUtilities.isJCAProject(project) - || J2EEProjectUtilities.isUtilityProject(project)) { - return true; - } - return false; - } - - private void saveClasspathDependencyURIs(IVirtualComponent component) { - if (!component.isBinary() && component instanceof J2EEModuleVirtualComponent) { - final IVirtualReference[] cpRefs = ((J2EEModuleVirtualComponent) component).getJavaClasspathReferences(); - for (int j = 0; j < cpRefs.length; j++) { - final IVirtualReference cpRef = cpRefs[j]; - // if we are adding to an EAR project, only process references with the root mapping - if (!cpRef.getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - // fails the runtime path test - continue; - } - if (cpRef.getReferencedComponent() instanceof VirtualArchiveComponent) { - classpathComponentDependencyURIs.add(cpRef.getArchiveName()); - } - } - } - } - - /** - * Returns <code>true</code> if this module has a simple structure based on a - * single root folder, and <code>false</code> otherwise. - * <p> - * In a single root structure, all files that are contained within the root folder - * are part of the module, and are already in the correct module structure. No - * module resources exist outside of this single folder. - * - * For J2EE, this method will check if the project is already in J2EE spec standard output form. - * The project must follow certain rules, but in general, the project's content roots must be source folders - * and the output folder must also be the the content root folder. - * </p> - * - * @return <code>true</code> if this module has a single root structure, and - * <code>false</code> otherwise - */ - public boolean isSingleRootStructure() { - StructureEdit edit = null; - try { - edit = StructureEdit.getStructureEditForRead(getProject()); - if (edit == null || edit.getComponent() == null) - return false; - WorkbenchComponent wbComp = edit.getComponent(); - List resourceMaps = wbComp.getResources(); - - if (J2EEProjectUtilities.isEARProject(getProject())) { - // Always return false for EARs so that members for EAR are always calculated and j2ee modules - // are filtered out - return false; - } else if (J2EEProjectUtilities.isDynamicWebProject(getProject())) { - // If there are any web lib jar references, this is not a standard project - IVirtualReference[] references = ((J2EEModuleVirtualComponent)component).getNonManifestReferences(); - for (int i=0; i<references.length; i++) { - if (references[i].getReferencedComponent().isBinary()) - return false; - } - // Ensure there are only basic component resource mappings -- one for the content folder - // and any for src folders mapped to WEB-INF/classes - if (hasDefaultWebResourceMappings(resourceMaps)) { - // Verify only one java output folder - if (getJavaOutputFolders().length==1) { - // Verify the java output folder is to <content root>/WEB-INF/classes - IPath javaOutputPath = getJavaOutputFolders()[0].getProjectRelativePath(); - IPath compRootPath = component.getRootFolder().getUnderlyingFolder().getProjectRelativePath(); - if (compRootPath.append(J2EEConstants.WEB_INF_CLASSES).equals(javaOutputPath)) - return true; - } - } - return false; - } else if (J2EEProjectUtilities.isEJBProject(getProject()) || J2EEProjectUtilities.isJCAProject(getProject()) - || J2EEProjectUtilities.isApplicationClientProject(getProject()) || J2EEProjectUtilities.isUtilityProject(getProject())) { - // Ensure there are only source folder component resource mappings to the root content folder - if (isRootResourceMapping(resourceMaps,false)) { - // Verify only one java outputfolder - if (getJavaOutputFolders().length==1) { - // At this point for utility projects, this project is optimized, we can just use the output folder - if (J2EEProjectUtilities.isUtilityProject(getProject())) - return true; - // Verify the java output folder is the same as one of the content roots - IPath javaOutputPath = getJavaOutputFolders()[0].getProjectRelativePath(); - IContainer[] rootFolders = component.getRootFolder().getUnderlyingFolders(); - for (int i=0; i<rootFolders.length; i++) { - IPath compRootPath = rootFolders[i].getProjectRelativePath(); - if (javaOutputPath.equals(compRootPath)) - return true; - } - } - } - return false; - } - return true; - } finally { - if (edit !=null) - edit.dispose(); - } - } - - /** - * Ensure that any component resource mappings are for source folders and - * that they map to the root content folder - * - * @param resourceMaps - * @return boolean - */ - private boolean isRootResourceMapping(List resourceMaps, boolean isForEAR) { - // If the list is empty, return false - if (resourceMaps.size()<1) - return false; - - for (int i=0; i<resourceMaps.size(); i++) { - ComponentResource resourceMap = (ComponentResource) resourceMaps.get(i); - // Verify it maps to "/" for the content root - if (!resourceMap.getRuntimePath().equals(Path.ROOT)) - return false; - // If this is not for an EAR, verify it is also a src container - if (!isForEAR) { - IPath sourcePath = getProject().getFullPath().append(resourceMap.getSourcePath()); - if (!isSourceContainer(sourcePath)) - return false; - } - } - return true; - } - - /** - * Checks if the path argument is to a source container for the project. - * - * @param a workspace relative full path - * @return is path a source container? - */ - private boolean isSourceContainer(IPath path) { - IPackageFragmentRoot[] srcContainers = getSourceContainers(); - for (int i=0; i<srcContainers.length; i++) { - if (srcContainers[i].getPath().equals(path)) - return true; - } - return false; - } - - /** - * Ensure the default web setup is correct with one resource map and any number of java - * resource maps to WEB-INF/classes - * - * @param resourceMaps - * @return boolean - */ - private boolean hasDefaultWebResourceMappings(List resourceMaps) { - int rootValidMaps = 0; - int javaValidRoots = 0; - - // If there aren't at least 2 maps, return false - if (resourceMaps.size()<2) - return false; - - IPath webInfClasses = new Path(J2EEConstants.WEB_INF_CLASSES).makeAbsolute(); - for (int i=0; i<resourceMaps.size(); i++) { - ComponentResource resourceMap = (ComponentResource) resourceMaps.get(i); - IPath sourcePath = getProject().getFullPath().append(resourceMap.getSourcePath()); - - // Verify if the map is for the content root - if (resourceMap.getRuntimePath().equals(Path.ROOT)) { - rootValidMaps++; - // Verify if the map is for a java src folder and is mapped to "WEB-INF/classes" - } else if (resourceMap.getRuntimePath().equals(webInfClasses) && isSourceContainer(sourcePath)) { - javaValidRoots++; - // Otherwise we bail because we have a non optimized map - } else { - return false; - } - } - // Make sure only one of the maps is the content root, and that at least one is for the java folder - return rootValidMaps==1 && javaValidRoots>0; - } - - /** - * This method is added for performance reasons. - * It assumes the virtual component is not using any flexible features and is in a standard J2EE format - * with one component root folder and an output folder the same as its content folder. This will bypass - * the virtual component API and just return the module resources as they are on disk. - * - * @return array of ModuleResources - * @throws CoreException - */ - private IModuleResource[] getOptimizedMembers() throws CoreException { - if (component != null) { - // For java utility modules, we can just use the output container, at this point we know there is only one - if (J2EEProjectUtilities.isUtilityProject(getProject())) { - return getModuleResources(Path.EMPTY, getJavaOutputFolders()[0]); - } - // For J2EE modules, we use the contents of the content root - else { - IVirtualFolder vFolder = component.getRootFolder(); - return getModuleResources(Path.EMPTY, vFolder.getUnderlyingFolder()); - } - } - return new IModuleResource[] {}; - } - - /** - * This method will return from cache or add to cache whether or not an output container - * is mapped in the virtual component. - * - * @param outputContainer - * @return if output container is mapped - */ - private boolean isOutputContainerMapped(IContainer outputContainer) { - if (outputContainer == null) - return false; - - HashMap outputMaps = getCachedOutputMappings(); - Boolean result = (Boolean) outputMaps.get(outputContainer); - if (result == null) { - // If there are any component resources for the container, we know it is mapped - if (ComponentCore.createResources(outputContainer).length > 0) - result = Boolean.TRUE; - // Otherwise it is not mapped - else - result = Boolean.FALSE; - // Cache the result in the map for this output container - outputMaps.put(outputContainer, result); - } - return result.booleanValue(); - } - - /** - * Lazy initialize the cached output mappings - * @return HashMap - */ - private HashMap getCachedOutputMappings() { - if (cachedOutputMappings==null) - cachedOutputMappings = new HashMap(); - return cachedOutputMappings; - } - - /** - * Lazy initialize the cached source - output pairings - * @return HashMap - */ - private HashMap getCachedSourceOutputPairs() { - if (cachedSourceOutputPairs==null) - cachedSourceOutputPairs = new HashMap(); - return cachedSourceOutputPairs; - } - - /** - * This file should be added to the members list from the virtual component maps only if: - * a) it is not in a source folder - * b) it is in a source folder, and the corresponding output folder is a mapped component resource - * - * @return boolean should file be added to members - */ - protected boolean shouldAddComponentFile(IFile file) { - IPackageFragmentRoot sourceContainer = getSourceContainer(file); - // If the file is not in a source container, return true - if (sourceContainer==null) { - return true; - // Else if it is a source container and the output container is mapped in the component, return true - // Otherwise, return false. - } else { - IContainer outputContainer = getOutputContainer(sourceContainer); - return outputContainer!=null && isOutputContainerMapped(outputContainer); - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java deleted file mode 100644 index 8f41b483b..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java +++ /dev/null @@ -1,42 +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.internal.plugin; - -import java.io.IOException; - -import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver; -import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver; -import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin; -import org.xml.sax.InputSource; - -public class CatalogJ2EEXmlDtDEntityResolver extends J2EEXmlDtDEntityResolver { - - private URIResolver uriResolver; - - public CatalogJ2EEXmlDtDEntityResolver() { - } - - public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws IOException, org.xml.sax.SAXException { - if (uriResolver == null) { - uriResolver = URIResolverPlugin.createResolver(); - } - String uri = uriResolver.resolve(null, publicId, systemId); - if (null != uri) { - InputSource result = new InputSource(uri); - result.setPublicId(publicId); - // force the encoding to be UTF8 - result.setEncoding("UTF-8"); //$NON-NLS-1$ - return result; - } - return super.resolveEntity(publicId, systemId); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java deleted file mode 100644 index 28a0a96aa..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java +++ /dev/null @@ -1,32 +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.j2ee.internal.plugin; - -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; - -public interface IJ2EEModuleConstants extends IModuleConstants { - - public static final String J2EE_PLUGIN_ID = "org.eclipse.jst.j2ee"; //$NON-NLS-1$ - - public static final String EAR_EXT = ".ear"; //$NON-NLS-1$ - public static final String JAR_EXT = ".jar"; //$NON-NLS-1$ - public static final String WAR_EXT = ".war"; //$NON-NLS-1$ - public static final String RAR_EXT = ".rar"; //$NON-NLS-1$ - - public static final String JST_EAR_TEMPLATE = "template.jst.ear"; //$NON-NLS-1$ - public static final String JST_UTILITY_TEMPLATE = "template.jst.utility"; //$NON-NLS-1$ - public static final String JST_APPCLIENT_TEMPLATE = "template.jst.appclient"; //$NON-NLS-1$ - public static final String JST_EJB_TEMPLATE = "template.jst.ejb"; //$NON-NLS-1$ - public static final String JST_JCA_TEMPLATE = "template.jst.connector"; //$NON-NLS-1$ - public static final String JST_WEB_TEMPLATE = "template.jst.web"; //$NON-NLS-1$ - public static final String WST_WEB_TEMPLATE = "template.wst.web"; //$NON-NLS-1$ - public static final String JST_COMPONENT_FILE = "org.eclipse.wst.common.component";//$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEPreferences.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEPreferences.java deleted file mode 100644 index a0c2f8a3e..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEPreferences.java +++ /dev/null @@ -1,23 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.internal.plugin; - - -public interface IJ2EEPreferences { - - String PREF_J2EEWEBCONTENT = "org.eclipse.jst.j2ee.internal.preference.j2eeWebContentName"; //$NON-NLS-1$ - String PREF_STATICWEBCONTENT = "org.eclipse.jst.j2ee.internal.preference.staticWebContentName"; //$NON-NLS-1$ - String PREF_JAVASOURCE = "org.eclipse.jst.j2ee.internal.preference.javaSourceName"; //$NON-NLS-1$ - String DEFAULT_J2EEWEBCONTENT = "WebContent"; //$NON-NLS-1$ - String DEFAULT_STATICWEBCONTENT = "WebContent"; //$NON-NLS-1$ - String DEFAULT_JAVASOURCE = "JavaSource"; //$NON-NLS-1$ - String SERVER_TARGET_SUPPORT = "org.eclipse.jst.j2ee.internal.preference.servertargetsupport"; //$NON-NLS-1$ - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEGroupInitializer.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEGroupInitializer.java deleted file mode 100644 index 69cb751b5..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEGroupInitializer.java +++ /dev/null @@ -1,47 +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 - *******************************************************************************/ -/* - * Created on Dec 4, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.plugin; - -import org.eclipse.core.resources.IProject; -import org.eclipse.wst.common.frameworks.internal.enablement.IGroupInitializer; - - -/** - * @author schacher - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class J2EEGroupInitializer implements IGroupInitializer { - - /** - * - */ - public J2EEGroupInitializer() { - super(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.group.IGroupInitializer#isGroupEnabled(org.eclipse.core.resources.IProject) - */ - public boolean isGroupEnabled(IProject project) { - return true; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPlugin.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPlugin.java deleted file mode 100644 index 4dc5d791f..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPlugin.java +++ /dev/null @@ -1,675 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.plugin; - - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.MissingResourceException; -import java.util.ResourceBundle; -import java.util.Vector; - -import org.eclipse.core.internal.boot.PlatformURLConnection; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdapterManager; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jdt.core.IJavaModel; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jem.util.UIContextDetermination; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.jst.j2ee.application.ApplicationFactory; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.internal.impl.ApplicationFactoryImpl; -import org.eclipse.jst.j2ee.applicationclient.internal.modulecore.util.AppClientEditAdapterFactory; -import org.eclipse.jst.j2ee.common.internal.impl.J2EEResourceFactoryRegistry; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveInit; -import org.eclipse.jst.j2ee.internal.common.VirtualArchiveComponentAdapterFactory; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; -import org.eclipse.jst.j2ee.internal.modulecore.util.EarEditAdapterFactory; -import org.eclipse.jst.j2ee.internal.validation.ResourceUtil; -import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver; -import org.eclipse.jst.j2ee.refactor.listeners.J2EEElementChangedListener; -import org.eclipse.jst.j2ee.refactor.listeners.ProjectRefactoringListener; -import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel; -import org.eclipse.wst.common.componentcore.internal.impl.ReferencedComponentXMIResourceFactory; -import org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent; -import org.eclipse.wst.common.frameworks.internal.WTPPlugin; -import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress; -import org.eclipse.wst.common.internal.emf.resource.ReferencedXMIFactoryImpl; -import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities; -import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel; -import org.eclipse.wst.validation.internal.operations.ValidatorManager; -import org.eclipse.wst.validation.internal.plugin.ValidationPlugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import java.lang.Throwable; - -/** - * This is a top-level class of the j2ee plugin. - * - * @see AbstractUIPlugin for additional information on UI plugins - */ - -public class J2EEPlugin extends WTPPlugin implements ResourceLocator { - - public static final String PLUGIN_ID = "org.eclipse.jst.j2ee"; //$NON-NLS-1$ - public static final String UI_PLUGIN_ID = "org.eclipse.jst.j2ee.ui"; //$NON-NLS-1$ - protected final IPath iconsFolder = new Path(Platform.getBundle(PLUGIN_ID).getEntry("icons").getPath()); //$NON-NLS-1$ - // LibDir Change Listener - public static final String LIBDIRCHANGE_BUILDER_ID = "org.eclipse.jst.j2ee.web.LibDirBuilder"; //$NON-NLS-1$ - // LibCopy builder ID - public static final String LIBCOPY_BUILDER_ID = PLUGIN_ID + ".LibCopyBuilder"; //$NON-NLS-1$ - // Validation part of the plugin - public static final String VALIDATION_BUILDER_ID = ValidationPlugin.VALIDATION_BUILDER_ID; // plugin -// private static final String KEY_PREFIX = "%"; //$NON-NLS-1$ -// private static final String KEY_DOUBLE_PREFIX = "%%"; //$NON-NLS-1$ - // id - // of - // the - // validation - // builder//$NON-NLS-1$ - //Global ResourceSet (somewhat global) - private static boolean defaultIsWorkspaceRelativeSchema = false; - - private List fextendedEditModels; - private static IPath location; - - public static IStatus OK_STATUS = new Status(IStatus.OK, PLUGIN_ID, 0, "OK", null); //$NON-NLS-1$ - - public static final String[] ICON_DIRS = new String[]{"icons/full/obj16", //$NON-NLS-1$ - "icons/full/cview16", //$NON-NLS-1$ - "icons/full/ctool16", //$NON-NLS-1$ - "icons/full/clcl16", //$NON-NLS-1$ - "icons/full/ovr16", //$NON-NLS-1$ - "icons/full/extra", //$NON-NLS-1$ - "icons/full/wizban", //$NON-NLS-1$ - "icons", //$NON-NLS-1$ - ""}; //$NON-NLS-1$ - - protected static Boolean EJB_AVAILABLE = null; - private static Boolean HAS_DEV_ROLE; - - private J2EEPreferences preferences = null; - public static J2EEPlugin INSTANCE; - - /** - * Create the J2EE plugin and cache its default instance - */ - public J2EEPlugin() { - super(); - if (INSTANCE == null) - INSTANCE = this; - try { - resourceBundle = ResourceBundle.getBundle("org.eclipse.jst.j2ee"); //$NON-NLS-1$ - } catch (MissingResourceException x) { - resourceBundle = null; - - } - } - - /** - * Insert the method's description here. Creation date: (7/16/2001 7:38:56 PM) - * - * @return boolean - */ - public static boolean defaultIsWorkspaceRelativeSchema() { - return defaultIsWorkspaceRelativeSchema; - } - - /** - * Get the one application factory. - */ - public ApplicationFactory getApplicationFactory() { - return (ApplicationFactory) getApplicationPackage().getEFactoryInstance(); - } - - /** - * Get the one ejb package. - */ - public ApplicationPackage getApplicationPackage() { - return ApplicationFactoryImpl.getPackage(); - } - - /** - * Get the plugin singleton. - */ - static public J2EEPlugin getDefault() { - return INSTANCE; - } - - /* - * Javadoc copied from interface. - */ - public URL getBaseURL() { - return getBundle().getEntry("/"); //$NON-NLS-1$ - } - - - public Object[] getJ2EEWebProjectMigrationExtensions() { - - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IExtensionPoint pct = registry.getExtensionPoint("J2EEWebProjectMigrationExtension"); //$NON-NLS-1$ - List ret = new Vector(); - if (pct != null) { - IExtension[] extension = pct.getExtensions(); - for (int l = 0; l < extension.length; ++l) { - IExtension config = extension[l]; - - IConfigurationElement[] cElems = config.getConfigurationElements(); - for (int i = 0; i < cElems.length; i++) { - IConfigurationElement d = cElems[i]; - if (d.getName().equals("migration")) { //$NON-NLS-1$ - try { - Object me = d.createExecutableExtension("run"); //$NON-NLS-1$ - - ret.add(me); - } catch (Exception ex) { - // ignore this extension, keep going - } - } - } - } - } - return ret.toArray(); - } - - public EditModel getExtendedEditModel(String editModelKey) { - - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IExtensionPoint pct = registry.getExtensionPoint("EditModelExtension"); //$NON-NLS-1$ - - IExtension[] extension = pct.getExtensions(); - for (int l = 0; l < extension.length; ++l) { - IExtension config = extension[l]; - - IConfigurationElement[] cElems = config.getConfigurationElements(); - for (int i = 0; i < cElems.length; i++) { - IConfigurationElement d = cElems[i]; - if (d.getName().equals("editmodel") && editModelKey.equals(d.getAttribute("key"))) //$NON-NLS-1$ //$NON-NLS-2$ - { // editmodel class - try { - return (EditModel) d.createExecutableExtension("run"); //$NON-NLS-1$ - - } catch (Exception ex) { - return null; - } - } - } - } - - return null; - } - - public List getExtendedEditModels() { - - if (fextendedEditModels != null) - return fextendedEditModels; - List editModels = new ArrayList(); - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IExtensionPoint pct = registry.getExtensionPoint("EditModelExtension"); //$NON-NLS-1$ - - IExtension[] extension = pct.getExtensions(); - for (int l = 0; l < extension.length; ++l) { - IExtension config = extension[l]; - - IConfigurationElement[] cElems = config.getConfigurationElements(); - for (int i = 0; i < cElems.length; i++) { - IConfigurationElement d = cElems[i]; - if (d.getName().equals("editmodel")) //$NON-NLS-1$ - { - // editmodel class - try { - editModels.add(d.createExecutableExtension("run")); //$NON-NLS-1$ - - } catch (Exception ex) { - return null; - } - } - } - } - fextendedEditModels = editModels; - return fextendedEditModels; - } - - /** - * This gets a .gif from the icons folder. - */ - public static URL getImageURL(String key, Bundle bundle) { - String gif = "/" + key + ".gif"; //$NON-NLS-1$ //$NON-NLS-2$ - IPath path = null; - for (int i = 0; i < ICON_DIRS.length; i++) { - path = new Path(ICON_DIRS[i]).append(gif); - if (Platform.find(bundle,path) == null) - continue; - try { - return new URL( bundle.getEntry("/"), path.toString()); //$NON-NLS-1$ - } catch (MalformedURLException exception) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logWarning(J2EEPluginResourceHandler.getString("Load_Image_Error_", new Object[]{key})); //$NON-NLS-1$ - exception.printStackTrace(); - continue; - } - } - return null; - } - - /** - * This gets a .gif from the icons folder. - */ - public Object getImage(String key) { - return getImageURL(key,this.getBundle()); - } - - public static IPath getInstallLocation() { - if (location == null) { - URL url = getInstallURL(); - try { - String installLocation = ((PlatformURLConnection) url.openConnection()).getURLAsLocal().getFile(); - location = new Path(installLocation); - } catch (IOException e) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logWarning(J2EEPluginResourceHandler.getString("Install_Location_Error_", new Object[]{url}) + e); //$NON-NLS-1$ - } - } - return location; - } - - public static URL getInstallURL() { - return getDefault().getBundle().getEntry("/"); //$NON-NLS-1$ - } - - protected static IJavaModel getJavaModel() { - return JemProjectUtilities.getJavaModel(); - } - - protected static IJavaModel getJavaModel(IProject aProject) { - if (aProject != null) - return JemProjectUtilities.getJavaModel(); - return null; - } - - public static IJavaProject getJavaProject(IProject project) { - IJavaModel model = getJavaModel(project); - if (model != null) - return model.getJavaProject(project.getName()); - return null; - } - - /** - * Retrieves a hashtable of a logger's preferences initially from the - * com.ibm.etools.logging.util.loggingDefaults extension point if specified in the - * com.ibm.etools.logging.util plugin.xml file. If specified, the - * com.ibm.etools.logging.util.loggingOptions extension point preferences in the parameter - * plugin's plugin.xml file are returned. - * - * The logger's preferences are stored in the return hashtable using the static instance - * variables in LoggerStateHashKeys as keys. - * - * @param plugin - * the Plugin polled for their logger's preferences in the plugin.xml file - * @return hashtable of a logger's preferences - */ - /* - * public java.util.Hashtable getMsgLoggerConfig(org.eclipse.core.runtime.Plugin plugin) { - * return (new PluginHelperImpl().getMsgLoggerConfig(plugin)); } - */ - /** - * Get the singleton instance. - */ - public static J2EEPlugin getPlugin() { - return INSTANCE; - } - - /** - * Return the plugin directory location- the directory that all the plugins are located in (i.e. - * d:\installdir\plugin) - */ - public static IPath getPluginLocation(String pluginId) { - //IExtensionRegistry registry = Platform.getExtensionRegistry(); - Bundle bundle = Platform.getBundle(pluginId); - if (bundle != null) { - try { - IPath installPath = new Path(bundle.getEntry("/").toExternalForm()).removeTrailingSeparator(); //$NON-NLS-1$ - String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile(); - return new Path(installStr); - } catch (IOException e) { - }; - } - return null; - } - - protected void initializeDefaultPluginPreferences() { - getJ2EEPreferences().initializeDefaultPreferences(); - } - - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - /** - * If this is called from an operation, in response to some other exception that was caught, - * then the client code should throw {@link com.ibm.etools.wft.util.WFTWrappedException}; - * otherwise this can still be used to signal some other error condition within the operation, - * or to throw a core exception in a context other than executing an operation - * - * Create a new IStatus of type ERROR using the J2EEPlugin ID. aCode is just an internal code. - */ - public static IStatus newErrorStatus(int aCode, String aMessage, Throwable exception) { - return newStatus(IStatus.ERROR, aCode, aMessage, exception); - } - - /** - * If this is called from an operation, in response to some other exception that was caught, - * then the client code should throw {@link com.ibm.etools.wft.util.WFTWrappedException}; - * otherwise this can still be used to signal some other error condition within the operation, - * or to throw a core exception in a context other than executing an operation - * - * Create a new IStatus of type ERROR, code OPERATION_FAILED, using the J2EEPlugin ID - */ - public static IStatus newErrorStatus(String aMessage, Throwable exception) { - return newErrorStatus(0, aMessage, exception); - } - - /** - * If this is called from an operation, in response to some other exception that was caught, - * then the client code should throw {@link com.ibm.etools.wft.util.WFTWrappedException}; - * otherwise this can still be used to signal some other error condition within the operation. - * - * Create a new IStatus of type ERROR, code OPERATION_FAILED, using the J2EEPlugin ID - */ - public static IStatus newOperationFailedStatus(String aMessage, Throwable exception) { - return newStatus(IStatus.ERROR, IResourceStatus.OPERATION_FAILED, aMessage, exception); - } - - /** - * Create a new IStatus with a severity using the J2EEPlugin ID. aCode is just an internal code. - */ - public static IStatus newStatus(int severity, int aCode, String aMessage, Throwable exception) { - return new Status(severity, PLUGIN_ID, aCode, aMessage, exception); - } - - /* - * Javadoc copied from interface. - */ - public String getString(String key) { - try { - return Platform.getResourceString(getBundle(), key); - } catch (MissingResourceException ex) { - //TODO Don't throw error - just show unresolved key - //Logger.getLogger().logError(ex); - return '!' + key + '!'; - } - } - - /* - * Javadoc copied from interface. - */ - public String getString(String key, Object[] substitutions) { - return MessageFormat.format(getString(key), substitutions); - } - - /** - * Insert the method's description here. Creation date: (7/16/2001 7:38:56 PM) - * - * @param newDefaultIsWorkspaceRelativeSchema - * boolean - */ - public static void setDefaultIsWorkspaceRelativeSchema(boolean newDefaultIsWorkspaceRelativeSchema) { - defaultIsWorkspaceRelativeSchema = newDefaultIsWorkspaceRelativeSchema; - } - - /** - * This method should be used to determine if the EJB UI support is currently packaged in the - * image. - */ - public static boolean isEJBSupportAvailable() { - if (EJB_AVAILABLE == null) { - //TODO We need a better mechanism for the detection of the EJB support. - //IPluginDescriptor desc = - // Platform.getPluginRegistry().getPluginDescriptor("org.eclipse.jst.j2ee.internal.internal.ejb.ui"); - // //$NON-NLS-1$ - // EJB_AVAILABLE = new Boolean(desc != null); - EJB_AVAILABLE = Boolean.TRUE; - } - return EJB_AVAILABLE.booleanValue(); - } - - /** - * This method should be used to determine if the workbench is running in UI or Headless - * - * @deprecated use {@link org.eclipse.wst.common.frameworks.internal.UIContextDetermination} - */ - public static boolean isHeadless() { - return UIContextDetermination.getCurrentContext() == UIContextDetermination.HEADLESS_CONTEXT; - } - - - public void start(BundleContext context) throws Exception { - super.start(context); - - J2EEXmlDtDEntityResolver.INSTANCE = new CatalogJ2EEXmlDtDEntityResolver(); - DOMUtilities.setDefaultEntityResolver(J2EEXmlDtDEntityResolver.INSTANCE); - //Have to do the next line immediately to fix timing problems with factory registration - ArchiveInit.init(false); - - //ModuleMaps are the maps from modules in an ear project to the j2ee projects for the - // modules - org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapInit.init(false); - ensureFactoryRegistration(); - ValidatorManager.setResourceUtilClass(ResourceUtil.class); - IAdapterManager manager = Platform.getAdapterManager(); - manager.registerAdapters(new EarEditAdapterFactory(), ArtifactEditModel.class); - manager.registerAdapters(new AppClientEditAdapterFactory(), ArtifactEditModel.class); - manager.registerAdapters(new VirtualArchiveComponentAdapterFactory(), VirtualArchiveComponent.class ); - - final ProjectRefactoringListener listener = new ProjectRefactoringListener();//ProjectDependencyCache.getCache()); - // register the project rename/delete refactoring listener - ResourcesPlugin.getWorkspace().addResourceChangeListener(listener, - IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_DELETE); - - // register the IElementChangedLister that updates the .component file in - // response to .classpath changes - JavaCore.addElementChangedListener(new J2EEElementChangedListener(), ElementChangedEvent.POST_CHANGE); - - ResourcesPlugin.getWorkspace().addResourceChangeListener(J2EEComponentClasspathUpdater.getInstance(), IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE); - } - - public void stop(BundleContext context) throws Exception { - super.stop(context); - ResourcesPlugin.getWorkspace().removeResourceChangeListener(J2EEComponentClasspathUpdater.getInstance()); - try { - org.eclipse.core.runtime.Platform.getJobManager().join( J2EEElementChangedListener.PROJECT_COMPONENT_UPDATE_JOB_FAMILY, - new NullProgressMonitor() ); - } catch (OperationCanceledException e) { - Logger.getLogger().logError(e.getMessage()); - } catch (InterruptedException e) { - Logger.getLogger().logError(e.getMessage()); - } - } - - /* - * need to make sure the correct factories get loaded when we are in the UI - */ - private void ensureFactoryRegistration() { - //Inside the workbench we do not want the global override defined here. - ensureDefaultReferencedXMIResourceFactoryRegistration(); - } - - /** - * - */ - private void ensureDefaultReferencedXMIResourceFactoryRegistration() { - J2EEResourceFactoryRegistry reg1 = J2EEResourceFactoryRegistry.INSTANCE; - WTPResourceFactoryRegistry reg2 = WTPResourceFactoryRegistry.INSTANCE; - ReferencedXMIFactoryImpl factory = new ReferencedComponentXMIResourceFactory(); - reg1.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, factory); - reg2.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, factory); - // add xmi because other plugins are registering it globally - reg1.getExtensionToFactoryMap().put("xmi", factory); //$NON-NLS-1$ - reg2.getExtensionToFactoryMap().put("xmi", factory); //$NON-NLS-1$ - } - - /** - * This is currently just a convenience api for the AAW to turn off unwanted actions. It will - * currently be initialized based on the existence of the AAW plugin. - */ - public static boolean hasDevelopmentRole() { - if (HAS_DEV_ROLE == null) { - Bundle desc = Platform.getBundle("org.eclipse.jst.j2ee.assembly"); //$NON-NLS-1$ - HAS_DEV_ROLE = desc != null ? Boolean.FALSE : Boolean.TRUE; - } - return HAS_DEV_ROLE.booleanValue(); - } - - public static IWorkspaceRunnable getWorkspaceRunnable(final IHeadlessRunnableWithProgress op) { - return new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - try { - op.run(monitor); - } catch (InvocationTargetException e) { - throw new CoreException(newErrorStatus(0, e.getMessage(), e)); - } catch (InterruptedException e) { - throw new CoreException(newErrorStatus(0, e.getMessage(), e)); - } - } - }; - } - - public String getPluginID() { - return PLUGIN_ID; - } - - /** - * @return Returns the preferences. - */ - public J2EEPreferences getJ2EEPreferences() { - if (this.preferences == null) - this.preferences = new J2EEPreferences(this); - return this.preferences; - } - public String getString(String key, boolean translate) { - // TODO For now... translate not supported - return getString(key); - } - - public String getString(String key, Object[] substitutions, boolean translate) { - // TODO For now... translate not supported - return getString(key,substitutions); - } - - - /** - * Record an error against this plugin's log. - * - * @param aCode - * @param aMessage - * @param anException - */ - public static void logError(int aCode, String aMessage, - Throwable anException) { - getDefault().getLog().log( - createErrorStatus(aCode, aMessage, anException)); - } - - /** - * - * Record a message against this plugin's log. - * - * @param severity - * @param aCode - * @param aMessage - * @param exception - */ - public static void log(int severity, int aCode, String aMessage, - Throwable exception) { - log(createStatus(severity, aCode, aMessage, exception)); - } - - /** - * - * Record a status against this plugin's log. - * - * @param aStatus - */ - public static void log(IStatus aStatus) { - getDefault().getLog().log(aStatus); - } - - /** - * Create a status associated with this plugin. - * - * @param severity - * @param aCode - * @param aMessage - * @param exception - * @return A status configured with this plugin's id and the given parameters. - */ - public static IStatus createStatus(int severity, int aCode, - String aMessage, Throwable exception) { - return new Status(severity, PLUGIN_ID, aCode, - aMessage != null ? aMessage : "No message.", exception); //$NON-NLS-1$ - } - - /** - * - * @param aCode - * @param aMessage - * @param exception - * @return A status configured with this plugin's id and the given parameters. - */ - public static IStatus createErrorStatus(int aCode, String aMessage, - Throwable exception) { - return createStatus(IStatus.ERROR, aCode, aMessage != null ? aMessage : exception.toString(), exception); - } - - public static IStatus createStatus(int severity, String message, Throwable exception) { - return new Status(severity, PLUGIN_ID, message, exception); - } - - public static IStatus createStatus(int severity, String message) { - return createStatus(severity, message, null); - } - - public static void logError(Throwable exception) { - Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( createStatus(IStatus.ERROR, exception.getMessage(), exception)); - } - - public static void logError(CoreException exception) { - Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( exception.getStatus() ); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPluginResourceHandler.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPluginResourceHandler.java deleted file mode 100644 index f83263995..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPluginResourceHandler.java +++ /dev/null @@ -1,76 +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.internal.plugin; - - -import org.eclipse.osgi.util.NLS; - -public class J2EEPluginResourceHandler extends NLS { - - private static final String BUNDLE_NAME = "j2eewtpplugin";//$NON-NLS-1$ - - private J2EEPluginResourceHandler() { - // Do not instantiate - } - - public static String __Considering_delta_INFO_; - public static String WARNING_METAFOLDER_MISSING_UI_; - public static String Not_a_J2EE_project_UI_; - public static String CoreException_could_not_initialize_Web_Service_class_path_variables_ERROR_; - public static String Error_opening_archive_for_export_2; - public static String J2EEDeployOperation_2_UI_; - public static String No_library_folder_UI_; - public static String J2EEDeployOperation_UI_Null_Status; - public static String RAR_File; - public static String NESTED_JAVA_OUTPUT_ERROR; - public static String J2EEModulePostImportHelper_3; - public static String J2EEModulePostImportHelper_2; - public static String J2EEModulePostImportHelper_1; - public static String J2EEModulePostImportHelper_0; - public static String Some_source_types_have______in_their_name_ERROR_; - public static String J2EEDeployOperation_UI_1; - public static String J2EEDeployOperation_UI_0; - public static String _UI_ParamValue_type; - public static String J2EEDeployOperation_1_UI_; - public static String An_error_occurred_while_sa_ERROR_; - public static String WARNING_FILE_MISSING_UI_; - public static String Cannot_load_EJBJar_because_model_is_null_UI_; - public static String __Bad_builder_order_for_project_INFO_; - public static String No_source_types_UI_; - public static String EJBProjectResources_getEJBJar_EJBEditModel__UI_; - public static String __No_imported_classes_folder__quitting_INFO_; - public static String The_following_resources_ne_UI_; - public static String J2EEDeployOperation_4_UI_; - public static String __Full_first_build_INFO_; - public static String Error_occurred_saving_the_manifest_7; - public static String Cannot_load_EJBFile_because_ejbNature_asEJBJarFile___returns_null_UI_; - public static String __Delta_build_INFO_; - public static String __Start_build_project_INFO_; - public static String Cannot_load_EJBFile_because_EJBNatureRuntime_is_null_UI_; - public static String Minimizing_project_UI_; - public static String Error_getting_project_nature_runtime_6; - public static String Creating_Connector_Project_5; - public static String Error_getting_project_nature_runtime_3; - public static String J2EEDeployOperation_3_UI_; - public static String Unable_to_save_read_only_f_ERROR_; - public static String Could_not_find_root_object_ERROR_; - public static String Cannot_run_J2EEUIWorkingCo_ERROR_; - public static String Cannot_load_EJBFile_because_EJBEditModel_is_null_UI_; - public static String Error_occurred_loading_ra_xml__4; - - static { - NLS.initializeMessages(BUNDLE_NAME, J2EEPluginResourceHandler.class); - } - - public static String getString(String key, Object[] args) { - return NLS.bind(key, args); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPreferences.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPreferences.java deleted file mode 100644 index d8157248e..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPreferences.java +++ /dev/null @@ -1,418 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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 - *******************************************************************************/ -/* - * Created on Jan 26, 2004 - * - * To change the template for this generated file go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.plugin; - -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jst.common.frameworks.CommonFrameworksPlugin; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.wst.project.facet.IProductConstants; -import org.eclipse.wst.project.facet.ProductManager; - - -/** - * @author mdelder - */ -public class J2EEPreferences { - - public interface Keys { - - - /** - * @deprecated, use CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER or use - * getJavaSourceFolderName() - * do not call J2EEPlugin.getJ2EEPreferences.getString(JAVA_SOURCE) - * @since 2.0 - */ - static final String JAVA_SOURCE = "org.eclipse.jst.j2ee.preference.javaSourceName"; //$NON-NLS-1$ - - static final String SERVER_TARGET_SUPPORT = "org.eclipse.jst.j2ee.preference.servertargetsupport"; //$NON-NLS-1$ - static final String CREATE_EJB_CLIENT_JAR = "org.eclipse.jst.j2ee.preference.createClientJar"; //$NON-NLS-1$ - static final String J2EE_VERSION = "org.eclipse.jst.j2ee.ui.preference.j2eeVersion"; //$NON-NLS-1$ - static final String EJB_CLIENT_JAR_CP_COMPATIBILITY = "org.eclipse.jst.j2ee.preference.clientjar.cp.compatibility"; //$NON-NLS-1$ - static final String INCREMENTAL_DEPLOYMENT_SUPPORT = "org.eclipse.jst.j2ee.ui.preference.incrementalDeployment"; //$NON-NLS-1$ - - final static String USE_EAR_LIBRARIES = "org.eclipse.jst.j2ee.preferences.useEARLibraries";//$NON-NLS-1$ - final static String USE_WEB_APP_LIBRARIES = "org.eclipse.jst.j2ee.preferences.useWebAppLibraries";//$NON-NLS-1$ - - /** - * @deprecated, - * but should it be deprecated ? is j2ee_web_content a better name than web_content_folder ? - * @since 2.0 - */ - static final String J2EE_WEB_CONTENT = "org.eclipse.jst.j2ee.preference.j2eeWebContentName"; //$NON-NLS-1$ - /** - * @deprecated, static web content is got from ProductManager - * @since 2.0 - */ - static final String STATIC_WEB_CONTENT = "org.eclipse.jst.j2ee.preference.staticWebContentName"; //$NON-NLS-1$ - /** - * @since 2.0 - */ - static final String APPLICATION_CONTENT_FOLDER = IProductConstants.APPLICATION_CONTENT_FOLDER; - /** - * @since 2.0 - */ - static final String WEB_CONTENT_FOLDER = IProductConstants.WEB_CONTENT_FOLDER; - /** - * @since 2.0 - */ - static final String EJB_CONTENT_FOLDER = IProductConstants.EJB_CONTENT_FOLDER; - /** - * @since 2.0 - */ - static final String APP_CLIENT_CONTENT_FOLDER = IProductConstants.APP_CLIENT_CONTENT_FOLDER; - /** - * @since 2.0 - */ - static final String JCA_CONTENT_FOLDER = IProductConstants.JCA_CONTENT_FOLDER; - - /** - * @since 2.0 - */ - static final String ADD_TO_EAR_BY_DEFAULT = IProductConstants.ADD_TO_EAR_BY_DEFAULT; - /** - * @since 2.0 - */ - static final String APPLICATION_GENERATE_DD = "application_generate_dd"; //$NON-NLS-1$ - /** - * @since 2.0 - */ - static final String DYNAMIC_WEB_GENERATE_DD = "dynamic_web_generate_dd"; //$NON-NLS-1$ - /** - * @since 2.0 - */ - static final String EJB_GENERATE_DD = "ejb_generate_dd"; //$NON-NLS-1$ - /** - * @since 2.0 - */ - static final String APP_CLIENT_GENERATE_DD = "app_client_generate_dd"; //$NON-NLS-1$ - - } - - public interface Values { - final static String J2EE_VERSION_1_2 = "J2EE_1_2"; //$NON-NLS-1$ - final static String J2EE_VERSION_1_3 = "J2EE_1_3"; //$NON-NLS-1$ - final static String J2EE_VERSION_1_4 = "J2EE_1_4"; //$NON-NLS-1$ - - /** - * @deprecated, see initializeDefaultPreferences() it uses ProductManager - */ - final static String J2EE_WEB_CONTENT = ProductManager.getProperty(IProductConstants.WEB_CONTENT_FOLDER); - /** - * @deprecated, see initializeDefaultPreferences() it uses ProductManager - */ - final static String STATIC_WEB_CONTENT = ProductManager.getProperty(IProductConstants.WEB_CONTENT_FOLDER); - /** - * @deprecated, use CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER - */ - final static String JAVA_SOURCE = CommonFrameworksPlugin.getDefault().getPluginPreferences().getString(CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER); - } - - public interface Defaults { - - /** - * @deprecated, see initializeDefaultPreferences() it uses ProductManager - */ - final static String J2EE_WEB_CONTENT = Values.J2EE_WEB_CONTENT; - /** - * @deprecated, see initializeDefaultPreferences() it uses ProductManager - */ - final static String STATIC_WEB_CONTENT = Values.STATIC_WEB_CONTENT; - /** - * @deprecated, see DEFAULT_SOURCE_FOLDER - */ - final static String JAVA_SOURCE = Values.JAVA_SOURCE; - final static String J2EE_VERSION = Values.J2EE_VERSION_1_4; - final static int J2EE_VERSION_ID = J2EEVersionConstants.J2EE_1_4_ID; - final static boolean CREATE_EJB_CLIENT_JAR = false; - final static boolean EJB_CLIENT_JAR_CP_COMPATIBILITY = true; - final static boolean INCREMENTAL_DEPLOYMENT_SUPPORT = true; - } - - private Plugin owner = null; - private Preferences preferences = null; - private boolean persistOnChange = false; - - public J2EEPreferences(Plugin owner) { - this.owner = owner; - } - - protected void initializeDefaultPreferences() { - - getPreferences().setDefault(Keys.J2EE_VERSION, Defaults.J2EE_VERSION); - getPreferences().setDefault(Keys.CREATE_EJB_CLIENT_JAR, Defaults.CREATE_EJB_CLIENT_JAR); - getPreferences().setDefault(Keys.EJB_CLIENT_JAR_CP_COMPATIBILITY, Defaults.EJB_CLIENT_JAR_CP_COMPATIBILITY); - getPreferences().setDefault(Keys.INCREMENTAL_DEPLOYMENT_SUPPORT, Defaults.INCREMENTAL_DEPLOYMENT_SUPPORT); - - // since 2.0 - getPreferences().setDefault(Keys.J2EE_WEB_CONTENT, ProductManager.getProperty(IProductConstants.WEB_CONTENT_FOLDER)); - getPreferences().setDefault(Keys.STATIC_WEB_CONTENT, ProductManager.getProperty(IProductConstants.WEB_CONTENT_FOLDER)); - // since 2.0 - getPreferences().setDefault(Keys.JAVA_SOURCE, CommonFrameworksPlugin.getDefault().getPluginPreferences().getString(CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER)); - // done in CommonFrameworksPref..Initializer - //getPreferences().setDefault(Keys.DEFAULT_SOURCE_FOLDER, ProductManager.getProperty(IProductConstants.DEFAULT_SOURCE_FOLDER)); - getPreferences().setDefault(Keys.APPLICATION_CONTENT_FOLDER, ProductManager.getProperty(IProductConstants.APPLICATION_CONTENT_FOLDER)); - getPreferences().setDefault(Keys.WEB_CONTENT_FOLDER, ProductManager.getProperty(IProductConstants.WEB_CONTENT_FOLDER)); - getPreferences().setDefault(Keys.APP_CLIENT_CONTENT_FOLDER, ProductManager.getProperty(IProductConstants.APP_CLIENT_CONTENT_FOLDER)); - getPreferences().setDefault(Keys.EJB_CONTENT_FOLDER, ProductManager.getProperty(IProductConstants.EJB_CONTENT_FOLDER)); - getPreferences().setDefault(Keys.JCA_CONTENT_FOLDER, ProductManager.getProperty(IProductConstants.JCA_CONTENT_FOLDER)); - getPreferences().setDefault(Keys.ADD_TO_EAR_BY_DEFAULT, ProductManager.getProperty(IProductConstants.ADD_TO_EAR_BY_DEFAULT)); - // done in CommonFrameworksPref..Initializer - //getPreferences().setDefault(Keys.OUTPUT_FOLDER, ProductManager.getProperty(IProductConstants.OUTPUT_FOLDER)); - - // since 2.0, for java ee projects - getPreferences().setDefault(Keys.APPLICATION_GENERATE_DD, false); - // for ee5 jee web projects default it to true so that we can create servlets, otherwise false - getPreferences().setDefault(Keys.DYNAMIC_WEB_GENERATE_DD, true); - getPreferences().setDefault(Keys.EJB_GENERATE_DD, false); - getPreferences().setDefault(Keys.APP_CLIENT_GENERATE_DD, false); - - getPreferences().setDefault(Keys.USE_EAR_LIBRARIES, true); - getPreferences().setDefault(Keys.USE_WEB_APP_LIBRARIES, true); - } - - - public String getSetting(String key){ - return getPreferences().getString(key); - } - - public void setSetting(String key, String value){ - getPreferences().setValue(key, value); - firePreferenceChanged(); - } - - public boolean getUseEARLibraries() { - return getPreferences().getBoolean(Keys.USE_EAR_LIBRARIES); - } - - public void setUseEARLibraries(boolean value) { - getPreferences().setValue(Keys.USE_EAR_LIBRARIES, value); - firePreferenceChanged(); - } - - public boolean getUseWebLibaries() { - return getPreferences().getBoolean(Keys.USE_WEB_APP_LIBRARIES); - } - - public void setUseWebLibraries(boolean value) { - getPreferences().setValue(Keys.USE_WEB_APP_LIBRARIES, value); - firePreferenceChanged(); - } - - - public String getJ2EEWebContentFolderName() { - //return getPreferences().getString(Keys.J2EE_WEB_CONTENT); - //but should it be deprecated ? is j2ee_web_content a better name than web_content_folder ? - return getPreferences().getString(Keys.WEB_CONTENT_FOLDER); - - } - - /** - * @return - * @deprecated - */ - public String getStaticWebContentFolderName() { - return getPreferences().getString(Keys.STATIC_WEB_CONTENT); - } - - public String getJavaSourceFolderName() { - //return getPreferences().getString(Keys.JAVA_SOURCE); - // TODO is JAVA_SOURCE a better name or is DEFAULT_SOURCE... - return CommonFrameworksPlugin.getDefault().getPluginPreferences().getString(CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER); - } - - public String getHighestJ2EEVersionSetting() { - return getPreferences().getString(Keys.J2EE_VERSION); - } - - public boolean isServerTargetingEnabled() { - return getPreferences().getBoolean(Keys.SERVER_TARGET_SUPPORT); - } - - /// - public void setJ2EEWebContentFolderName(String value) { - //getPreferences().setValue(Keys.J2EE_WEB_CONTENT, value); - // TODO but should it be deprecated ? is j2ee_web_content a better name than web_content_folder ? - getPreferences().setValue(Keys.WEB_CONTENT_FOLDER, value); - firePreferenceChanged(); - } - - /** - * @param value - * @deprecated - */ - public void setStaticWebContentFolderName(String value) { - getPreferences().setValue(Keys.STATIC_WEB_CONTENT, value); - firePreferenceChanged(); - } - - public void setJavaSourceFolderName(String value) { - //getPreferences().setValue(Keys.JAVA_SOURCE, value); - // TODO is JAVA_SOURCE a better name or is DEFAULT_SOURCE... - CommonFrameworksPlugin.getDefault().getPluginPreferences().setValue(CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER, value); - CommonFrameworksPlugin.getDefault().savePluginPreferences(); - firePreferenceChanged(); - } - - public void setHighestJ2EEVersionSetting(String value) { - getPreferences().setValue(Keys.J2EE_VERSION, value); - firePreferenceChanged(); - } - - public void setServerTargetingEnabled(boolean value) { - getPreferences().setValue(Keys.SERVER_TARGET_SUPPORT, value); - firePreferenceChanged(); - } - - public void setIncrementalDeploymentEnabled(boolean value) { - getPreferences().setValue(Keys.INCREMENTAL_DEPLOYMENT_SUPPORT, value); - firePreferenceChanged(); - } - - public boolean isIncrementalDeploymentEnabled() { - return getPreferences().getBoolean(Keys.INCREMENTAL_DEPLOYMENT_SUPPORT); - } - - /** - * @return one of J2EEVersionConstants.J2EE_VERSION_X_X (@see J2EEVersionConstants) - */ - public int getHighestJ2EEVersionID() { - String versionPreference = getHighestJ2EEVersionSetting(); - if (Values.J2EE_VERSION_1_2.equals(versionPreference)) - return J2EEVersionConstants.J2EE_1_2_ID; - else if (Values.J2EE_VERSION_1_3.equals(versionPreference)) - return J2EEVersionConstants.J2EE_1_3_ID; - else - return J2EEVersionConstants.J2EE_1_4_ID; - } - - public void firePreferenceChanged() { - if (isPersistOnChange()) - persist(); - } - - public void persist() { - getOwner().savePluginPreferences(); - } - - /** - * @return Returns the persistOnChange. - */ - public boolean isPersistOnChange() { - return this.persistOnChange; - } - - /** - * @param persistOnChange - * The persistOnChange to set. - */ - public void setPersistOnChange(boolean persistOnChange) { - this.persistOnChange = persistOnChange; - } - - private Preferences getPreferences() { - if (this.preferences == null) - this.preferences = getOwner().getPluginPreferences(); - return this.preferences; - } - - /** - * @return Returns the owner. - */ - private Plugin getOwner() { - return this.owner; - } - - /** - * Returns the default value for the boolean-valued property - * with the given name. - * Returns the default-default value (<code>false</code>) if there - * is no default property with the given name, or if the default - * value cannot be treated as a boolean. - * The given name must not be <code>null</code>. - * - * @param name the name of the property - * @return the default value of the named property - */ - public boolean getDefaultBoolean(String name) { - return getPreferences().getDefaultBoolean(name); - } - /** - * Returns the current value of the boolean-valued property with the - * given name. - * The given name must not be <code>null</code>. - * - * @param name the name of the property - * @return the boolean-valued property - */ - public boolean getBoolean(String name) { - return getPreferences().getBoolean(name); - } - - /** - * Sets the current value of the boolean-valued property with the - * given name. The given name must not be <code>null</code>. - * @param name the name of the property - * @param value the new current value of the property - */ - public void setValue(String name, boolean value) { - getPreferences().setValue(name, value); - firePreferenceChanged(); - } - - /** - * Returns the default value for the string-valued property - * with the given name. - * Returns the default-default value (the empty string <code>""</code>) - * is no default property with the given name, or if the default - * value cannot be treated as a string. - * The given name must not be <code>null</code>. - * - * @param name the name of the property - * @return the default value of the named property - */ - public String getDefaultString(String name) { - return getPreferences().getDefaultString(name); - } - - /** - * Returns the current value of the string-valued property with the - * given name. - * Returns the default-default value (the empty string <code>""</code>) - * if there is no property with the given name. - * The given name must not be <code>null</code>. - * - * @param name the name of the property - * @return the string-valued property - */ - public String getString(String name) { - return getPreferences().getString(name); - } - - /** - * Sets the current value of the string-valued property with the - * given name. The given name must not be <code>null</code>. - * @param name the name of the property - * @param value the new current value of the property - */ - public void setValue(String name, String value) { - getPreferences().setValue(name, value); - firePreferenceChanged(); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/LibCopyBuilder.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/LibCopyBuilder.java deleted file mode 100644 index 7bad42f05..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/LibCopyBuilder.java +++ /dev/null @@ -1,506 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.plugin; - - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -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.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.resources.IncrementalProjectBuilder; -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.jem.workbench.utility.JemProjectUtilities; - -/** - * An example incremental project builder that copies additional class files from a library package - * fragment root folder into a Java project's output directory. - * - * General parameters: - * <ul> - * <li>The project should be a Java project.</li> - * <li>The class files are in the "imported_classes" folder of the project.</li> - * <li>This builder should run <b>after </b> the Java builder.</li> - * <li>Full build should copy class files from a secondary library folder into the output folder - * maintaining package hierarchy; existing class files must never be overwritten.</li> - * <li>Only *.class files should be copied (not other resource files).</li> - * <li>Incremental build and auto-build should will perform the copy when there is an add/change in - * the "imported_classes" folder.</li> - * <li>Changing the project's output folder should be handled.</li> - * </ul> - * Note: the builder is not currently invoking the Minimize helper, it is relying on the copy to not - * replace existing class files, and the build path order to ensure that compiled classes override - * imported ones. - * - * @deprecated This class is only used for backwards compatibility - */ -public class LibCopyBuilder extends IncrementalProjectBuilder { - /** - * Internal debug tracing. - */ - static boolean DEBUG = false; - - /** - * Builder id of this incremental project builder. - */ - public static final String BUILDER_ID = J2EEPlugin.LIBCOPY_BUILDER_ID; - - /** - * The path where we expect to find the .class files to be copied. - */ - public static final String IMPORTED_CLASSES_PATH = "imported_classes"; //$NON-NLS-1$ - - /** - * The path of the output folder that we last copied class files into, or <code>null</code> if - * this builder has not built this project before. - */ -// private IPath lastOutputPath = null; - - private List sourceContainers; - -// private boolean needOutputRefresh; - - /** - * Creates a new instance of the library copying builder. - * <p> - * All incremental project builders are required to have a public 0-argument constructor. - * </p> - */ - public LibCopyBuilder() { - super(); - } - - - /** - * - * The <code>LibCopyBuilder</code> implementation of this - * <code>IncrementalProjectBuilder</code> method copies additional class files into the output - * folder. - * <p> - * [Issue: the implementation should report progress.] - * </p> - * <p> - * [Issue: the implementation should probably use a workspace runnable.] - * </p> - */ - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { - // this builder is unnecessary in WTP 1.5 - return null; -// sourceContainers = null; -// needOutputRefresh = false; -// if (DEBUG) { -// System.out.println(BUILDER_ID + J2EEPluginResourceHandler.__Start_build_project_INFO_ + getProject().getName()); -// } -// -// boolean builderOrderOK = checkBuilderOrdering(); -// -// if (DEBUG && !builderOrderOK) { -// System.out.println(BUILDER_ID + J2EEPluginResourceHandler.__Bad_builder_order_for_project_INFO_ + getProject().getName()); -// } -// -// IFolder[] classFolders = getClassesFolders(); -// if (classFolders.length == 0) { -// // no files to copy -// if (DEBUG) -// System.out.println(BUILDER_ID + J2EEPluginResourceHandler.__No_imported_classes_folder__quitting_INFO_); -// return null; -// } -// -// IJavaProject jproject = JavaCore.create(getProject()); -// if (jproject == null) { -// // not a java project (anymore?) -// return null; -// } -// -// IPath outputPath = jproject.getOutputLocation(); -// IFolder outputFolder = getProject().getParent().getFolder(outputPath); -// if (outputPath.equals(lastOutputPath)) { -// if (kind == INCREMENTAL_BUILD || kind == AUTO_BUILD) { -// processDelta(getDelta(getProject()), outputFolder, monitor, classFolders); -// refreshOutputIfNecessary(outputFolder); -// return null; -// } -// } -// -// if (DEBUG) { -// System.out.println(BUILDER_ID + J2EEPluginResourceHandler.__Full_first_build_INFO_); -// } -// copyAllClassFolders(monitor, classFolders, outputFolder); -// lastOutputPath = outputPath; -// refreshOutputIfNecessary(outputFolder); -// return null; - } - - /** - * - */ -// private void refreshOutputIfNecessary(IFolder outputFolder) throws CoreException { -// if (needOutputRefresh && outputFolder != null && outputFolder.exists()) -// outputFolder.refreshLocal(IResource.DEPTH_INFINITE, null); -// } - - private void copyAllClassFolders(IProgressMonitor monitor, IFolder[] classFolders, IFolder outputFolder) throws CoreException { - for (int i = 0; i < classFolders.length; i++) { - if (!classFolders[i].equals(outputFolder)) - copyClassFiles(classFolders[i], outputFolder, monitor); - } - - } - - - /** - * Process an incremental build delta. - * - * @return <code>true</code> if the delta requires a copy - * @param dest - * the destination folder; may or may not exist - * @param monitor - * the progress monitor, or <code>null</code> if none - * @exception CoreException - * if something goes wrong - */ - protected void processDelta(IResourceDelta delta, final IFolder outputFolder, final IProgressMonitor monitor, final IFolder[] classesFolders) { - if (DEBUG) { - System.out.println(BUILDER_ID + J2EEPluginResourceHandler.__Considering_delta_INFO_ + delta); - } - IResourceDeltaVisitor visitor = new IResourceDeltaVisitor() { - private List copiedClassFolders = new ArrayList(classesFolders.length); - - public boolean visit(IResourceDelta subdelta) throws CoreException { - IResource resource = subdelta.getResource(); - if (resource.getType() == IResource.FILE) { - IFolder classesFolder = retrieveClassesFolder(resource, classesFolders); - if (classesFolder != null && !copiedClassFolders.contains(classesFolder)) { - int kind = subdelta.getKind(); - switch (kind) { - case IResourceDelta.ADDED : - case IResourceDelta.CHANGED : - if (DEBUG) { - System.out.println(BUILDER_ID + J2EEPluginResourceHandler.__Delta_build_INFO_ + subdelta); - } - copyClassFiles(classesFolder, outputFolder, monitor); - break; - case IResourceDelta.REMOVED : - deleteCorrespondingFile((IFile) resource, classesFolder, outputFolder, monitor); - break; - case IResourceDelta.ADDED_PHANTOM : - break; - case IResourceDelta.REMOVED_PHANTOM : - break; - } - - } - } else if (resource.getType() == IResource.FOLDER && resource.equals(outputFolder)) { - copyAllClassFolders(null, classesFolders, outputFolder); - return false; - } - return true; - } - }; - if (delta != null) { - try { - delta.accept(visitor); - } catch (CoreException e) { - // should not happen - } - } - } - - /** - * @param file - * @param classesFolder - * @param outputFolder - * @param monitor - */ - protected void deleteCorrespondingFile(IFile file, IFolder classesFolder, IFolder outputFolder, IProgressMonitor monitor) throws CoreException { - IPath path = file.getFullPath(); - int segCount = classesFolder.getFullPath().segmentCount(); - path = path.removeFirstSegments(segCount); - IFile javaFile = findCorrespondingJavaFile(path); - if (javaFile != null && javaFile.exists()) - return; //There is nothing to do because the file in the output location is from the - // java compilation not the copy. - IFile outFile = outputFolder.getFile(path); - if (outFile.exists()) - outFile.delete(true, false, monitor); - } - - - /** - * Method retrieveClassesFolder. - * - * @param resource - * @return IFolder - */ - protected IFolder retrieveClassesFolder(IResource resource, IFolder[] classesFolders) { - for (int i = 0; i < classesFolders.length; i++) { - if (classesFolders[i].getName().equals(resource.getProjectRelativePath().segment(0))) - return classesFolders[i]; - } - return null; - } - - - /** - * Checks whether this builder is configured to run <b>after </b> the Java builder. - * - * @return <code>true</code> if the builder order is correct, and <code>false</code> - * otherwise - * @exception CoreException - * if something goes wrong - */ -// private boolean checkBuilderOrdering() throws CoreException { - // determine relative builder position from project's buildspec -// ICommand[] cs = getProject().getDescription().getBuildSpec(); -// int myIndex = -1; -// int javaBuilderIndex = -1; -// for (int i = 0; i < cs.length; i++) { -// if (cs[i].getBuilderName().equals(JavaCore.BUILDER_ID)) { -// javaBuilderIndex = i; -// } else if (cs[i].getBuilderName().equals(BUILDER_ID)) { -// myIndex = i; -// } -// } -// return myIndex > javaBuilderIndex; -// } - - /** - * Copies class files from the given source folder to the given destination folder. The - * destination folder will be created if required, but only if at least one class file is - * copied. - * - * @param source - * the source folder; must exist - * @param dest - * the destination folder; may or may not exist - * @param monitor - * the progress monitor, or <code>null</code> if none - * @exception CoreException - * if something goes wrong - */ - private void copyClassFiles(IFolder source, final IFolder dest, final IProgressMonitor monitor) throws CoreException { - if (DEBUG) { - System.out.println(BUILDER_ID + ": Begin copying class files from " + source.getFullPath() + " to " + dest.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$ - } - - final int sourcePathLength = source.getFullPath().segmentCount(); - - class Visitor implements IResourceVisitor { - public boolean visit(IResource res) throws CoreException { - if (res.getType() == IResource.FILE) { - IFile file = (IFile) res; - - // compute relative path from source folder to this file - IPath filePath = file.getFullPath(); - IPath dpath = filePath.removeFirstSegments(sourcePathLength); - IFile targetFile = dest.getFile(dpath); - copyFile(file, targetFile, dpath, monitor); - } - return true; - } - } - - try { - source.accept(new Visitor()); - } catch (CoreException e) { - // should not happen - } - - } - - /** - * Copies the given file to the given destination file. Does nothing if the destination file - * already exists. - * - * @param source - * the source file; must exist - * @param dest - * the destination file; may or may not exist; never overwritten - * @param monitor - * the progress monitor, or <code>null</code> if none - * @exception CoreException - * if something goes wrong - */ - private void copyFile(IFile source, IFile dest, IPath fileRelativePath, IProgressMonitor monitor) throws CoreException { - if (pruneForJavaSource(source, fileRelativePath, monitor)) - return; //no copy necessary. - File sourceFile = null, destFile = null; - if (source.exists()) - sourceFile = source.getLocation().toFile(); - if (dest.exists()) - destFile = dest.getLocation().toFile(); - - if (destFile != null && sourceFile != null) { - if (DEBUG) - System.out.println(BUILDER_ID + ": " + dest.getFullPath() + " already exists."); //$NON-NLS-1$ //$NON-NLS-2$ - if (destFile.lastModified() == sourceFile.lastModified()) - return; - dest.setContents(source.getContents(false), true, false, monitor); //we have to force - // b/c set the mod - // stamp makes it - // think it is out of - // synch. - synchronizeModificationStamps(sourceFile, destFile); - return; - } - if (DEBUG) { - System.out.println(BUILDER_ID + ": Creating " + dest.getFullPath()); //$NON-NLS-1$ - } - - IContainer parent = dest.getParent(); - if (parent.getType() == IResource.FOLDER) { - mkdirs((IFolder) parent, monitor); - } - dest.create(source.getContents(false), false, monitor); - destFile = dest.getLocation().toFile(); - synchronizeModificationStamps(sourceFile, destFile); - dest.setDerived(true); - } - - /** - * Return true if a corresponding .java file is found. Remove the .class file from the - * imported_classes folder (i.e., delete the source file). - * - * @param source - * @param monitor - * @return - */ - private boolean pruneForJavaSource(IFile classFile, IPath fileRelativePath, IProgressMonitor monitor) throws CoreException { - if (classFile.exists()) { - IFile javaFile = findCorrespondingJavaFile(fileRelativePath); - if (javaFile != null && javaFile.exists()) { - ResourcesPlugin.getWorkspace().validateEdit(new IFile[]{javaFile}, null); - classFile.delete(true, false, monitor); - return true; - } - } - return false; - } - - - /** - * @param classFilePath - * @return - */ - private IFile findCorrespondingJavaFile(IPath classFilePath) { - IPath javaPath = convertToJavaPath(classFilePath); - List sourceFolders = getSourceContainers(); - IContainer cont; - IFile javaFile; - for (int i = 0; i < sourceFolders.size(); i++) { - cont = (IContainer) sourceFolders.get(i); - javaFile = cont.getFile(javaPath); - if (javaFile.exists()) - return javaFile; - } - return null; - } - - - private List getSourceContainers() { - if (sourceContainers == null) - sourceContainers = JemProjectUtilities.getSourceContainers(getProject()); - return sourceContainers; - } - - - /** - * @param classFile - * @return - */ - private IPath convertToJavaPath(IPath classFilePath) { - IPath javaPath = classFilePath.removeFileExtension(); - //handle inner classes...look for outermost java file - String fileName = classFilePath.lastSegment(); - int innerIndex = fileName.indexOf('$'); - if (innerIndex > -1) { - javaPath = javaPath.removeLastSegments(1); - javaPath = javaPath.append(fileName.substring(0, innerIndex)); - } - javaPath = javaPath.addFileExtension("java"); //$NON-NLS-1$ - return javaPath; - } - - - /** - * @param source - * @param dest - */ - private void synchronizeModificationStamps(File sourceFile, File destFile) { - if (destFile != null && sourceFile != null) { - destFile.setLastModified(sourceFile.lastModified()); -// needOutputRefresh = true; - } - } - - - /** - * Creates the given folder, and its containing folders, if required. Does nothing if the given - * folder already exists. - * - * @param folder - * the folder to create - * @param monitor - * the progress monitor, or <code>null</code> if none - * @exception CoreException - * if something goes wrong - */ - private void mkdirs(IFolder folder, IProgressMonitor monitor) throws CoreException { - if (folder.exists()) { - return; - } - IContainer parent = folder.getParent(); - if (!parent.exists() && parent.getType() == IResource.FOLDER) { - mkdirs((IFolder) parent, monitor); - } - folder.create(false, true, monitor); - } - -// private IFolder[] getClassesFolders() { -// IProject project = getProject(); -// IJavaProject javaProj = JemProjectUtilities.getJavaProject(project); -// if (javaProj == null) -// return new IFolder[0]; -// List result = null; -// IClasspathEntry[] entries; -// try { -// entries = javaProj.getResolvedClasspath(true); -// } catch (JavaModelException e) { -// return new IFolder[0]; -// } -// for (int i = 0; i < entries.length; i++) { -// IClasspathEntry entry = entries[i]; -// if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { -// IPath path = entry.getPath(); -// IResource res = project.getWorkspace().getRoot().findMember(path); -// if (res != null && res.isAccessible() && res.getType() == IResource.FOLDER && res.getProject().equals(project)) { -// if (result == null) -// result = new ArrayList(1); -// result.add(res); -// } -// } -// } -// if (result == null) -// return new IFolder[0]; -// return (IFolder[]) result.toArray(new IFolder[result.size()]); -// } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/AWorkbenchMOFHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/AWorkbenchMOFHelper.java deleted file mode 100644 index 6e373f1f7..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/AWorkbenchMOFHelper.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.internal.validation; - - -import java.util.logging.Level; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jem.internal.plugin.JavaEMFNature; -import org.eclipse.jem.util.logger.LogEntry; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper; -import org.eclipse.wst.validation.internal.operations.WorkbenchContext; -import org.eclipse.wst.validation.internal.plugin.ValidationPlugin; - - -/** - * Abstract base class for registration of symbolic model names, and also provides the mechanism for - * registering the load model method which loads a specific type of MOF model, as identified by the - * symbolic model name. - */ -public abstract class AWorkbenchMOFHelper extends WorkbenchContext { - public IResource getResource(Object obj) { - IResource res = null; - if ((obj != null) && (obj instanceof EObject)) { - JavaEMFNature nature = getMOFNature(getProject()); - if (nature != null) { - EObject ro = (EObject) obj; - res = WorkbenchResourceHelper.getFile(ro.eResource()); - } - } - - if ((res == null) || (!res.exists())) { - return super.getResource(obj); - } - - return res; - } - - public JavaEMFNature getMOFNature(IProject project) { - if (project == null) { - return null; - } - - IProjectDescription desc = null; - try { - desc = project.getDescription(); - } catch (CoreException exc) { - Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); - if (logger.isLoggingLevel(Level.FINE)) { - LogEntry entry = ValidationPlugin.getLogEntry(); - entry.setSourceID("WorkbenchContext.getMOFNature(IProject)"); //$NON-NLS-1$ - entry.setTargetException(exc); - logger.write(Level.FINE, entry); - } - return null; - } - - String[] natureIds = desc.getNatureIds(); - for (int i = 0; i < natureIds.length; i++) { - try { - IProjectNature nature = project.getNature(natureIds[i]); - if (nature instanceof JavaEMFNature) { - return (JavaEMFNature) nature; - } - } catch (CoreException exc) { - // log and attempt next nature - Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); - if (logger.isLoggingLevel(Level.FINE)) { - LogEntry entry = ValidationPlugin.getLogEntry(); - entry.setSourceID("WorkbenchContext.getMOFNature(IProject)"); //$NON-NLS-1$ - entry.setTargetException(exc); - logger.write(Level.FINE, entry); - } - } - } - return null; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ApplicationClientHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ApplicationClientHelper.java deleted file mode 100644 index dd0c8e38a..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ApplicationClientHelper.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.validation; - - - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.applicationclient.componentcore.util.AppClientArtifactEdit; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.model.internal.validation.ApplicationClientMessageConstants; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.validation.internal.operations.WorkbenchReporter; - - -/** - * Insert the type's description here. Creation date: (4/9/2001 11:22:53 AM) - * - * @author: Administrator - */ -public class ApplicationClientHelper extends J2EEValidationHelper { - - protected ApplicationClientFile appClientFile; - - /** - * ApplicationClientHelper constructor comment. - */ - public ApplicationClientHelper() { - super(); - registerModel(ApplicationClientMessageConstants.APPCLIENT_MODEL_NAME, "loadApplicationClientFile"); //$NON-NLS-1$ - } - - /** - * Given a resource, return its non-eclipse-specific location. If this resource, or type of - * resource, isn't handled by this helper, return null. - */ - public String getPortableName(IResource resource) { - if (!(resource instanceof IFile)) { - return null; - } - - return "application-client.xml"; //$NON-NLS-1$ - } - - /** - * Get the AppClient file for validation - */ - - public EObject loadApplicationClientFile() { - - IVirtualComponent comp = ComponentCore.createComponent(getProject()); - ArtifactEdit edit = ComponentUtilities.getArtifactEditForRead(comp); - - try { - appClientFile = (ApplicationClientFile)((AppClientArtifactEdit) edit).asArchive(false); - return appClientFile; - } catch (OpenFailureException e1) { - Logger.getLogger().log(e1); - }finally { - if (edit != null) { - edit.dispose(); - } - } - return null; - } - - public void cleanup(WorkbenchReporter reporter) { - closeApplicationClientFile(); - super.cleanup(reporter); - } - - public void closeApplicationClientFile() { - if (appClientFile != null) - appClientFile.close(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/DependencyUtil.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/DependencyUtil.java deleted file mode 100644 index 809f5c748..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/DependencyUtil.java +++ /dev/null @@ -1,242 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.internal.validation; - -import java.util.HashSet; -import java.util.Set; -import java.util.logging.Level; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.IJavaModel; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.logger.LogEntry; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.wst.validation.internal.plugin.ValidationPlugin; - -/** - * This singleton keeps an internal record of project dependencies. That is, every IProject can - * depend on, and be depended on by, other IProjects. Ditto IJavaProject. This class is updated when - * a project(s) classpath changes. - */ -public final class DependencyUtil { - private static final IProject[] EMPTY_PROJECTS = new IProject[0]; - private static final IJavaProject[] EMPTY_JAVAPROJECTS = new IJavaProject[0]; - - private static Set _tempSet = null; - - /** - * This is a set for temporary calculations. - */ - private static Set getTempSet() { - if (_tempSet == null) { - _tempSet = new HashSet(); - } else { - _tempSet.clear(); - } - return _tempSet; - } - - /** - * Return an array of open IProjects which depend on the given IProject parameter. - */ - public static IProject[] getDependentProjects(IProject project) { - if (project == null) { - return EMPTY_PROJECTS; - } - - IProject[] allProjects = project.getWorkspace().getRoot().getProjects(); - Set tempSet = getTempSet(); - for (int i = 0; i < allProjects.length; i++) { - IProject p = allProjects[i]; - IProject[] requires = getRequiredProjects(p); - for (int j = 0; j < requires.length; j++) { - IProject r = requires[j]; - if (project.equals(r)) { - tempSet.add(p); - break; - } - } - } - IProject[] dependency = new IProject[tempSet.size()]; - tempSet.toArray(dependency); - return dependency; - } - - /** - * Return an array of open IProjects which the given IProject parameter depends on. - */ - public static IProject[] getRequiredProjects(IProject project) { - if (project == null) { - return EMPTY_PROJECTS; - } - - // Check that each project in this list exists and is open - try { - IProject[] refProjects = project.getReferencedProjects(); - if ((refProjects == null) || (refProjects.length == 0)) { - return EMPTY_PROJECTS; - } - - IProject[] temp = new IProject[refProjects.length]; - int count = 0; - for (int i = 0; i < refProjects.length; i++) { - IProject rProject = refProjects[i]; - if (rProject.exists() && rProject.isOpen()) { - temp[count++] = rProject; - } - } - - if (count == 0) { - return EMPTY_PROJECTS; - } - - if (count == temp.length) { - return temp; - } - - IProject[] result = new IProject[count]; - System.arraycopy(temp, 0, result, 0, count); - return result; - } catch (CoreException exc) { - Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); - if (logger.isLoggingLevel(Level.SEVERE)) { - LogEntry entry = ValidationPlugin.getLogEntry(); - entry.setSourceID("DependencyCache::getRequiredProjects(" + project.getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - entry.setTargetException(exc); - logger.write(Level.SEVERE, exc); - } - - return EMPTY_PROJECTS; - } - } - - /** - * Return an array of open IJavaProjects which depend on the given IJavaProject parameter. - */ - public static IJavaProject[] getDependentJavaProjects(IJavaProject javaproject) { - if (javaproject == null) { - return EMPTY_JAVAPROJECTS; - } - - // calculate the dependencies now. - try { - IJavaProject[] allProjects = javaproject.getJavaModel().getJavaProjects(); - Set tempSet = getTempSet(); - for (int i = 0; i < allProjects.length; i++) { - IJavaProject p = allProjects[i]; - IJavaProject[] requires = getRequiredJavaProjects(p); - for (int j = 0; j < requires.length; j++) { - IJavaProject r = requires[j]; - if (javaproject.equals(r)) { - tempSet.add(p); - break; - } - } - } - IJavaProject[] dependency = new IJavaProject[tempSet.size()]; - tempSet.toArray(dependency); - return dependency; - } catch (JavaModelException exc) { - Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); - if (logger.isLoggingLevel(Level.SEVERE)) { - LogEntry entry = ValidationPlugin.getLogEntry(); - entry.setSourceID("DependencyCache::getDependentJavaProjects(" + javaproject.getProject().getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - entry.setTargetException(exc); - logger.write(Level.SEVERE, exc); - } - - return EMPTY_JAVAPROJECTS; - } - } - - /** - * Return an array of open IJavaProjects which the given IJavaProject parameter depends on. - */ - public static IJavaProject[] getRequiredJavaProjects(IJavaProject javaproject) { - if (javaproject == null) { - return EMPTY_JAVAPROJECTS; - } - - try { - IJavaModel jm = javaproject.getJavaModel(); - if (jm == null) { - Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); - if (logger.isLoggingLevel(Level.SEVERE)) { - LogEntry entry = ValidationPlugin.getLogEntry(); - entry.setSourceID("DependencyCache::getRequiredJavaProjects(" + javaproject.getProject().getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - //entry.setText("IJavaModel == null"); //$NON-NLS-1$ - logger.write(Level.SEVERE, "IJavaModel == null"); //$NON-NLS-1$ - } - return EMPTY_JAVAPROJECTS; - } - - String[] requiredProjects = javaproject.getRequiredProjectNames(); - if ((requiredProjects == null) || (requiredProjects.length == 0)) { - return EMPTY_JAVAPROJECTS; - } - - IJavaProject[] temp = new IJavaProject[requiredProjects.length]; - int count = 0; - for (int i = 0; i < requiredProjects.length; i++) { - String projectName = requiredProjects[i]; - IJavaProject jp = jm.getJavaProject(projectName); - try { - if ((jp == null) || (!jp.getProject().exists())) { - continue; - } - if (!jp.getProject().isAccessible()) { - continue; - } - - if (!jp.getProject().hasNature(JavaCore.NATURE_ID)) { - continue; - } - - temp[count++] = jp; - } catch (CoreException exc) { - Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); - if (logger.isLoggingLevel(Level.SEVERE)) { - LogEntry entry = ValidationPlugin.getLogEntry(); - entry.setSourceID("DependencyCache::getRequiredJavaProjects(" + javaproject.getProject().getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - entry.setTargetException(exc); - logger.write(Level.SEVERE, exc); - } - continue; - } - } - - if (count == 0) { - return EMPTY_JAVAPROJECTS; - } - - if (count == temp.length) { - return temp; - } - - IJavaProject[] result = new IJavaProject[count]; - System.arraycopy(temp, 0, result, 0, count); - return result; - } catch (JavaModelException exc) { - Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); - if (logger.isLoggingLevel(Level.SEVERE)) { - LogEntry entry = ValidationPlugin.getLogEntry(); - entry.setSourceID("DependencyCache::getRequiredJavaProjects(" + javaproject.getProject().getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - entry.setTargetException(exc); - logger.write(Level.SEVERE, exc); - } - - return EMPTY_JAVAPROJECTS; - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/EarHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/EarHelper.java deleted file mode 100644 index 426f84fc4..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/EarHelper.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.validation; - - - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -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.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.validation.internal.operations.WorkbenchReporter; - - -public class EarHelper extends J2EEValidationHelper { - - protected EARFile earFile; - protected ArtifactEdit edit = null; - - - /** - * WarHelper constructor comment. - */ - public EarHelper() { - super(); - - registerModel(J2EEConstants.EAR_MODEL_NAME, "loadEarFile"); //$NON-NLS-1$ - } - - public String getApplicationXMLFile() { - - return J2EEConstants.APPL_ID; - } - - /** - * Given a resource, return its non-eclipse-specific location. If this resource, or type of - * resource, isn't handled by this helper, return null. - */ - public String getPortableName(IResource resource) { - if (!(resource instanceof IFile)) { - return null; - } - - return "application.xml"; //$NON-NLS-1$ - } - - public String getTargetObjectName(Object obj) { - super.getTargetObjectName(obj); - - if (obj != null && obj instanceof EARFile) { - return getApplicationXMLFile(); - } - if (obj != null && obj instanceof ApplicationImpl) { - return "application.xml"; //$NON-NLS-1$ - } - return null; - } - - /** - * Get the WAR file for validation - */ - - public EObject loadEarFile() { - - IVirtualComponent comp = ComponentCore.createComponent(getProject()); - edit = ComponentUtilities.getArtifactEditForRead(comp); - - try { - Archive archive = ((EnterpriseArtifactEdit) edit).asArchive(false, false); - earFile = (EARFile)archive; - return archive; - } catch (OpenFailureException e1) { - Logger.getLogger().log(e1); - } - return null; - } - - public void closeEARFile() { - if (earFile != null) { - earFile.close(); - earFile = null; - } - } - - public void cleanup(WorkbenchReporter reporter) { - if (edit != null) { - edit.dispose(); - edit = null; - } - if (earFile != null) { - earFile.close(); - earFile = null; - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/J2EEValidationHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/J2EEValidationHelper.java deleted file mode 100644 index b103ec71a..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/J2EEValidationHelper.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.validation; - - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper; -import org.eclipse.wst.validation.internal.operations.WorkbenchContext; - - -public abstract class J2EEValidationHelper extends WorkbenchContext { - - /** - * Constructor for J2EEValidationHelper. - */ - public J2EEValidationHelper() { - super(); - } - - /* - * @see IWorkbenchContext#getFile(Object) - */ - public IResource getResource(Object object) { - Resource resource = null; - if (object != null && object instanceof EObject) - resource = ((EObject) object).eResource(); - if (resource != null) - return WorkbenchResourceHelper.getFile(resource); - return null; - } - - /** - * Given a resource, return its non-eclipse-specific location. If this resource, or type of - * resource, isn't handled by this helper, return null. - */ - protected String getFileName(IFile file, IContainer[] containers) { - if ((file == null) || (containers == null)) { - return null; - } - - for (int c = 0; c < containers.length; c++) { - IPath resourcePath = getContainerRelativePath(file, containers[c]); - if (resourcePath != null) { - // file has been found - return resourcePath.toString(); - } - } - - return null; - } - - /** - * Given a file name, return its corresponding IFile, if one exists. This method checks if the - * IContainer passed in contains a file with the given file name. If the container does not have - * the IFile, null is returned. - */ - protected IFile getFile(String fileName, IContainer[] containers) { - IFile clazzFile = null; - if ((fileName == null) || (containers == null)) { - return null; - } - - for (int c = 0; c < containers.length; c++) { - IContainer container = containers[c]; - IPath filePath = container.getProjectRelativePath(); - clazzFile = getProject().getFile(filePath.append(fileName)); - - if (clazzFile.exists()) { - return clazzFile; - } - } - - return null; - } - -// protected IFile getXmlFile(String xmlFileName, J2EENature nature) { -// if (nature == null) { -// return null; -// } -// return nature.getMetaFolder().getFile(xmlFileName); -// } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.validation.internal.operations.IWorkbenchContext#getTargetObjectName(java.lang.Object) - */ - public String getTargetObjectName(Object object) { - if (object != null) - return object.toString(); - return null; - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ManifestLineValidator.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ManifestLineValidator.java deleted file mode 100644 index d8ac09f89..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ManifestLineValidator.java +++ /dev/null @@ -1,105 +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.internal.validation; - - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -public class ManifestLineValidator extends Object { - public static final int MAX_LINE_LENGTH = 72; - protected int lineNumber; - protected int currentByte; - protected int byteCount; - protected InputStream inputStream; - protected List lineNumbers; - protected boolean endsWithLineBreak = true; - - /** - * Constructor for LineValidator. - */ - public ManifestLineValidator(InputStream in) { - super(); - inputStream = new BufferedInputStream(in); - lineNumber = 0; - } - - protected List getLineNumbers() { - if (lineNumbers == null) - lineNumbers = new ArrayList(); - return lineNumbers; - } - - public int[] getLineNumbersExceedingLimit() { - if (lineNumbers == null) - return new int[0]; - - int[] result = new int[lineNumbers.size()]; - for (int i = 0; i < lineNumbers.size(); i++) { - Integer list_element = (Integer) lineNumbers.get(i); - result[i] = list_element.intValue(); - } - return result; - } - - public void validate() throws IOException { - readNext(); - while (currentByte != -1) { - validateNextLine(); - } - } - - public int getLineCount() { - return lineNumber; - } - - protected void readNext() throws IOException { - currentByte = inputStream.read(); - } - - protected void validateNextLine() throws IOException { - lineNumber++; - byteCount = 0; - boolean eolReached = false; - while (currentByte != -1) { - if (currentByte == '\r') { - eolReached = true; - readNext(); - if (currentByte == '\n') { - readNext(); - } - break; - } else if (currentByte == '\n') { - eolReached = true; - readNext(); - break; - } else { - byteCount++; - readNext(); - } - } - if (currentByte == -1 && !eolReached && byteCount > 0) - endsWithLineBreak = false; - if (byteCount > 72) - getLineNumbers().add(new Integer(lineNumber)); - } - - public boolean endsWithLineBreak() { - return endsWithLineBreak; - } - - public boolean hasErrors() { - return !endsWithLineBreak || (lineNumbers != null && !lineNumbers.isEmpty()); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ProjectValidationHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ProjectValidationHelper.java deleted file mode 100644 index 4e5090fb2..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ProjectValidationHelper.java +++ /dev/null @@ -1,86 +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.internal.validation; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.validation.internal.IProjectValidationHelper; - -public class ProjectValidationHelper implements IProjectValidationHelper { - - private static IContainer[] EMPTY_RESULT = new IContainer[] {}; - private static ProjectValidationHelper INSTANCE; - private IContainer[] outputs; - private IContainer[] sources; - - public static ProjectValidationHelper getInstance(){ - if (INSTANCE == null) - INSTANCE = new ProjectValidationHelper(); - return INSTANCE; - } - public void disposeInstance(){ - INSTANCE = null; - } - private IContainer[] getCachedOutputContainers(IProject project) { - if (outputs != null) - return outputs; - if (project == null || JemProjectUtilities.getJavaProject(project)==null) { - outputs = EMPTY_RESULT; - return EMPTY_RESULT; - } - IVirtualComponent comp = ComponentCore.createComponent(project); - if (comp == null || !comp.exists()) { - outputs = EMPTY_RESULT; - return EMPTY_RESULT; - } - outputs = J2EEProjectUtilities.getOutputContainers(project); - return outputs; - - } - public IContainer[] getOutputContainers(IProject project) { - return getInstance().getCachedOutputContainers(project); - } - - private IContainer[] getCachedSourceContainers(IProject project) { - if (sources != null) - return sources; - if (project == null || JemProjectUtilities.getJavaProject(project)==null) { - sources = EMPTY_RESULT; - return EMPTY_RESULT; - } - IVirtualComponent comp = ComponentCore.createComponent(project); - if (comp == null || !comp.exists()) { - sources = EMPTY_RESULT; - return EMPTY_RESULT; - } - IPackageFragmentRoot[] roots = J2EEProjectUtilities.getSourceContainers(project); - List result = new ArrayList(); - for (int i=0; i<roots.length; i++) { - if (roots[i].getResource() != null && roots[i].getResource() instanceof IContainer) - result.add(roots[i].getResource()); - } - sources = (IContainer[]) result.toArray(new IContainer[result.size()]); - return sources; - - } - public IContainer[] getSourceContainers(IProject project) { - return getInstance().getCachedSourceContainers(project); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ResourceUtil.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ResourceUtil.java deleted file mode 100644 index da19e566d..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/ResourceUtil.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 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.internal.validation; - - -import java.util.Collection; -import java.util.Iterator; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jem.internal.adapters.jdom.JDOMAdaptor; -import org.eclipse.jem.internal.java.adapters.ReadAdaptor; -import org.eclipse.wst.validation.internal.operations.IResourceUtil; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - - -public class ResourceUtil implements IResourceUtil { - public ResourceUtil() { - super(); - } - - public int getLineNo(Object object) { - if (object == null) { - return IMessage.LINENO_UNSET; - } - - if (object instanceof EObject) { // Error discovered using MOF objects - - EObject ro = (EObject) object; - JDOMAdaptor jdomAdapter = null; - - Collection c = ro.eAdapters(); - if (c != null) { - Iterator iterator = c.iterator(); - while (iterator.hasNext()) { - Adapter a = (Adapter) iterator.next(); - if ((a != null) && a.isAdapterForType(ReadAdaptor.TYPE_KEY) && (a instanceof JDOMAdaptor)) { - jdomAdapter = (JDOMAdaptor) a; - } - } - } - - if (jdomAdapter != null) { - int lineNo = jdomAdapter.getLineNo(); - if (lineNo != JDOMAdaptor.INVALID_LINENO) - return lineNo + 1; - } - - } - - return IMessage.LINENO_UNSET; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientHelper.java deleted file mode 100644 index cb352c1fe..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientHelper.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.internal.validation; - - - -/** - * Creates the helper for the WSAD application client validator. - */ -public class UIApplicationClientHelper extends ApplicationClientHelper { - - /** - * UIApplicationClientHelper - */ - public UIApplicationClientHelper() { - super(); - }// UIApplicationClientHelper - -}// UIApplicationClientHelper diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientMessageConstants.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientMessageConstants.java deleted file mode 100644 index 29bb967af..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientMessageConstants.java +++ /dev/null @@ -1,25 +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.internal.validation; - -import org.eclipse.jst.j2ee.model.internal.validation.ApplicationClientMessageConstants; - - - -/** - * Messages for the WSAD application client validator - */ -public interface UIApplicationClientMessageConstants extends ApplicationClientMessageConstants { - - public static final String DOCTYPE_1_2 = "1.2"; //$NON-NLS-1$ - public static final String DOCTYPE_1_3 = "1.3"; //$NON-NLS-1$ - public static final String APPCLIENT_INVALID_DOC_TYPE_ERROR_ = "APPCLIENT_INVALID_DOC_TYPE_ERROR_"; //$NON-NLS-1$ -}// UIApplicationClientMessageConstants diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientValidator.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientValidator.java deleted file mode 100644 index 74ecc3469..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIApplicationClientValidator.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.internal.validation; - - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.internal.validation.ApplicationClientValidator; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.validation.internal.core.ValidationException; -import org.eclipse.wst.validation.internal.operations.IWorkbenchContext; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; -import org.eclipse.wst.validation.internal.provisional.core.IValidationContext; - - -/** - * Creates the application client validator for WSAD - */ -public class UIApplicationClientValidator extends ApplicationClientValidator implements UIApplicationClientMessageConstants { - - - /** - * Default constructor. - */ - public UIApplicationClientValidator() { - super(); - }// UIApplicationClientValidator - - - /** - * Does the validation. - */ - - public IStatus validateInJob(IValidationContext inHelper, IReporter inReporter) - throws ValidationException { - UIApplicationClientHelper helper = (UIApplicationClientHelper) inHelper; - IProject proj = ((IWorkbenchContext) inHelper).getProject(); - IVirtualComponent virComp = ComponentCore.createComponent(proj); - if(J2EEProjectUtilities.isApplicationClientProject(proj)) { - IVirtualFile ddFile = virComp.getRootFolder().getFile(J2EEConstants.APP_CLIENT_DD_URI); - if( ddFile.exists()) { - status = super.validateInJob(helper, inReporter); - } - } - //validateDocType(helper, editModel); - return status; - } - - - /** - * Checks if the nature is consistent with doc type. - */ -// protected void validateDocType(UIApplicationClientHelper helper, AppClientEditModel editModel) { -// if (editModel.getJ2EENature().getJ2EEVersion() >= J2EEVersionConstants.J2EE_1_3_ID && getAppClientDD().getVersionID() < J2EEVersionConstants.J2EE_1_3_ID) { -// String[] params = new String[3]; -// params[0] = DOCTYPE_1_2; -// params[1] = helper.getProject().getName(); -// params[2] = DOCTYPE_1_3; -// addError(getBaseName(), APPCLIENT_INVALID_DOC_TYPE_ERROR_, params); -// } else if (editModel.getJ2EENature().getJ2EEVersion() < J2EEVersionConstants.J2EE_1_3_ID && getAppClientDD().getVersionID() >= J2EEVersionConstants.J2EE_1_3_ID) { -// String[] params = new String[3]; -// params[0] = DOCTYPE_1_3; -// params[1] = helper.getProject().getName(); -// params[2] = DOCTYPE_1_2; -// addError(getBaseName(), APPCLIENT_INVALID_DOC_TYPE_ERROR_, params); -// }// if -// }// validateDocTypeVsNature - - -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIEarHelper.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIEarHelper.java deleted file mode 100644 index 623c8cb40..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIEarHelper.java +++ /dev/null @@ -1,27 +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.internal.validation; - - - -/** - * Insert the type's description here. Creation date: (9/10/2001 2:12:47 PM) - * - * @author: Administrator - */ -public class UIEarHelper extends EarHelper { - /** - * UIEarHelper constructor comment. - */ - public UIEarHelper() { - super(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIEarValidator.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIEarValidator.java deleted file mode 100644 index b3c1888b3..000000000 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/validation/UIEarValidator.java +++ /dev/null @@ -1,755 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.j2ee.internal.validation; - - - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -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.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.core.runtime.jobs.MultiRule; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.URIConverter; -import org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.workbench.utility.JemProjectUtilities; -import org.eclipse.jst.j2ee.application.EjbModule; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.common.EjbRef; -import org.eclipse.jst.j2ee.common.MessageDestinationRef; -import org.eclipse.jst.j2ee.common.ResourceEnvRef; -import org.eclipse.jst.j2ee.common.ResourceRef; -import org.eclipse.jst.j2ee.common.SecurityRoleRef; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ValidateXmlCommand; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ManifestException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit; -import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent; -import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.internal.validation.EARValidationMessageResourceHandler; -import org.eclipse.jst.j2ee.model.internal.validation.EarValidator; -import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper; -import org.eclipse.wst.validation.internal.core.ValidationException; -import org.eclipse.wst.validation.internal.operations.IWorkbenchContext; -import org.eclipse.wst.validation.internal.operations.LocalizedMessage; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; -import org.eclipse.wst.validation.internal.provisional.core.IValidationContext; -import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob; - - -/** - * Insert the type's description here. Creation date: (9/10/2001 2:11:02 PM) - * - * @author: Administrator - */ -public class UIEarValidator extends EarValidator { - public static final String VALIDATOR_ID = "org.eclipse.jst.j2ee.internal.validation.UIEarValidator"; //$NON-NLS-1$ - public static final String MANIFEST_GROUP_NAME = "WSAD.EAR.MANIFEST"; //$NON-NLS-1$ - public static final String DOCTYPE_1_2 = "1.2"; //$NON-NLS-1$ - public static final String DOCTYPE_1_3 = "1.3"; //$NON-NLS-1$ - - protected UIEarHelper earHelper; -// private EARArtifactEdit earEdit = null; - private IProject project = null; - - /** - * UIEarValidator constructor comment. - */ - public UIEarValidator() { - super(); - } - - public Command createValidateXMLCommand() { - - ValidateXmlCommand cmd = (ValidateXmlCommand) super.createValidateXMLCommand(); - cmd.setValidateNested(false); - return cmd; - } - - protected String getResourceName() { - return ((EarHelper) _helper).getProject().getName(); - } - - protected void duplicateProjectMapError(String earProjectName, String moduleUri, String projectName) { - - String[] params = new String[3]; - params[0] = projectName; - params[1] = earProjectName; - params[2] = moduleUri; - String msg = NLS.bind(EARValidationMessageResourceHandler.DUPLICATE_MODULE_FOR_PROJECT_NAME_ERROR_, params); - - addLocalizedError(msg, appDD); - } - - /** - * - */ - protected void cleanUpSubTaskMessages(EObject ref) { - String groupName = EJB_REF_GROUP_NAME; - if (ref instanceof EjbRef) - { -// ref = (EjbRef) ref; - } - else if (ref instanceof ResourceRef) { -// ref = (ResourceRef) ref; - groupName = RES_REF_GROUP_NAME; - } else if (ref instanceof ServiceRef) { -// ref = (ServiceRef) ref; - groupName = SERVICE_REF_GROUP_NAME; - } else if (ref instanceof ResourceEnvRef) { -// ref = (ResourceEnvRef) ref; - groupName = RES_ENV_REF_GROUP_NAME; - } else if (ref instanceof SecurityRoleRef) { -// ref = (SecurityRoleRef) ref; - groupName = SEC_ROLE_REF_GROUP_NAME; - } else if (ref instanceof MessageDestinationRef) { -// ref = (MessageDestinationRef) ref; - groupName = MESSAGE_REF_GROUP_NAME; - } - Resource res = ref.eResource(); - if (res != null) { - IFile file = WorkbenchResourceHelper.getFile(res); - if (file != null) - _reporter.removeMessageSubset(this, file, groupName); - } - } - - protected void cleanUpAllRefSubTaskMessages(Resource res) { - if (res != null) { - IFile file = WorkbenchResourceHelper.getFile(res); - if (file != null) - _reporter.removeMessageSubset(this, file, EJB_REF_GROUP_NAME); - _reporter.removeMessageSubset(this, file, RES_REF_GROUP_NAME); - _reporter.removeMessageSubset(this, file, SERVICE_REF_GROUP_NAME); - _reporter.removeMessageSubset(this, file, SEC_ROLE_REF_GROUP_NAME); - _reporter.removeMessageSubset(this, file, MESSAGE_REF_GROUP_NAME); - _reporter.removeMessageSubset(this, file, RES_ENV_REF_GROUP_NAME); - } - } - - /** - * Insert the method's description here. Creation date: (9/10/2001 2:56:32 PM) - * - * @return org.eclipse.wst.validation.internal.core.core.ear.workbenchimpl.UIEarHelper - */ - public org.eclipse.jst.j2ee.internal.validation.UIEarHelper getEarHelper() { - return earHelper; - } - - protected void invalidClassPathEntryWarning(String entry, Archive anArchive) { - String[] params = new String[2]; - params[0] = anArchive.getURI(); - params[1] = entry; - String msg = NLS.bind(EARValidationMessageResourceHandler.INVALID_MANIFEST_CLASSPATH_ONE_WARN_, params); - addLocalizedWarning(msg, getManifestFile(anArchive), MANIFEST_GROUP_NAME); - } - - protected void invalidClassPathEntryWarning(String entry, String resolvedEntry, Archive anArchive) { - String[] params = new String[3]; - params[0] = anArchive.getURI(); - params[1] = entry; - params[2] = resolvedEntry; - String msg = NLS.bind(EARValidationMessageResourceHandler.INVALID_MANIFEST_CLASSPATH_TWO_WARN_, params); - addLocalizedWarning(msg, getManifestFile(anArchive), MANIFEST_GROUP_NAME); - } - - protected void invalidDepedencyWarning(String entry, Archive anArchive, ModuleFile m) { - String[] params = new String[3]; - params[0] = m.getURI(); - params[1] = entry; - params[2] = anArchive.getURI(); - String msg = NLS.bind(EARValidationMessageResourceHandler.INVALID_MANIFEST_CLASSPATH_DEPENDENCY_WARN_, params); - - addLocalizedWarning(msg, getManifestFile(anArchive), MANIFEST_GROUP_NAME); - } - - /** - * Insert the method's description here. Creation date: (9/10/2001 2:56:32 PM) - * - * @param newEarHelper - * org.eclipse.wst.validation.internal.core.core.ear.workbenchimpl.UIEarHelper - */ - public void setEarHelper(org.eclipse.jst.j2ee.internal.validation.UIEarHelper newEarHelper) { - earHelper = newEarHelper; - } - - public IStatus validateInJob(IValidationContext inHelper, IReporter inReporter) throws org.eclipse.wst.validation.internal.core.ValidationException { - IStatus status = IValidatorJob.OK_STATUS; - IProject proj = ((IWorkbenchContext) inHelper).getProject(); - IVirtualComponent earModule = ComponentCore.createComponent(proj); - if(J2EEProjectUtilities.isEARProject(proj)){ - IVirtualFile ddFile = earModule.getRootFolder().getFile(J2EEConstants.APPLICATION_DD_URI); - if( ddFile.exists()) { - status = super.validateInJob(inHelper, inReporter); - validateModuleMaps(earModule); - validateManifests(); - validateDuplicateClasspathComponentURIs(earModule); - // validateUtilJarMaps(earEdit,earModule); - // validateUriAlreadyExistsInEar(earEdit,earModule); - // validateDocType(earEdit,earModule); - } - } - return status; - } - - public ISchedulingRule getSchedulingRule(IValidationContext helper) { - ISchedulingRule combinedRule = null; - IProject project = ((IWorkbenchContext) helper).getProject(); - IVirtualComponent comp = ComponentCore.createComponent( project ); - IFile appDeploymentDescriptor = null; - if( comp != null ){ - IVirtualFile vf = comp.getRootFolder().getFile(new Path(J2EEConstants.APPLICATION_DD_URI)); - if( vf!= null ){ - appDeploymentDescriptor = vf.getUnderlyingFile(); - combinedRule = MultiRule.combine(appDeploymentDescriptor, combinedRule); - } - IVirtualReference[] refs = comp.getReferences(); - for( int i=0; i< refs.length; i++ ){ - IVirtualComponent refComp = refs[i].getReferencedComponent(); - if( refComp != null && !refComp.isBinary() ){ - String type = J2EEProjectUtilities.getJ2EEComponentType( refComp ); - IVirtualFile refDDFile = null; - if( type.equals(IModuleConstants.JST_WEB_MODULE)){ - refDDFile = refComp.getRootFolder().getFile(new Path(J2EEConstants.WEBAPP_DD_URI)); - }else if ( type.equals(IModuleConstants.JST_CONNECTOR_MODULE)){ - refDDFile = refComp.getRootFolder().getFile(new Path(J2EEConstants.RAR_DD_URI)); - }else if( type.equals(IModuleConstants.JST_EJB_MODULE)){ - refDDFile = refComp.getRootFolder().getFile(new Path(J2EEConstants.EJBJAR_DD_URI)); - }else if( type.equals(IModuleConstants.JST_APPCLIENT_MODULE)){ - refDDFile = refComp.getRootFolder().getFile(new Path(J2EEConstants.APPLICATION_DD_URI)); - } - if( refDDFile!= null ){ - IFile dd = refDDFile.getUnderlyingFile(); - combinedRule = MultiRule.combine(dd, combinedRule); - } - } - } - - } - return combinedRule; - } - - public void validateDuplicateClasspathComponentURIs(final IVirtualComponent earComponent) { - if (earFile == null) { - return; - } - final Set moduleURIs = new HashSet(); - final List archives = earFile.getArchiveFiles(); - for (int i = 0; i < archives.size(); i++) { - final Archive anArchive = (Archive) archives.get(i); - moduleURIs.add(anArchive.getURI()); - } - - final Map archiveToPath = new HashMap(); - final IVirtualReference[] components = earComponent.getReferences(); - for (int i = 0; i < components.length; i++) { - IVirtualReference reference = components[i]; - IVirtualComponent referencedComponent = reference.getReferencedComponent(); - - // retrieve all Java classpath component dependencies - if (referencedComponent instanceof J2EEModuleVirtualComponent) { - final IVirtualReference[] cpRefs = ((J2EEModuleVirtualComponent) referencedComponent).getJavaClasspathReferences(); - for (int j = 0; j < cpRefs.length; j++) { - final IVirtualReference ref = cpRefs[j]; - // only ../ runtime paths contribute to the EAR - if (ref.getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) { - String archiveName = ref.getArchiveName(); - String[] params = {referencedComponent.getProject().getName(), archiveName}; - if (moduleURIs.contains(archiveName)) { - String msg = NLS.bind(EARValidationMessageResourceHandler.CLASSPATH_COMPONENT_URI_MATCHES_ARCHIVE_URI, params); - addLocalizedError(msg, project); - } else { - IPath cpEntryPath= ClasspathDependencyUtil.getClasspathVirtualReferenceLocation(ref); - if (cpEntryPath != null) { - IPath existingPath = (IPath) archiveToPath.get(archiveName); - if (existingPath != null && !existingPath.equals(cpEntryPath)) { - String msg = NLS.bind(EARValidationMessageResourceHandler.DUPLICATE_CLASSPATH_COMPONENT_URI, params); - addLocalizedError(msg, project); - } else { - archiveToPath.put(archiveName, cpEntryPath); - } - } - } - } - } - } - } - } - - public void validateManifests() throws ValidationException { - if (earFile == null) - return; - List archives = earFile.getArchiveFiles(); - for (int i = 0; i < archives.size(); i++) { - - final Archive anArchive = (Archive) archives.get(i); - IFile target = getManifestFile(anArchive); - if (target != null) - _reporter.removeMessageSubset(this, target, MANIFEST_GROUP_NAME); - validateManifestCase(anArchive); - validateManifestLines(anArchive); - validateManifestClasspath(anArchive); - } - } - - public void validateManifestCase(Archive anArchive) { - String mfuri = J2EEConstants.MANIFEST_URI; - - //Indicates a manifest file with the valid name exists, - //nothing left to do - if (anArchive.containsFile(mfuri)) - return; - - //Otherwise iterate the list of files - //Ensure the archive is read-only first - anArchive.getOptions().setIsReadOnly(true); - List files = anArchive.getFiles(); - String uri = null; - for (int i = 0; i < files.size(); i++) { - File aFile = (File) files.get(i); - uri = aFile.getURI(); - if (mfuri.equalsIgnoreCase(uri) && !mfuri.equals(uri)) { - String[] params = {uri, anArchive.getURI()}; - IResource target = earHelper.getProject().getFile(J2EEConstants.MANIFEST_URI); - String msg = NLS.bind(EARValidationMessageResourceHandler.INVALID_CASE_FOR_MANIFEST_ERROR_, params); - addLocalizedError(msg, target); - } - } - - } - - - public void validateManifestClasspath(Archive anArchive) throws ValidationException { - ArchiveManifest manifest = null; - try{ - manifest = anArchive.getManifest(); - }catch( ManifestException mf){ - //mf.printStackTrace(); - mf.getMessage(); - String[] args = new String[]{anArchive.getURI()}; - String tmp = NLS.bind(EARValidationMessageResourceHandler.ERROR_READING_MANIFEST_ERROR_, args); - - addLocalizedError(tmp, args); - } - - if(manifest == null) - return; - - String[] cp = manifest.getClassPathTokenized(); - - for (int i = 0; i < cp.length; i++) { - String uri = ArchiveUtil.deriveEARRelativeURI(cp[i], anArchive); - if (uri == null) { - invalidClassPathEntryWarning(cp[i], anArchive); - continue; - } - File f = null; - //IFile rf = null; - try { -// if (uri.endsWith(J2EEImportConstants.IMPORTED_JAR_SUFFIX)) { - //TODO Needs work here to initialize rf as rf is an IFile and there is no way to get an IFile currently -// IVirtualResource resource = component.getRootFolder().findMember(new Path(uri)); -// if (resource == null || !resource.exists()) { -// invalidClassPathEntryWarning(cp[i], uri, anArchive); -// } -// } -// else - f = earFile.getFile(uri); - } catch (java.io.FileNotFoundException ex) { - invalidClassPathEntryWarning(cp[i], earFile.getURI(), anArchive); - continue; - } - if (f != null && f.isArchive() && anArchive.isModuleFile()) { - Archive archive = (Archive) f; - ModuleFile m = (ModuleFile) anArchive; - if (!ArchiveUtil.isValidDependency(archive, m)) - invalidDepedencyWarning(cp[i], archive, m); - } - } - } - - - protected void validateManifestLines(Archive anArchive) throws ValidationException { - if (anArchive == null) - return; - InputStream is = null; - try { - is = anArchive.getInputStream(J2EEConstants.MANIFEST_URI); - ManifestLineValidator lineVal = new ManifestLineValidator(is); - lineVal.validate(); - addErrorsIfNecessary(anArchive, lineVal); - } catch (FileNotFoundException ex) { - return; - } catch (IOException ex) { - handleManifestException(ex, anArchive); - } finally { - if (is != null) - try { - is.close(); - } catch (IOException ex) { - handleManifestException(ex, anArchive); - } - } - } - - protected void addErrorsIfNecessary(Archive anArchive, ManifestLineValidator mfVal) { - if (!mfVal.hasErrors()) - return; - IFile target = getManifestFile(anArchive); - if (!mfVal.endsWithLineBreak()) - addFileEndError(anArchive, mfVal, target); - int[] lines = mfVal.getLineNumbersExceedingLimit(); - for (int i = 0; i < lines.length; i++) { - addLineLengthError(anArchive, target, lines[i]); - } - } - - protected void addLineLengthError(Archive anArchive, IFile target, int lineNo) { - String[] args = new String[2]; - args[0] = Integer.toString(lineNo); - args[1] = anArchive.getURI(); - - String tmp = NLS.bind(EARValidationMessageResourceHandler.MANIFEST_LINE_EXCEEDS_LENGTH_ERROR_, args); - - if( lineNo >= 0 ){ - addLocalizedError(tmp, target, MANIFEST_GROUP_NAME, lineNo ); - }else{ - addLocalizedError(tmp, target, MANIFEST_GROUP_NAME ); - } - - } - - protected void addFileEndError(Archive anArchive, ManifestLineValidator mfVal, IFile target) { - String[] args = new String[]{anArchive.getURI()}; - - String tmp = NLS.bind(EARValidationMessageResourceHandler.MANIFEST_LINE_END_ERROR_, args); - - if (target != null) - addLocalizedError(tmp, getManifestFile(anArchive), MANIFEST_GROUP_NAME, mfVal.getLineCount()); - else - addLocalizedError(tmp, null, MANIFEST_GROUP_NAME); - } - - protected void handleManifestException(IOException ex, Archive anArchive) throws ValidationException { - Logger.getLogger().logError(ex); - String tmp = NLS.bind(EARValidationMessageResourceHandler.ERROR_READING_MANIFEST_ERROR_, new String[]{anArchive.getURI()}); - IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, tmp); - throw new ValidationException(message, ex); - } - - /** - * Validates utiljar maps - */ -// public void validateUtilJarMaps(EARArtifactEdit edit, IVirtualComponent workbenchModule) { -// List utilJarModules = edit.getUtilityModuleReferences(); -// if (!utilJarModules.isEmpty() || !utilJarModules.isEmpty()) { -// for (int i = 0; i < utilJarModules.size(); i++) { -// IVirtualComponent aUtilJar = ((IVirtualReference) utilJarModules.get(i)).getReferencedComponent(); -// if (aUtilJar != null) { -// IProject project = J2EEPlugin.getWorkspace().getRoot().getProject(aUtilJar.getProject().getName()); -// if (project != null) { -// if (!project.exists()) { -// String[] params = new String[]{project.getName(), aUtilJar.getRuntimePath().toString(), earHelper.getProject().getName()}; -// addWarning(getBaseName(), PROJECT_DOES_NOT_EXIST_WARN_, params); -// } else { -// //validateModuleProjectForValidServerTarget(project); -// if (!project.isOpen()) { -// String[] params = new String[]{project.getName()}; -// addWarning(getBaseName(), PROJECT_IS_CLOSED_WARN_, params); -// } -// } -// } -// } -// } -// } -// validateDuplicateUtilJars(edit,workbenchModule); -// validateUtilJarNameCollision(edit,workbenchModule); -// validateUtilJarContainsNoSpaces(edit,workbenchModule); -// -// }// validateUtilJarMaps - - /** - * Checks if the util jar contains spaces or not. - * - * @param EAREditModel - * earEditModel - The ear editmodel. - */ - protected void validateUtilJarContainsNoSpaces(EARArtifactEdit edit, IVirtualComponent module) { - IVirtualReference[] utilJars = edit.getUtilityModuleReferences(); - - if (utilJars == null) - return; - - for (int i = 0; i < utilJars.length; i++) { - IVirtualReference utilModule = utilJars[i]; - if (utilModule != null) { - String uri = ModuleURIUtil.fullyQualifyURI(project).toString(); - if (uri != null && uri.indexOf(" ") != -1) { //$NON-NLS-1$ - String[] params = new String[1]; - params[0] = uri; - String tmp = NLS.bind(EARValidationMessageResourceHandler.URI_CONTAINS_SPACES_ERROR_, params); - addLocalizedError(tmp, appDD); - }// if - }// if - }// for - - }// validateUtilJarContainsNoSpaces - - /** - * Validates if the a util jar has the same name as another module. - * - * @param EAREditModel - * earEditModel - The ear editmodel. - */ -// protected void validateUtilJarNameCollision(EARArtifactEdit edit, IVirtualComponent module) { -// List utilJars = edit.getUtilityModuleReferences(); -// if (utilJars == null) -// return; -// for (int i = 0; i < utilJars.size(); i++) { -// UtilityJARMapping utilModule = (UtilityJARMapping) utilJars.get(i); -// -// if (utilModule != null) { -// if (edit.uriExists(utilModule.getUri())) { -// -// String[] params = new String[]{utilModule.getUri(), module.getName()}; -// addError(getBaseName(), MESSAGE_UTIL_URI_NAME_COLLISION_ERROR_, params); -// -// } else if (utilModule.getProjectName() != null || utilModule.getProjectName().length() != 0) { -// if (edit.uriExists(utilModule.getUri())) { -// String[] params = new String[]{utilModule.getUri(), utilModule.getProjectName()}; -// addError(getBaseName(), MESSAGE_UTIL_PROJECT_NAME_COLLISION_ERROR_, params); -// } -// } -// } -// } -// } - - - - /** - * validate is there are duplicate util jars. - * - * @param EAREditModel - * earEditModel - The ear editmodel - */ - protected void validateDuplicateUtilJars(EARArtifactEdit edit, IVirtualComponent module) { - IVirtualReference[] utilJars = edit.getUtilityModuleReferences(); - Set visitedUtilUri = new HashSet(); - if (utilJars == null) - return; - for (int i = 0; i < utilJars.length; i++) { - IVirtualReference utilModule = utilJars[i]; - if (utilModule != null) { - String uri = ModuleURIUtil.fullyQualifyURI(project).toString(); - if (visitedUtilUri.contains(uri)) { - String compName = module.getName(); - duplicateUtilError(module.getName(),uri, compName); - } else - visitedUtilUri.add(uri); - } // if - } // for - } // validateModuleMapsDuplicateUtil - - /** - * Creates an error for duplicate util jars. - * - * @param String - * earProjectName - The ears project name. - * @param String - * moduleUri - The modules uri. - * @param String - * projectName - The project name. - */ - protected void duplicateUtilError(String earProjectName, String moduleUri, String projectName) { - String[] params = new String[3]; - params[0] = projectName; - params[1] = earProjectName; - params[2] = moduleUri; - String tmp = NLS.bind(EARValidationMessageResourceHandler.DUPLICATE_UTILJAR_FOR_PROJECT_NAME_ERROR_, params); - - addLocalizedError(tmp, null); - }// duplicateUtilError - - public void validateModuleMaps(IVirtualComponent component) { - IVirtualFile ddFile = component.getRootFolder().getFile(J2EEConstants.APPLICATION_DD_URI); - if( ddFile.exists()){ - EList modules = appDD.getModules(); - if (!modules.isEmpty()) { - EARArtifactEdit edit = null; - try{ - edit = EARArtifactEdit.getEARArtifactEditForRead( component.getProject() ); - - for (int i = 0; i < modules.size(); i++) { - Module module = (Module) modules.get(i); - String uri = module.getUri(); - IVirtualComponent referencedComp = edit.getModuleByManifestURI( uri ); - if( referencedComp == null ){ - String[] params = new String[]{uri, component.getProject().getName()}; - String tmp = NLS.bind(EARValidationMessageResourceHandler.MISSING_PROJECT_FORMODULE_WARN_, params); - - addLocalizedWarning(tmp, null); - } - validateModuleURIExtension(module); - } - }finally{ - if( edit != null ) - edit.dispose(); - } - } - } - } - - - protected void validateModuleURIExtension(Module module) { - String newUri = module.getUri(); - if (newUri != null && newUri.length() > 0) { - if (module instanceof EjbModule && !newUri.endsWith(".jar")) { //$NON-NLS-1$ - String[] params = new String[1]; - params[0] = module.getUri(); - IResource target = earHelper.getProject().getFile(ArchiveConstants.APPLICATION_DD_URI); - String tmp = NLS.bind(EARValidationMessageResourceHandler.INVALID_URI_FOR_MODULE_ERROR_, params); - addLocalizedWarning(tmp, target); - } else if (module instanceof WebModule && !newUri.endsWith(".war")) { //$NON-NLS-1$ - String[] params = new String[1]; - params[0] = module.getUri(); - IResource target = earHelper.getProject().getFile(ArchiveConstants.APPLICATION_DD_URI); - String tmp = NLS.bind(EARValidationMessageResourceHandler.INVALID_URI_FOR_MODULE_ERROR_, params); - addLocalizedWarning(tmp, target); - } - } - } - - - public void cleanup(IReporter reporter) { - if (earHelper != null) - earHelper.closeEARFile(); - super.cleanup(reporter); - } - - public void cleanup() { - - } - - protected IFile getManifestFile(Archive anArchive) { - URIConverter conv = anArchive.getResourceSet().getURIConverter(); - if (conv instanceof WorkbenchURIConverter) { - WorkbenchURIConverter wbConv = (WorkbenchURIConverter) conv; - IContainer input = wbConv.getInputContainer(); - if (input == null) - return null; - IProject p = input.getProject(); - if (p == null || JemProjectUtilities.isBinaryProject(p)) - return null; - IFile result = J2EEProjectUtilities.getManifestFile(p, false); - if (result != null && result.exists()) - return result; - } - return null; - } - - /** - * Checks if the nature is consistent with doc type. - */ - protected void validateDocType(EnterpriseArtifactEdit edit,IVirtualComponent module) { - if (edit == null) - return; - if (edit.getJ2EEVersion() >= J2EEVersionConstants.J2EE_1_3_ID && appDD.getVersionID() < J2EEVersionConstants.J2EE_1_3_ID) { - String[] params = new String[3]; - params[0] = DOCTYPE_1_2; - params[1] = getResourceName(); - params[2] = DOCTYPE_1_3; - String tmp = NLS.bind(EARValidationMessageResourceHandler.EAR_INVALID_DOC_TYPE_ERROR_, params); - addLocalizedError(tmp, appDD); - } else if (edit.getJ2EEVersion() < J2EEVersionConstants.J2EE_1_3_ID && appDD.getVersionID() >= J2EEVersionConstants.J2EE_1_3_ID) { - String[] params = new String[3]; - params[0] = DOCTYPE_1_3; - params[1] = getResourceName(); - params[2] = DOCTYPE_1_2; - String tmp = NLS.bind(EARValidationMessageResourceHandler.EAR_INVALID_DOC_TYPE_ERROR_, params); - addLocalizedError(tmp, appDD); - } - } - - /** - * Validates that conflicting jar does not exist in the ear project. - */ - public void validateUriAlreadyExistsInEar(EARArtifactEdit edit,IVirtualComponent component) { - IVirtualReference[] modules = edit.getJ2EEModuleReferences(); - if (modules == null) - return; - for (int i = 0; i < modules.length; i++) { - IVirtualReference reference = modules[i]; - IVirtualComponent module = reference.getReferencedComponent(); - if (module != null && module.getRootFolder().getRuntimePath() != null) { - IProject currentEARProject = earHelper.getProject(); - try { - IFile exFile = currentEARProject.getFile(module.getRootFolder().getRuntimePath()); - if (exFile != null && exFile.exists()) { - String[] params = new String[2]; - params[0] = module.getRootFolder().getRuntimePath().toString(); - params[1] = currentEARProject.getName(); - String tmp = NLS.bind(EARValidationMessageResourceHandler.URI_ALREADY_EXISTS_IN_EAR_WARN_, params); - addLocalizedWarning(tmp, appDD); - } - } catch (IllegalArgumentException iae) { - Logger.getLogger().logError(iae); - } - } - } - } - - protected void removeAllMessages(EObject eObject, String groupName) { - Resource res = eObject.eResource(); - if(res != null) { - IFile file = WorkbenchResourceHelper.getFile(res); - if(file != null) - _reporter.removeMessageSubset(this,file,groupName); - } - } - -}// UIEarValidator diff --git a/plugins/org.eclipse.jst.j2ee/license/berkeley_license.html b/plugins/org.eclipse.jst.j2ee/license/berkeley_license.html deleted file mode 100644 index 5f2e66fc1..000000000 --- a/plugins/org.eclipse.jst.j2ee/license/berkeley_license.html +++ /dev/null @@ -1,45 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> -<title>License</title> -</head> - -<body> -<p> -<b>Copyright 1994-2006 Sun Microsystems, Inc. All Rights Reserved.</b> -</p> -<p>Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: -</p> -<ul> -<li>Redistribution of source code must retain the above copyright notice, this -list of conditions and the following disclaimer.<br><br></li> -<li>Redistribution in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution.</li> -</ul> -<p>Neither the name of Sun Microsystems, Inc. or the names of contributors may -be used to endorse or promote products derived from this software without -specific prior written permission. -</p> -<p>This software is provided "AS IS," without a warranty of any kind. -ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING -ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR -NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") -AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE -AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS -DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY -LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, -CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND -REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR -INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. -</p> -<p>You acknowledge that this software is not designed, licensed or intended -for use in the design, construction, operation or maintenance of any nuclear facility. -</p> -</body> -</html> - - - diff --git a/plugins/org.eclipse.jst.j2ee/plugin.properties b/plugins/org.eclipse.jst.j2ee/plugin.properties deleted file mode 100644 index 4b0556e00..000000000 --- a/plugins/org.eclipse.jst.j2ee/plugin.properties +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 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 -############################################################################### -ear_validator_UI_=EAR Validator -war_validator_UI_=WAR Validator -application_client_validator_UI_=Application Client Validator -validation_UI_=Migration Of Validation -_UI_ParamValue_type=Param: -EAR_VALIDATION_PROBLEMMARKER_NAME=EAR Validator Message -EAR_FACET_LABEL=EAR -EAR_FACET_DESCRIPTION=Enables the project to be deployed as an EAR module. -EAR_FACET_TEMPLATE=EAR Project -UTILITY_FACET_LABEL=Utility Module -UTILITY_FACET_DESCRIPTION=Enables the project to be referenced by J2EE modules. -UTILITY_FACET_TEMPLATE=Java Utility Project -APPCLIENT_FACET_LABEL=Application Client module -APPCLIENT_FACET_DESCRIPTION=Enables the project to be deployed as a J2EE Application Client module. -APPCLIENT_FACET_TEMPLATE=Application Client Project -differentRuntimesDetectedMarkerName = Faceted Project Problem (Mismatched Runtimes) -Bundle-Vendor.0 = Eclipse.org -Bundle-Name.0 = J2EE Component -classpath_component_dependency_validator_UI_=Classpath Dependency Validator -classpath_dependency_validator_problemmarker_name=Classpath Dependency Validator Message -ejbEditorContentType=EJB Project Content -webEditorContentType=Web Project Content -earEditorContentType=EAR project Content -appclientEditorContentType=Application Client Content -ConnectorContentType=Connector Content diff --git a/plugins/org.eclipse.jst.j2ee/plugin.xml b/plugins/org.eclipse.jst.j2ee/plugin.xml deleted file mode 100644 index 3a406946a..000000000 --- a/plugins/org.eclipse.jst.j2ee/plugin.xml +++ /dev/null @@ -1,973 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> -<plugin> - - -<!-- Extension point to register specialized edit models with the EJBNature --> -<!-- Extension point to register specialized EJB commands --> - <extension-point id="EJBCommandExtension" name="EJBCommandExtension" schema="schema/EJBCommandExtension.exsd"/> -<!--============================--> -<!-- Codegen Contributions --> -<!--============================--> - - <extension-point id="J2EEModulePostImport" name="J2EEModulePostImport" schema="schema/J2EEModulePostImport.exsd"/> - - <extension-point id="EARModuleExtension" name="EARModuleExtension" schema="schema/EARModuleExtension.exsd"/> - <extension-point id="DeployerExtension" name="J2EE Deployer Extension" schema="schema/DeployerExtension.exsd"/> - <extension-point id="resourceEnvRefType" name="Resource Environment Reference Type" schema="schema/resourceEnvRefType.exsd"/> - <extension-point id="resourceRefType" name="Resource Reference Type" schema="schema/resourceRefType.exsd"/> - <extension-point id="WebServiceClientGenerator" name="WebServiceClientGenerator" schema="schema/WebServiceClientGenerator.exsd"/> - <extension-point id="WSDLServiceHelper" name="WSDLServiceHelper" schema="schema/WSDLServiceHelper.exsd"/> - <extension-point id="optionalRefactorHandler" name="optionalRefactorHandler" schema="schema/optionalRefactorHandler.exsd"/> - <extension-point id="classpathdep" name="classpathdep" schema="schema/ClasspathDep.exsd"/> - <extension-point id="J2EEModelProvider" name="J2EE Model Provider" schema="schema/J2EEModelProvider.exsd"/> - <extension-point id="archiveExportParticipants" name="Archive Export Participants Extension Point" schema="schema/archiveExportParticipants.exsd"/> - -<!--============================--> -<!-- Module Core Nature --> -<!--============================--> - - <extension - id="ModuleCoreNature" - name="Module Core Properties" - point="org.eclipse.core.resources.natures"> - <runtime> - <run - class="org.eclipse.wst.common.componentcore.ComponentCore"> - </run> - </runtime> - </extension> --> - - - <extension - point="org.eclipse.wst.common.emfworkbench.integration.editModel"> - <editModel - editModelID="jst.ear" - factoryClass="org.eclipse.wst.common.componentcore.internal.impl.ArtifactEditModelFactory"> - <editModelResource - autoload="false" - URI="META-INF/application.xml"/> - </editModel> - </extension> - <extension - point="org.eclipse.wst.common.modulecore.artifactedit"> - <artifactedit - typeID="jst.ear" - class="org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit"> - </artifactedit> - </extension> - <extension - point="org.eclipse.wst.common.emfworkbench.integration.editModel"> - <editModel - editModelID="jst.appclient" - factoryClass="org.eclipse.jst.common.jdt.internal.integration.JavaArtifactEditModelFactory"> - <editModelResource - autoload="false" - URI="META-INF/application-client.xml"/> - </editModel> - </extension> - <extension - point="org.eclipse.wst.common.modulecore.artifactedit"> - <artifactedit - typeID="jst.appclient" - class="org.eclipse.jst.j2ee.applicationclient.componentcore.util.AppClientArtifactEdit"> - </artifactedit> - </extension> - -<!--===================================================--> -<!-- Register known J2EE DTDs and XSDs for XML editor --> -<!-- DTD and XSD Contributions --> -<!--===================================================--> -<extension - point="org.eclipse.wst.internet.cache.cacheresource"> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/dtd/web-app_2_3.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/j2ee/dtds/application-client_1_2.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/dtd/application-client_1_3.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/j2ee/dtds/application_1_2.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/dtd/application_1_3.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/dtd/ejb-jar_2_0.dtd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/j2ee/"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/application_5.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/application-client_5.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/javaee_5.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/jsp_2_1.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"/> - <cacheresource - license="license/berkeley_license.html" - url="http://java.sun.com/xml/ns/javaee/"/> - </extension> - - -<!-- <extension - point="org.eclipse.wst.xml.uriresolver.catalogContributor"> - <catalogContributor - catalogId="default"> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" - uri="dtds/web-app_2_2.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - uri="dtds/web-app_2_3.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN" - uri="dtds/application-client_1_2.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" - uri="dtds/application-client_1_3.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" - uri="dtds/application_1_2.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" - uri="dtds/application_1_3.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" - uri="dtds/ejb-jar_1_1.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" - uri="dtds/ejb-jar_2_0.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD Connector 1.0//EN" - uri="dtds/connector_1_0.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" - uri="dtds/web-jsptaglibrary_1_1.dtd"> - </mappingInfo> - <mappingInfo - key="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" - uri="dtds/web-jsptaglibrary_1_2.dtd"> - </mappingInfo> - <mappingInfo - key="http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd" - uri="xsds/application-client_1_4.xsd"> - </mappingInfo> - <mappingInfo - key="http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" - uri="xsds/application_1_4.xsd"> - </mappingInfo> - <mappingInfo - key="http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" - uri="xsds/connector_1_5.xsd"> - </mappingInfo> - <mappingInfo - key="http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" - uri="xsds/ejb-jar_2_1.xsd"> - </mappingInfo> - <mappingInfo - key="http://java.sun.com/xml/ns/j2ee/" - uri="xsds/j2ee_1_4.xsd"> - </mappingInfo> - <mappingInfo - key="http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd" - uri="xsds/jsp_2_0.xsd"> - </mappingInfo> - <mappingInfo - key="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" - uri="xsds/web-app_2_4.xsd"> - </mappingInfo> - <mappingInfo - key="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" - uri="xsds/web-jsptaglibrary_2_0.xsd"> - </mappingInfo> - <mappingInfo - key="http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd" - uri="xsds/j2ee_jaxrpc_mapping_1_1.xsd"> - </mappingInfo> - <mappingInfo - key="http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd" - uri="xsds/j2ee_web_services_1_1.xsd"> - </mappingInfo> - <mappingInfo - key="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd" - uri="xsds/j2ee_web_services_client_1_1.xsd"> - </mappingInfo> - <mappingInfo - key="-//W3C//DTD XMLSCHEMA 200102//EN" - uri="dtds/XMLSchema.dtd"> - </mappingInfo> - <mappingInfo - key="datatypes" - uri="dtds/datatypes.dtd"> - </mappingInfo> - <mappingInfo - key="-//IBM Corporation, Inc.//DTD J2EE JAX-RPC mapping 1.0//EN" - uri="dtds/j2ee_jaxrpc_mapping_1_0.dtd "> - </mappingInfo> - <mappingInfo - key="-//IBM Corporation, Inc.//DTD J2EE Web services 1.0//EN" - uri="dtds/j2ee_web_services_1_0.dtd"> - </mappingInfo> - <mappingInfo - key="-//IBM Corporation, Inc.//DTD J2EE Web services client 1.0//EN" - uri="dtds/j2ee_web_services_client_1_0.dtd"> - </mappingInfo> - </catalogContributor> - </extension> --> -<!--=================================--> -<!-- LibCopy Builder Contributions --> -<!--=================================--> - <extension - id="LibCopyBuilder" - name="Library Copying Builder" - point="org.eclipse.core.resources.builders"> - <builder> - <run - class="org.eclipse.jst.j2ee.internal.plugin.LibCopyBuilder"> - </run> - </builder> - </extension> - <extension - id="EarValidator" - name="%ear_validator_UI_" - point="org.eclipse.wst.validation.validator"> - <validator> - <enablement> - <and> - <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.ear:1.4]"/> - </and> - </enablement> - <contentTypeBinding - contentTypeId="org.eclipse.jst.j2ee.earDD"> - </contentTypeBinding> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter="*.xmi"> - </filter> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter="*.jar"> - </filter> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter=".modulemaps"> - </filter> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter="org.eclipse.wst.common.component"> - </filter> - <dependentValidator - depValValue="true"> - </dependentValidator> - <markerId - markerIdValue="EARValidatorMarker"> - </markerId> - <run - class="org.eclipse.jst.j2ee.internal.validation.UIEarValidator"> - </run> - <helper - class="org.eclipse.jst.j2ee.internal.validation.UIEarHelper"> - </helper> - </validator> - </extension> - <extension - id="EARValidatorMarker" - name="%EAR_VALIDATION_PROBLEMMARKER_NAME" - point="org.eclipse.core.resources.markers"> - <super - type="org.eclipse.wst.validation.problemmarker"> - </super> - <persistent - value="true"> - </persistent> - <attribute - name="owner"> - </attribute> - <attribute - name="validationSeverity"> - </attribute> - <attribute - name="targetObject"> - </attribute> - <attribute - name="groupName"> - </attribute> - <attribute - name="messageId"> - </attribute> - </extension> - <extension - id="ClasspathDependencyValidator" - name="%classpath_component_dependency_validator_UI_" - point="org.eclipse.wst.validation.validator"> - <validator> - <facet - facetId="jst.java"> - </facet> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter=".classpath"> - </filter> - <dependentValidator depValValue="true"> - </dependentValidator> - <markerId - markerIdValue="ClasspathDependencyValidatorMarker"> - </markerId> - <helper - class="org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidatorHelper"> - </helper> - <run - class="org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator"> - </run> - </validator> - </extension> - <extension - id="ClasspathDependencyValidatorMarker" - name="%classpath_dependency_validator_problemmarker_name" - point="org.eclipse.core.resources.markers"> - <super - type="org.eclipse.wst.validation.problemmarker"> - </super> - <persistent - value="true"> - </persistent> - <attribute - name="owner"> - </attribute> - <attribute - name="validationSeverity"> - </attribute> - <attribute - name="targetObject"> - </attribute> - <attribute - name="groupName"> - </attribute> - <attribute - name="messageId"> - </attribute> - </extension> - <extension - id="ApplicationClientValidator" - name="%application_client_validator_UI_" - point="org.eclipse.wst.validation.validator"> - <validator> - <enablement> - <and> - <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.java"/> - <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.appclient:1.4]"/> - </and> - </enablement> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter="MANIFEST.MF"> - </filter> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter="application-client.xml"> - </filter> - <dependentValidator - depValValue="true"> - </dependentValidator> - <helper - class="org.eclipse.jst.j2ee.internal.validation.UIApplicationClientHelper"> - </helper> - <run - class="org.eclipse.jst.j2ee.internal.validation.UIApplicationClientValidator"> - </run> - </validator> - </extension> -<!--ModuleMapInit--> -<!--============================--> -<!-- J2EE Extension Point Registry--> -<!--============================--> - <extension - point="org.eclipse.emf.ecore.generated_package"> - <package - uri="modulemap.xmi" - class="org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage"> - </package> - </extension> -<!-- ====================================================== --> -<!-- Register package mappings --> -<!-- Several that have not changed are still registered as --> -<!-- a place holder for the future. --> -<!-- ====================================================== --> - <extension - point="org.eclipse.wst.common.emf.packageURIMap"> - <map - uri="modulemap.xmi" - prefix="modulemap"> - </map> - </extension> -<!-- ====================================================== --> -<!-- Extendable Operations --> -<!-- These operation are extendable in other plugins --> -<!-- ====================================================== --> - - <extension - name="J2EE tools function group" - point="org.eclipse.wst.common.frameworks.functionGroup"> - <functionGroup - initializerClassName="org.eclipse.jst.j2ee.internal.plugin.J2EEGroupInitializer" - name="J2EE Core tools" - functionGroupID="org.eclipse.jst.j2ee" - priority="0" - description="J2EE Core tools"> - </functionGroup> - <functionGroupPatternBinding - functionGroupID="org.eclipse.jst.j2ee" - pattern="org.eclipse.jst.j2ee.*"> - </functionGroupPatternBinding> - </extension> - <extension - point="org.eclipse.wst.common.emfworkbench.integration.adapterFactory"> - <adapterFactory - functionGroupID="org.eclipse.jst.j2ee" - className="org.eclipse.jst.j2ee.common.internal.provider.CommonItemProviderAdapterFactory" - packageURI="common.xmi" - id="org.eclipse.jst.j2ee.common.internal.provider.CommonItemProviderAdapterFactory"> - </adapterFactory> - </extension> - <extension - point="org.eclipse.wst.common.emfworkbench.integration.adapterFactory"> - <adapterFactory - functionGroupID="org.eclipse.jst.j2ee" - className="org.eclipse.jst.j2ee.internal.application.provider.ApplicationItemProviderAdapterFactory" - packageURI="application.xmi" - id="org.eclipse.jst.j2ee.application.provider.ApplicationItemProviderAdapterFactory"> - </adapterFactory> - </extension> - <extension - point="org.eclipse.wst.common.emfworkbench.integration.adapterFactory"> - <adapterFactory - functionGroupID="org.eclipse.jst.j2ee" - className="org.eclipse.jst.j2ee.internal.provider.ClientItemProviderAdapterFactory" - packageURI="client.xmi" - id="org.eclipse.jst.j2ee.client.provider.ClientItemProviderAdapterFactory"> - </adapterFactory> - </extension> - <extension - point="org.eclipse.wst.common.emfworkbench.integration.adapterFactory"> - <adapterFactory - functionGroupID="org.eclipse.jst.j2ee" - className="org.eclipse.jst.j2ee.internal.provider.ModulemapItemProviderAdapterFactory" - packageURI="modulemap.xmi" - id="org.eclipse.jst.j2ee.ear.modulemap.provider.ModulemapItemProviderAdapterFactory"> - </adapterFactory> - </extension> - <extension - point="org.eclipse.wst.common.emfworkbench.integration.adapterFactory"> - <adapterFactory - className="org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory" - packageURI="org.eclipse.emf.ecore.resource" - id="org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory"> - </adapterFactory> - </extension> - - - - -<!-- =============================================================== --> -<!-- Purpose: Define the default deployable project factory --> -<!-- Extension point: com.ibm.etools.server.core.deployableFactories --> -<!-- =============================================================== --> - <extension - point="org.eclipse.wst.server.core.moduleFactories"> - <moduleFactory - projects="true" - class="org.eclipse.jst.j2ee.internal.deployables.J2EEDeployableFactory" - id="org.eclipse.jst.j2ee.server"> - <moduleType - types="jst.ear" - versions="1.2,1.3,1.4"> - </moduleType> - <moduleType - types="jst.appclient" - versions="1.2,1.3,1.4"> - </moduleType> - <moduleType - types="jst.web" - versions="2.2,2.3,2.4"> - </moduleType> - <moduleType - types="jst.ejb" - versions="1.1,2.0,2.1"> - </moduleType> - <moduleType - types="jst.connector" - versions="1.0,1.5"> - </moduleType> - <moduleType - types="jst.utility" - versions="1.0"> - </moduleType> - </moduleFactory> - </extension> - -<!-- =============================================================== --> -<!-- WTP Operation extendable operations --> -<!-- --> -<!-- =============================================================== --> - - - <!--============================--> - <!-- Builder Provider registrations--> - <!--============================--> - <extension - point="org.eclipse.wst.common.frameworks.DataModelProviderExtension"> - <DataModelProvider - class="org.eclipse.jst.j2ee.internal.common.operations.JARDependencyDataModelProvider" - id="org.eclipse.jst.j2ee.internal.common.operations.JARDependencyDataModelProvider"/> - <DataModelProvider - class="org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider" - id="org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider"/> - <DataModelProvider - class="org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModelProvider" - id="org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModelProvider"/> - </extension> - - <!-- Project Facets --> - <extension point="org.eclipse.wst.common.project.facet.core.facets"> - - <project-facet id="jst.ear"> - <label>%EAR_FACET_LABEL</label> - <description>%EAR_FACET_DESCRIPTION</description> - <icon>icons/EAR.gif</icon> - <default-version version="1.4"/> - </project-facet> - - <project-facet-version facet="jst.ear" version="1.2"> - <constraint> - <and> - <conflicts group="modules"/> - <conflicts facet="jst.java"/> - </and> - </constraint> - <group-member id="modules"/> - </project-facet-version> - - <project-facet-version facet="jst.ear" version="1.3"> - <constraint> - <and> - <conflicts group="modules"/> - <conflicts facet="jst.java"/> - </and> - </constraint> - <group-member id="modules"/> - </project-facet-version> - - <project-facet-version facet="jst.ear" version="1.4"> - <constraint> - <and> - <conflicts group="modules"/> - <conflicts facet="jst.java"/> - </and> - </constraint> - <group-member id="modules"/> - </project-facet-version> - - <action facet="jst.ear" version="[1.2-1.4]" type="INSTALL" id="jst.ear.install"> - <delegate class="org.eclipse.jst.j2ee.project.facet.EarFacetInstallDelegate"/> - <config-factory class="org.eclipse.jst.j2ee.internal.earcreation.EarFacetInstallDataModelProvider"/> - </action> - - <event-handler facet="jst.ear" version="[1.2-1.4]" type="POST_INSTALL"> - <delegate class="org.eclipse.jst.j2ee.project.facet.EarFacetPostInstallDelegate"/> - </event-handler> - - <event-handler facet="jst.ear" version="[1.2-1.4]" type="RUNTIME_CHANGED"> - <delegate class="org.eclipse.jst.j2ee.project.facet.EarFacetRuntimeHandler$RuntimeChangedDelegate"/> - </event-handler> - - <project-facet id="jst.utility"> - <label>%UTILITY_FACET_LABEL</label> - <description>%UTILITY_FACET_DESCRIPTION</description> - </project-facet> - - <project-facet-version facet="jst.utility" version="1.0"> - <action type="install"> - <delegate class="org.eclipse.jst.j2ee.project.facet.UtilityFacetInstallDelegate"/> - <config-factory class="org.eclipse.jst.j2ee.project.facet.UtilityFacetInstallDataModelProvider"/> - </action> - <action type="uninstall"> - <delegate class="org.eclipse.jst.j2ee.project.facet.UtilityFacetUnInstallDelegate"/> - <config-factory class="org.eclipse.jst.j2ee.project.facet.UtilityFacetInstallDataModelProvider"/> - </action> - <event-handler type="RUNTIME_CHANGED"> - <delegate class="org.eclipse.jst.j2ee.project.facet.J2EEFacetRuntimeChangedDelegate"/> - </event-handler> - <event-handler type="POST_INSTALL" facet="jst.ear" version="[1.2-1.4]"> - <delegate class="org.eclipse.jst.j2ee.project.facet.UtilityFacetPostInstallDelegate"/> - </event-handler> - - <constraint> - <and> - <requires facet="jst.java" version="[1.3"/> - <conflicts group="modules"/> - </and> - </constraint> - <group-member id="modules"/> - </project-facet-version> - - - <project-facet id="jst.appclient"> - <label>%APPCLIENT_FACET_LABEL</label> - <description>%APPCLIENT_FACET_DESCRIPTION</description> - <icon>icons/ear.gif</icon> - <default-version version="1.4"/> - </project-facet> - - <project-facet-version facet="jst.appclient" version="1.2"> - <constraint> - <and> - <requires facet="jst.java" version="[1.3"/> - <conflicts group="modules"/> - </and> - </constraint> - <group-member id="modules"/> - </project-facet-version> - - <project-facet-version facet="jst.appclient" version="1.3"> - <constraint> - <and> - <requires facet="jst.java" version="[1.3"/> - <conflicts group="modules"/> - </and> - </constraint> - <group-member id="modules"/> - </project-facet-version> - - <project-facet-version facet="jst.appclient" version="1.4"> - <constraint> - <and> - <requires facet="jst.java" version="[1.3"/> - <conflicts group="modules"/> - </and> - </constraint> - <group-member id="modules"/> - </project-facet-version> - - <project-facet-version facet="jst.appclient" version="5.0"> - <constraint> - <and> - <requires facet="jst.java" version="[5.0"/> - <conflicts group="modules"/> - </and> - </constraint> - <group-member id="modules"/> - </project-facet-version> - - <action type="install" facet="jst.appclient" version="[1.2-5.0]" id="jst.appclient.install"> - <delegate class="org.eclipse.jst.j2ee.project.facet.AppClientFacetInstallDelegate"/> - <config-factory class="org.eclipse.jst.j2ee.project.facet.AppClientFacetInstallDataModelProvider"/> - </action> - - <event-handler type="POST_INSTALL" facet="jst.appclient" version="[1.2-5.0]"> - <delegate class="org.eclipse.jst.j2ee.project.facet.AppClientFacetPostInstallDelegate"/> - </event-handler> - - <event-handler type="RUNTIME_CHANGED" facet="jst.appclient" version="[1.2-5.0]"> - <delegate class="org.eclipse.jst.j2ee.project.facet.J2EEFacetRuntimeChangedDelegate"/> - </event-handler> - - <template id="template.jst.ear"> - <label>%EAR_FACET_TEMPLATE</label> - <fixed facet="jst.ear"/> - </template> - - <template id="template.jst.utility"> - <label>%UTILITY_FACET_TEMPLATE</label> - <fixed facet="jst.java"/> - <fixed facet="jst.utility"/> - </template> - - <template id="template.jst.appclient"> - <label>%APPCLIENT_FACET_TEMPLATE</label> - <fixed facet="jst.java"/> - <fixed facet="jst.appclient"/> - </template> - - </extension> - - <extension point="org.eclipse.wst.common.project.facet.core.validators"> - <validator class="org.eclipse.jst.j2ee.project.facet.EarFacetValidator"/> - </extension> - - <extension - point="org.eclipse.core.resources.markers" - id="differentRuntimesDetected" - name="%differentRuntimesDetectedMarkerName"> - <super type="org.eclipse.wst.common.project.facet.core.validation.marker"/> - <attribute name="moduleProject"/> - <attribute name="runtime1"/> - <attribute name="runtime2"/> - <persistent value="true"/> - </extension> - - <extension - point="org.eclipse.wst.validation.validationHelper"> - <validationHelper - id="org.eclipse.jst.common.componentcore.util.ProjectValidationHelper" - helperClass="org.eclipse.jst.j2ee.internal.validation.ProjectValidationHelper"> - </validationHelper> - </extension> - - <extension point="org.eclipse.jdt.core.classpathContainerInitializer"> - <classpathContainerInitializer - class="org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathInitializer" - id="org.eclipse.jst.j2ee.internal.module.container"/> - </extension> - - <!-- - Operation extension that updates the context-root entries in application.xml - --> - <extension - point="org.eclipse.wst.common.frameworks.OperationExtension" - id="org.eclipse.jst.j2ee.application.internal.operations.UpdateContextRoot"> - <operationExtension - id="org.eclipse.wst.web.internal.operation.WebProjectPropertiesUpdateOperation" - preOperationClass="org.eclipse.jst.j2ee.application.internal.operations.ComputeEARsForContextRootUpdateOp"/> - <operationExtension - id="org.eclipse.wst.web.internal.operation.WebProjectPropertiesUpdateOperation" - postOperationClass="org.eclipse.jst.j2ee.application.internal.operations.UpdateModuleContextRootInEAROp"/> - </extension> - - - <extension - point="org.eclipse.wst.common.modulecore.componentimpl"> - <componentimpl - typeID="jst.ear" - class="org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent"> - </componentimpl> - </extension> - - <extension - point="org.eclipse.wst.common.modulecore.componentimpl"> - <componentimpl - typeID="jst.utility" - class="org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent"> - </componentimpl> - </extension> - - <extension - point="org.eclipse.wst.common.modulecore.componentimpl"> - <componentimpl - typeID="jst.web" - class="org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent"> - </componentimpl> - </extension> - - <extension - point="org.eclipse.wst.common.modulecore.componentimpl"> - <componentimpl - typeID="jst.connector" - class="org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent"> - </componentimpl> - </extension> - - <extension - point="org.eclipse.wst.common.modulecore.componentimpl"> - <componentimpl - typeID="jst.ejb" - class="org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent"> - </componentimpl> - </extension> - - <extension - point="org.eclipse.wst.common.modulecore.componentimpl"> - <componentimpl - typeID="jst.appclient" - class="org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent"> - </componentimpl> - </extension> - - <extension - point="org.eclipse.core.runtime.contentTypes"> - <content-type - file-names="ejb-jar.xml" - id="ejbDD" - base-type="org.eclipse.core.runtime.xml" - name="%ejbEditorContentType" - priority="high"> - <describer - class="org.eclipse.jst.j2ee.contenttype.J2EEContentDescriber"> - </describer> - </content-type> - </extension> - - <extension - point="org.eclipse.core.runtime.contentTypes"> - <content-type - file-names="web.xml" - id="webDD" - base-type="org.eclipse.core.runtime.xml" - name="%webEditorContentType" - priority="high"> - <describer - class="org.eclipse.jst.j2ee.contenttype.J2EEContentDescriber"> - </describer> - </content-type> - </extension> - - <extension - point="org.eclipse.core.runtime.contentTypes"> - <content-type - file-names="application.xml" - id="earDD" - base-type="org.eclipse.core.runtime.xml" - name="%earEditorContentType" - priority="high"> - <describer - class="org.eclipse.jst.j2ee.contenttype.J2EEContentDescriber"> - </describer> - </content-type> - </extension> - - - <extension - point="org.eclipse.core.runtime.contentTypes"> - <content-type - file-names="application-client.xml" - id="appclientDD" - base-type="org.eclipse.core.runtime.xml" - name="%appclientEditorContentType" - priority="high"> - <describer - class="org.eclipse.jst.j2ee.contenttype.J2EEContentDescriber"> - </describer> - </content-type> - </extension> - - <extension - point="org.eclipse.core.runtime.contentTypes"> - <content-type - file-names="rar.xml" - id="connectorDD" - base-type="org.eclipse.core.runtime.xml" - name="%ConnectorContentType" - priority="high"> - <describer - class="org.eclipse.jst.j2ee.contenttype.J2EEContentDescriber"> - </describer> - </content-type> - </extension> - - <extension point="org.eclipse.jst.j2ee.classpathdep"> - <filteredClasspathContainer containerID="org.eclipse.jst.j2ee.internal.module.container"/> - <filteredClasspathContainer containerID="org.eclipse.jst.j2ee.internal.web.container"/> - <filteredClasspathContainer containerID="org.eclipse.jst.server.core.container"/> - <filteredClasspathContainer containerID="org.eclipse.jdt.launching.JRE_CONTAINER"/> - </extension> - <extension - point="org.eclipse.jst.j2ee.J2EEModelProvider"> - <provider> - <modelProvider factoryClass="org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit"/> - <facet id="jst.ear" versions="1.2,1.3,1.4"/> - </provider> - </extension> - <extension - point="org.eclipse.jst.j2ee.J2EEModelProvider"> - <provider> - <modelProvider factoryClass="org.eclipse.jst.j2ee.applicationclient.componentcore.util.AppClientArtifactEdit"/> - <facet id="jst.appclient" versions="1.2,1.3,1.4"/> - </provider> - </extension> - - <extension point="org.eclipse.core.expressions.propertyTesters"> - <propertyTester - id="org.eclipse.jst.j2ee.common.internal.FacetedProjectPropertyTester" - type="org.eclipse.jdt.core.ICompilationUnit" - namespace="org.eclipse.jst.j2ee.common" - properties="projectFacet" - class="org.eclipse.jst.j2ee.internal.common.FacetedProjectPropertyTester"> - </propertyTester> - </extension> - - <extension point="org.eclipse.core.expressions.propertyTesters"> - <propertyTester - id="org.eclipse.jst.j2ee.internal.provider.FacetedProjectPropertyTester" - type="org.eclipse.jst.j2ee.internal.provider.J2EEItemProvider" - namespace="org.eclipse.jst.j2ee.provider" - properties="projectFacet" - class="org.eclipse.jst.j2ee.internal.provider.FacetedProjectPropertyTester"> - </propertyTester> - </extension> - -</plugin> diff --git a/plugins/org.eclipse.jst.j2ee/prepareAllPII.xml b/plugins/org.eclipse.jst.j2ee/prepareAllPII.xml deleted file mode 100644 index 8b0550b2e..000000000 --- a/plugins/org.eclipse.jst.j2ee/prepareAllPII.xml +++ /dev/null @@ -1,192 +0,0 @@ -<project name="Build" default="All" basedir="."> - -<target name="com.ibm.etools.ejb.ui"> - <echo message="com.ibm.etools.ejb.ui..."/> - <ant antfile="../com.ibm.etools.ejb.ui/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.ejb.ui"> - <echo message="com.ibm.wtp.ejb.ui..."/> - <ant antfile="../com.ibm.wtp.ejb.ui/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.etools.emf.workbench.ui"> - <echo message="com.ibm.etools.emf.workbench.ui..."/> - <ant antfile="../com.ibm.etools.emf.workbench.ui/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.etools.j2ee.core"> - <echo message="com.ibm.etools.j2ee.core..."/> - <ant antfile="../com.ibm.etools.j2ee.core/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.etools.j2ee.reference.snippets"> - <echo message="com.ibm.etools.j2ee.reference.snippets..."/> - <ant antfile="../com.ibm.etools.j2ee.reference.snippets/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.etools.j2ee.ui"> - <echo message="com.ibm.etools.j2ee.ui..."/> - <ant antfile="../com.ibm.etools.j2ee.ui/prepareforpii.xml" target="main"/> -</target> - - -<target name="com.ibm.etools.validation"> - <echo message="com.ibm.etools.validation..."/> - <ant antfile="../com.ibm.etools.validation/prepareforpii.xml" target="main"/> - -</target> - -<target name="com.ibm.etools.validation.core"> - <echo message="com.ibm.etools.validation.core..."/> - <ant antfile="../com.ibm.etools.validation.core/prepareforpii.xml" target="main"/> - -</target> - -<target name="com.ibm.etools.validation.ui"> - <echo message="com.ibm.etools.validation.ui..."/> - <ant antfile="../com.ibm.etools.validation.ui/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.annotations.controller"> - <echo message="com.ibm.wtp.annotations.controller..."/> - <ant antfile="../com.ibm.wtp.annotations.controller/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.annotations.core"> - <echo message="com.ibm.wtp.annotations.core..."/> - <ant antfile="../com.ibm.wtp.annotations.core/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.annotations.ui"> - <echo message="com.ibm.wtp.annotations.ui..."/> - <ant antfile="../com.ibm.wtp.annotations.ui/prepareforpii.xml" target="main"/> - -</target> - -<target name="com.ibm.wtp.common"> - <echo message="com.ibm.wtp.common..."/> - <ant antfile="../com.ibm.wtp.common/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.common.navigator"> - <echo message="com.ibm.wtp.common.navigator..."/> - <ant antfile="../com.ibm.wtp.common.navigator/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.common.ui"> - <echo message="com.ibm.wtp.common.ui..."/> - <ant antfile="../com.ibm.wtp.common.ui/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.ejb"> - <echo message="com.ibm.wtp.ejb.."/> - <ant antfile="../com.ibm.wtp.ejb/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.emf"> - <echo message="com.ibm.wtp.emf.."/> - <ant antfile="../com.ibm.wtp.emf/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.emf.workbench"> - <echo message="com.ibm.wtp.emf.workbench.."/> - <ant antfile="../com.ibm.wtp.emf.workbench/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.emf.workbench.edit"> - <echo message="com.ibm.wtp.emf.workbench.edit.."/> - <ant antfile="../com.ibm.wtp.emf.workbench.edit/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.j2ee"> - <echo message="com.ibm.wtp.j2ee.."/> - <ant antfile="../com.ibm.wtp.j2ee/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.j2ee.ui"> - <echo message="com.ibm.wtp.j2ee.ui.."/> - <ant antfile="../com.ibm.wtp.j2ee.ui/prepareforpii.xml" target="main"/> -</target> - - -<target name="com.ibm.wtp.jca"> - <echo message="com.ibm.wtp.jca.."/> - <ant antfile="../com.ibm.wtp.jca/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.web"> - <echo message="com.ibm.wtp.web.."/> - <ant antfile="../com.ibm.wtp.web/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.webservice"> - <echo message="com.ibm.wtp.webservice.."/> - <ant antfile="../com.ibm.wtp.webservice/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.etools.project.interchange"> - <echo message="com.ibm.etools.project.interchange.."/> - <ant antfile="../com.ibm.etools.project.interchange/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.etools.ejb.samples"> - <echo message="com.ibm.etools.ejb.samples.."/> - <ant antfile="../com.ibm.etools.ejb.samples/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.activities"> - <echo message="com.ibm.wtp.activities.."/> - <ant antfile="../com.ibm.wtp.activities/prepareforpii.xml" target="main"/> -</target> - -<target name="com.ibm.wtp.j2ee.ui.navigator"> - <echo message="com.ibm.wtp.j2ee.ui.navigator.."/> - <ant antfile="../com.ibm.wtp.j2ee.ui.navigator/prepareforpii.xml" target="main"/> -</target> - -<target name="org.eclipse.ui.views.navigator"> - <echo message="org.eclipse.ui.views.navigator.."/> - <ant antfile="../org.eclipse.ui.views.navigator/prepareforpii.xml" target="main"/> -</target> - -<target name="org.eclipse.ui.workbench.navigator"> - <echo message="org.eclipse.ui.workbench.navigator.."/> - <ant antfile="../org.eclipse.ui.workbench.navigator/prepareforpii.xml" target="main"/> -</target> - -<target name="All"> - <antcall target="com.ibm.etools.ejb.ui"/> - <antcall target="com.ibm.wtp.ejb.ui"/> - <antcall target="com.ibm.etools.emf.workbench.ui"/> - <antcall target="com.ibm.etools.j2ee.core"/> - <antcall target="com.ibm.etools.j2ee.reference.snippets"/> - <antcall target="com.ibm.etools.j2ee.ui"/> - <antcall target="com.ibm.etools.validation"/> - <antcall target="com.ibm.etools.validation.ui"/> - <antcall target="com.ibm.wtp.annotations.controller"/> - <antcall target="com.ibm.wtp.annotations.core"/> - <antcall target="com.ibm.wtp.annotations.ui"/> - <antcall target="com.ibm.wtp.common"/> - <antcall target="com.ibm.wtp.ejb"/> - <antcall target="com.ibm.wtp.emf"/> - <antcall target="com.ibm.wtp.emf.workbench"/> - <antcall target="com.ibm.wtp.emf.workbench.edit"/> - <antcall target="com.ibm.wtp.j2ee"/> - <antcall target="com.ibm.wtp.j2ee.ui"/> - <antcall target="com.ibm.wtp.jca"/> - <antcall target="com.ibm.wtp.web"/> - <antcall target="com.ibm.wtp.webservice"/> - <antcall target="com.ibm.wtp.common.ui"/> - <antcall target="com.ibm.wtp.common.navigator"/> - <antcall target="com.ibm.etools.project.interchange"/> - <antcall target="com.ibm.etools.ejb.samples"/> - <antcall target="com.ibm.wtp.activities"/> - <antcall target="com.ibm.etools.validation.core"/> - <antcall target="com.ibm.wtp.j2ee.ui.navigator"/> - <antcall target="org.eclipse.ui.views.navigator"/> - <antcall target="org.eclipse.ui.workbench.navigator"/> -</target> - -</project> - diff --git a/plugins/org.eclipse.jst.j2ee/prepareforpii.xml b/plugins/org.eclipse.jst.j2ee/prepareforpii.xml deleted file mode 100644 index 281f3d008..000000000 --- a/plugins/org.eclipse.jst.j2ee/prepareforpii.xml +++ /dev/null @@ -1,38 +0,0 @@ -<project name="PrepareForPII" default="main" basedir="."> - - <!-- Setup temp variables --> - <target name="init"> - <property name="nlsDir" value="d:/NLS/Corona/0526"/> - <property name="plugin" value="com.ibm.wtp.j2ee"/> - <property name="plugindir" value="d:/workspaceCorona/${plugin}"/> - <property name="outputDir" value="${nlsDir}/${plugin}"/> - - - </target> - - <!-- Create the destination dir --> - <target name="nlsDir" depends="init"> - <mkdir dir="${nlsDir}"/> - </target> - - <!-- Create the destination dir --> - <target name="plugindir" depends="nlsDir"> - <delete dir="${outputDir}"/> - <mkdir dir="${outputDir}"/> - </target> - - <!-- Move the files to the correct locations in the workspace. --> - <target name="main" depends="plugindir"> - - <messageIdGen folderPath = "${plugindir}" componentId = "E" /> - - <copy todir = "${outputDir}/property_files" > - <fileset dir="${plugindir}/property_files"> - <include name="**/*.properties"/> - </fileset> - </copy> - - <copy file="${plugindir}/plugin.properties" todir="${outputDir}"/> - - </target> -</project> diff --git a/plugins/org.eclipse.jst.j2ee/property_files/appclientarchiveops.properties b/plugins/org.eclipse.jst.j2ee/property_files/appclientarchiveops.properties deleted file mode 100644 index bac140630..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/appclientarchiveops.properties +++ /dev/null @@ -1,25 +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 -############################################################################### -#This properties file contains string for Archive operations of Application Clients. - -ARCHIVE_OPERATION_SaveFile=Error occurred saving the file.. -ARCHIVE_OPERATION_ProjectNature=Error getting project nature runtime.. -ARCHIVE_OPERATION_SaveManifest=Error occurred saving the manifest.. -ARCHIVE_OPERATION_FileNotFound=Error: File not found.. -ARCHIVE_OPERATION_OpeningArchive=Error opening archive for export.. -ARCHIVE_OPERATION_ImportOperation=Import Operation Failed! -IMPORT_MOFRESOURCE_STRING=Importing meta-data.. -APPCLIENT_IMPORT_OPERATION_STRING=Importing application client JAR.. -APPCLIENT_IMPORT_FILE_STRING=Importing file.. -APPCLIENT_IMPORT_ERROR=Error importing application client file.. -ARCHIVE_OPERATION_ErrorOccured=Error occurred getting module folder name.. -Application_Client_File_UI_=Application Client File -_c__Copyright_IBM_Corporation_2001_1=(c) Copyright IBM Corporation 2001 diff --git a/plugins/org.eclipse.jst.j2ee/property_files/appclientcreation.properties b/plugins/org.eclipse.jst.j2ee/property_files/appclientcreation.properties deleted file mode 100644 index f42d2b8a6..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/appclientcreation.properties +++ /dev/null @@ -1,14 +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 -############################################################################### -Error_occured_getting_appl_ERROR_=IWAE0001E Error occurred getting application.xml: -Creating_Application_Clien_UI_=Creating Application Client Project... -Error_occured_loading_appl_UI_=Error occured loading application-client.xml: -Not_an_Application_Client_project_ERROR_=IWAE0002E Not an Application Client project. diff --git a/plugins/org.eclipse.jst.j2ee/property_files/applicationclientvalidation.properties b/plugins/org.eclipse.jst.j2ee/property_files/applicationclientvalidation.properties deleted file mode 100644 index 7f5c89ecb..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/applicationclientvalidation.properties +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -# This properties file holds all the externalized strings for the Application Client project -# -# :Begin: WebSphere Quality Validation Information :Begin: -#COMPONENTPREFIX CHKJ -#COMPONENTNAMEFOR CHKJ IBM WebSphere Validation -#CMVCPATHNAME ncf/src/java/com/ibm/websphere/validation/applicationclientvalidation.properties -# :End: WebSphere Quality Validation Information :End: - - -ERROR_APPLICATIONCLIENT_INVALID_APPCLIENT_FILE=CHKJ1000E: Validation failed because the application client file is not valid. Ensure that the deployment descriptor is valid. -#EXPLANATION None. -#USERACTION None. - -ERROR_APPCLIENT_VALIDATION_FAILED=CHKJ1001E: Validation failed: -#EXPLANATION None. -#USERACTION None. - -ERROR_EJB_REFS=CHKJ1002E: Unresolvable EJB references in {0}; -#EXPLANATION None. -#USERACTION None. - -INVALID_DD=CHKJ1003E: The application client project has an invalid deployment descriptor. -#EXPLANATION None. -#USERACTION None. - -MESSAGE_APPCLIENT_MISSING_URI=CHKJ1004E: The URI, {0}, does not match anything in the application client file. -#EXPLANATION None. -#USERACTION None. - -APPCLIENT_DD_PARSE_LINECOL=CHKJ1005E: The deployment descriptor could not be loaded due to an unknown syntax error. The bad section starts at line {0}, column {1}. -#EXPLANATION None. -#USERACTION None. - -APPCLIENT_DD_PARSE_LINE=CHKJ1006E: The deployment descriptor could not be loaded due to an unknown syntax error. The bad section starts at line {0}. -#EXPLANATION None. -#USERACTION None. - -APPCLIENT_DD_PARSE_NOINFO=CHKJ1007E: The deployment descriptor could not be loaded due to an unknown syntax error. There is no information available to help identify the bad section. -#EXPLANATION None. -#USERACTION None. - -APPCLIENT_DD_CANNOT_OPEN_DD=CHKJ1008E: Validation cannot complete because the deployment descriptor cannot be opened. -#EXPLANATION None. -#USERACTION None. - -APPCLIENT_DUP_RES_ENV_REF_ERROR_=IWAE0002E Duplicate resource environment reference "{0}" in application-client.xml. -#EXPLANATION None. -#USERACTION None. - -APPCLIENT_INVALID_DOC_TYPE_ERROR_=IWAE0003E Document type version "{0}" for application-client.xml in project "{1}" needs to be version "{2}". -#EXPLANATION None. -#USERACTION None. - -APPCLIENT_DUP_EJB_REF_ERROR_=IWAE0004E Duplicate enterprise bean reference "{0}" in application-client.xml. -APPCLIENT_MAIN_CLASS_ERROR_=IWAE0035E The Main-Class attribute must be defined in the application client module. diff --git a/plugins/org.eclipse.jst.j2ee/property_files/applicationproviders.properties b/plugins/org.eclipse.jst.j2ee/property_files/applicationproviders.properties deleted file mode 100644 index d426afdc6..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/applicationproviders.properties +++ /dev/null @@ -1,98 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -AllAuthenticatedUsers_UI_=AllAuthenticatedUsers -AppName_UI_=AppName -The_appName_property_UI_=The appName property -Application_UI_=Application -The_application_property_UI_=The application property -AuthorizationTable_UI_=AuthorizationTable -The_authorizationTable_property_UI_=The authorizationTable property -RunAsMap_UI_=RunAsMap -The_runAsMap_property_UI_=The runAsMap property -ApplicationBinding_UI_=ApplicationBinding -Failed_to_load_image_for_ERROR_=IWAE0001E Failed to load image for -Create_Child_UI_=Create Child -Create_a_new_child_for_the_selected_UI_=Create a new child for the selected -Create_RoleAssignment_UI_=Create RoleAssignment -Create_a_child_of_type_RoleAssignment_for_the_selected_UI_=Create a child of type RoleAssignment for the selected -Everyone_UI_=Everyone -Create_User_UI_=Create User -Create_a_child_of_type_User_for_the_selected_UI_=Create a child of type User for the selected -Role_UI_=Role -The_role_property_UI_=The role property -RoleAssignment_UI_=RoleAssignment -Create_a_new_child_of_type_for_the_selected_UI_=Create a child for the selected -AuthData_UI_=AuthData -The_authData_property_UI_=The authData property -SecurityRole_UI_=SecurityRole -The_securityRole_property_UI_=The securityRole property -RunAsBinding_UI_=RunAsBinding -Create_RunAsBinding_UI_=Create RunAsBinding -Create_a_child_of_type_RunAsBinding_for_the_selected_UI_=Create a child of type RunAsBinding for the selected -SpecialSubject_UI_=SpecialSubject -Name_UI_=Name -The_name_property_UI_=The name property -AccessId_UI_=AccessId -The_accessId_property_UI_=The accessId property -Subject_UI_=Subject -Create_WebModuleExtension_UI_=Create WebModuleExtension -Create_a_child_of_type_WebModuleExtension_for_the_selected_UI_=Create a child of type WebModuleExtension for the selected -ReloadInterval_UI_=ReloadInterval -The_reloadInterval_property_UI_=The reloadInterval property -ApplicationExtension_UI_=ApplicationExtension -EJB_Module_Extension_UI_=EJB Module Extension -Client_Module_Extension_UI_=Client Module Extension -AltBindings_UI_=AltBindings -The_altBindings_property_UI_=The altBindings property -AltExtensions_UI_=AltExtensions -The_altExtensions_property_UI_=The altExtensions property -DependentClasspath_UI_=DependentClasspath -The_dependentClasspath_property_UI_=The dependentClasspath property -AbsolutePath_UI_=AbsolutePath -The_absolutePath_property_UI_=The absolutePath property -ApplicationExtension_1_UI_=ApplicationExtension -The_applicationExtension_property_UI_=The applicationExtension property -Module_UI_=Module -The_module_property_UI_=The module property -<<Unresolvable_ERROR_=IWAE0002E <<Unresolvable -Create_Module_UI_=Create Module -Create_a_child_of_type_Module_for_the_selected_UI_=Create a child of type Module for the selected -SmallIcon_UI_=SmallIcon -The_smallIcon_property_UI_=The smallIcon property -LargeIcon_UI_=LargeIcon -The_largeIcon_property_UI_=The largeIcon property -Description_UI_=Description -The_description_property_UI_=The description property -DisplayName_UI_=DisplayName -The_displayName_property_UI_=The displayName property -<<No_display_name>>_ERROR_=IWAE0003E <<No display name>> -Uri_UI_=Uri -The_uri_property_UI_=The URI property -AltDD_UI_=AltDD -The_altDD_property_UI_=The altDD property -<<URI_not_set>>_ERROR_=IWAE0004E <<URI not set>> -ContextRoot_UI_=ContextRoot -The_contextRoot_property_UI_=The contextRoot property -Create_a_child_for_the_selected_UI_=Create a child for the selected -Module_Extension_UI_=Module Extension -Web_Module_Extension_UI_=Web Module Extension -EARProjectMap_UI_=EARProjectMap -Project_Name_UI_=Project Name -The_project_name_property_of_the_module_mapping_UI_=The project name property of the module mapping -The_module_of_the_module_mapping_UI_=The module of the module mapping -ModuleMapping_UI_=ModuleMapping -Project_Name_1=Project Name -The_project_name_property_of_the_utility_jar_mapping_UI_=The project name property of the utility JAR mapping -The_uri_property_of_the_utility_jar_mapping_UI_=The uri property of the utility JAR mapping -_UI_JavaClientModule_type=JavaClient -_UI_EjbModule_type=EJB -_UI_WebModule_type=Web -_UI_ConnectorModule_type=Connector diff --git a/plugins/org.eclipse.jst.j2ee/property_files/basecodegen.properties b/plugins/org.eclipse.jst.j2ee/property_files/basecodegen.properties deleted file mode 100644 index 80a24551b..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/basecodegen.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -No_analysis_reason_provide_INFO_=IWAE0001I No analysis reason is provided for the result, from \"{0}\" to \"{1}\". -_missing_=<missing> -Analysis_status_out_of_ran_EXC_=IWAE0002E Analysis status out of range. diff --git a/plugins/org.eclipse.jst.j2ee/property_files/classpathdependencyvalidator.properties b/plugins/org.eclipse.jst.j2ee/property_files/classpathdependencyvalidator.properties deleted file mode 100644 index 8a8840eb7..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/classpathdependencyvalidator.properties +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################### -# Copyright (c) 2007 BEA Systems, Inc. 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: -# BEA Systems, Inc. - initial API and implementation -############################################################################### -ClassFolderEntry=Invalid classpath publish/export dependency {0}. Class folders not supported. -NonWebNonExported=Classpath entry {0} is marked for publish/export but is not exported on the project classpath. Classpath visibility within Eclipse and at runtime will differ. -DuplicateArchiveName=Invalid classpath publish/export dependency {0}. The project contains another dependency with the same archive name. -RootMappingNonEARWARRef=Projects must be referenced by an EAR or a WAR to use classpath publish/export dependencies whose runtime path (../) maps into the parent component. -AppClientProject=Classpath publish/export dependencies are not supported for Application Client projects. -ProjectClasspathEntry=Invalid classpath publish/export dependency {0}. Project entries not supported. -SourceEntry=Invalid classpat publish/export dependency {0}. Source entries not supported. -FilteredContainer=Invalid classpath publish/export dependency {0}. The associated classpath container cannot be included in the published/exported module. -NonTaggedExportedClasses=Classpath entry {0} will not be exported or published. Runtime ClassNotFoundExceptions may result. -InvalidNonWebRuntimePath=Invalid runtime path {1} for classpath publish/export dependency {0}. Only the root path can be used in non-web projects. -InvalidWebRuntimePath=Invalid runtime path {1} for classpath publish/export dependency {0}. Runtime path must be root, WEB-INF/lib or WEB-INF/classes for web projects. diff --git a/plugins/org.eclipse.jst.j2ee/property_files/commonedit.properties b/plugins/org.eclipse.jst.j2ee/property_files/commonedit.properties deleted file mode 100644 index 1c0c49a94..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/commonedit.properties +++ /dev/null @@ -1,402 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2006 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 -############################################################################### -Create_Two_Children_UI_=Create Two Children -Create_Child_UI_=Create Child -Name_UI_=Name -The_name_property_UI_=The name property -Type_UI_=Type -The_type_property_UI_=The type property -Home_UI_=Home -The_home_property_UI_=The home property -Remote_UI_=Remote -The_remote_property_UI_=The remote property -_UI_EJBLocalRef_localHome_feature_desc=The local home property -_UI_EJBLocalRef_local_feature_desc=The local property -Link_UI_=Link -The_link_property_UI_=The link property -Description_UI_=Description -The_description_property_UI_=The description property -Client_UI_=Client -The_client_property_UI_=The client property -WebApp_UI_=WebApp -The_webApp_property_UI_=The webApp property -Ejb_UI_=Ejb -The_ejb_property_UI_=The EJB property -Value_UI_=Value -The_value_property_UI_=The value property -Auth_UI_=Auth -The_auth_property_UI_=The auth property -RoleName_UI_=RoleName -The_roleName_property_UI_=The roleName property -Application_UI_=Application -The_application_property_UI_=The application property -Servlet_UI_=Servlet -The_servlet_property_UI_=The servlet property -EJB_Reference_UI_=EJB Reference -_UI_EJBLocalRef_type=EJB Local Reference -New_UI_=Add -Delete_UI_=Remove -Delete_EJB_references_UI_=Delete EJB references -Variable_UI_=Variable -Delete_environment_entries_UI_=Delete environment entries -(New_Variable)_UI_=(New Variable) -New_environment_entry_UI_=New environment entry -Delete_resource_references_UI_=Delete resource references -Reference_Name_UI_=Reference Name -Authentication_UI_=Authentication -(New_ResourceRef)_UI_=(New ResourceRef) -New_resource_reference_UI_=New resource reference -Security_Roles_UI_=Security Roles -(New_Security_Role)_UI_=(New Security Role) -New_security_role_UI_=New security role -Delete_security_roles_UI_=Delete security roles -Bad_parent_ERROR_=IWAE0001E Bad parent -Choose_Icons_UI_=Choose Icons -Preview_UI_=Preview -Browse..._UI_=Browse... -Resource_must_exist._ERROR_=IWAE0002E Resource must exist. -Resource_must_be_accessibl_ERROR_=IWAE0003E Resource must be accessible. -What_resources_do_you_want_UI_=What resources do you want to export? -Where_do_you_want_to_expor_UI_=Where do you want to export resources to? -Options__UI_=Options: -Export_source_files_UI_=Export source files -Create_directory_structure_UI_=Create directory structure -Create_directories_for_sel_UI_=Create directories for selected folders -Import_into_new_or_existin_UI_=Import into new or existing Enterprise Application project -Create_complete_container__UI_=Create complete folder structure -File_Selection_UI_=File Selection -Select_a_file__UI_=Select a file: -Label_Ear_Project_Name_UI=Enterprise application project name: -Label_Where_To_Import_UI_=Where do you want the imported resources to go? -Overwrite_existing_resources_UI_=Overwrite existing resources without warning -Overwrite_existing_resources_export_UI_=Overwrite existing files without warning -(New_EJB_Ref)_UI_=(New EJB Ref) -Small_(16x16)__UI_=Small (16x16): -Large_(32x32)__UI_=Large (32x32): -Choose_Small_Icon_UI_=Choose Small Icon -Select_the_Small_Icon_UI_=Select the Small Icon -Choose_Large_Icon_UI_=Choose Large Icon -Select_the_Large_Icon_UI_=Select the Large -Icon29concat=Create a new child for the selected {0}. -1concat_UI_=Create a new child for the selected {0}. -3concat_UI_=BasicAuthData {0} -4concat_UI_=EjbRefBinding {0} -## on the following line, do not translate: CHILD_CLASS_NAME ## -5concat_UI_=Create a child of type #CHILD_CLASS_NAME# for the selected {0}. -6concat_UI_=ResourceRefBinding {0} -9concat_EXC_=IWAE0004E Failed to load image for ''{0}'' -11concat_ERROR_=IWAE0005E Cannot find the image for the file: {0} -12concat_ERROR_=IWAE0006E Problems with URL format of the image file: {0} -28concat_UI_={0} is an invalid character in a resource name. -29concat_UI_=Enterprise Application project contains invalid character {0}. -30concat_UI_=Enterprise Application must be absolute. Use /{0}. -13concat_UI_={0} is an invalid character in a resource name. -14concat_UI_=Enterprise Application project contains invalid character {0}. -15concat_UI_=Enterprise Application must be absolute. Use /{0}. -16concat_UI_=Create a child of type {0} for the selected {1}. -18concat_UI_=Create {0} -19concat_UI_=Create two new children for the selected {0}. -20concat_UI_=Create two new children of type {0} for the selected {1}. -21concat=Create Two {0}s -Undo@Ctrl+Z_UI_=Undo@Ctrl+Z -{0}_change_UI_={0} change -Project_and_EAR_names_can__UI_=Destination Project and Enterprise Application names cannot be the same -You_must_specify_an_EAR_pr_UI_=You must specify an Enterprise Application project that exists or should be created -Invalid_EAR_project_name_UI_=Invalid Enterprise Application project name -Project_exist,_but_it_is_n_UI_=Project exist, but it is not an Enterprise Application project -EAR_Project_Name__UI_=Enterprise application project name: -Create_Child_UI__UI_=Create Child -UserId_UI_=UserId -The_userId_property_UI_=The userId property -Password_UI_=Password -The_password_property_UI_=The password property -JndiName_UI_=JndiName -The_jndiName_property_UI_=The jndiName property -## on the following line, do not translate: bindingEjbRef ## -The_bindingEjbRef_property_UI_=The bindingEjbRef property -## on the following line, do not translate: bindingResourceRef ## -The_bindingResourceRef_pro_UI_=The bindingResourceRef property -## do not translate the following line ## -DefaultAuth_UI_=DefaultAuth -## on the following line, do not translate: defaultAuth ## -The_defaultAuth_property_UI_=The defaultAuth property -## on the following line, do not translate: CHILD_CLASS_NAME ## -Create_#CHILD_CLASS_NAME#_UI_=Create #CHILD_CLASS_NAME# -Question_UI_=Question -Resource__UI_=Resource {0} already exists. Would you like to overwrite it? -New_EJB_reference_UI_=New EJB reference -The_EJB_property_UI_=The EJB property -An_error_occurred_reading__ERROR_=IWAE0007E An error occurred reading the meta-data in Enterprise Application project {0}: -Error_in_EAR_project_UI_=Error in Enterprise Application project -Manifest_Class-Path__UI_=Manifest Class-Path: -Module_Dependencies_UI_=Module Dependencies -Select_dependent_JARs_for__UI_=Select dependent JARs for the module within the Enterprise Application project. -Project_name__UI_=Project name: -NO_EAR_JARDEP_FOR_MOD_UI_=Selected module not associated with an Enterprise Application module. -EAR_Project_Name__UI__UI_=Enterprise application project name: -Project_UI_=Project -Available_dependent_JARs__UI_=Available dependent JARs: -Project_{0}_is_not_referen_ERROR_=IWAE0008E Project {0} is not referenced by any Enterprise Application project. -Unable_to_edit_module_depe_UI_=Unable to edit module dependencies -Define_Java_Build_Settings_UI_=Define Java Build Settings -Specify_the_source_and_out_UI_=Specify the source and output folders, as well as the Java classpath in the appropriate order. -Enter_a_valid_project_name_UI_=Enter a valid project name -Project_name_has_invalid_c_UI_=Project name has invalid characters -Project_does_not_exist_or__UI_=Project does not exist or Invalid project nature. Enter a valid project name -EAR_Project_Name_UI_=Enterprise application project name: -Invalid_destination_projec_UI_=Invalid destination project -Cannot_import_into_a_close_UI_=Cannot import into a closed project -Project_name_must_be_speci_UI_=Project name must be specified -Select_an_EAR_Project_UI_=Select an Enterprise Application project -The_project_is_referenced__ERROR_=IWAE0009E The project is referenced by more than one Enterprise Application project. Please select the primary Enterprise Application project. -An_internal_error_occurred_ERROR_=IWAE0010E An internal error occurred: -2concat_INFO_=IWAE0011I The file {0} is read-only and cannot be saved. Would you like to make it editable and save anyway? -Information_UI_=Information -The_chosen_operation_is_no_INFO_=IWAE0012I The chosen operation is not currently available. -Save_problems_UI_=Save problems -Save_could_not_be_complete_INFO_=IWAE0013I Save could not be completed. Some related files may have already been saved.\n\nReason -Yes_UI_=Yes -Yes_To_All_UI_=Yes To All -No_UI_=No -Saving_Read-Only_File_UI_=Saving Read-Only File -A_source_folder_must_be_sp_UI_=A source folder must be specified -EAR_project_is_not_open_UI_=Enterprise Application project is not open -1concat_EXC_=IWAE0014E Invalid initial delay: {0} -2concat_EXC_=IWAE0015E Invalid delay: {0} -Information_UI__UI_=Information -Error_UI_=Error -Confirm_UI_=Confirm -Can't_start_a_TimerQueue_t_EXC_=IWAE0016E Can't start a TimerQueue that is already running -Module_Dependency_Dialog_Title_UI_=Module Dependencies Dialog -JAR/Module_UI_=JAR/Module -Must_be_an_Connector_Cli1_UI_=Must be a Connector project. -Must_be_an_Application_Cli_UI_=Must be an Application Client, EJB, or Web project. -Must_be_an_EJB_project._UI_=Must be an EJB project. -Selection_must_be_a_Web_pr_UI_=Selection must be a Web project. -Must_be_an_Enterprise_Appl_UI_=Must be an Enterprise Application project. -Must_be_an_Application_Cli1_j2ee13_UI_=Must be an J2EE 1.3 Application Client project. -Must_be_an_Application_Cli1_UI_=Must be an Application Client project. -Select_the_highest_J2EE_version_that_is_to_be_used__UI_=&Highest J2EE version used for development: -Unexpected_IO_exception_occurred_creating_xml_document_1_EXC_=IWAE0017E Unexpected IO exception occurred creating xml document -Delete_1=Delete... -Delete_selected_project(s)_2=Delete selected project(s) -Remove_module(s)_from_all_Enterprise_Applications_3=Remove module(s) from all Enterprise Applications -Remove_module(s)_from_all_other_Enterprise_Applications_4=Remove module(s) from all other Enterprise Applications -Remove_module_dependencies_referencing_selected_project(s)_5=Remove module dependencies referencing selected project(s) -Delete_Module_Options_6=Delete Module Options -Delete_Enterprise_Application_Options_7=Delete Enterprise Application Options -Delete_could_not_be_completed_8=Delete could not be completed -Delete_error_9=Delete error -What_would_you_like_to_delete__10=What would you like to delete? -Delete_selected_Enterprise_Application_project(s)_only_11=Delete selected Enterprise Application project(s) only -Also_delete_module_and_utility_Java_projects_12=Also delete module and utility Java projects -Delete_selected_project(s)_only_13=Delete selected project(s) only -Also_delete_references_to_selected_project(s)_14=Also delete references to selected project(s) -Rename_1=Rename... -Rename_selected_project_2=Rename selected project -Rename_module_in_all_Enterprise_Applications_3=Rename module in all Enterprise Applications -Rename_module_in_all_other_Enterprise_Applications_4=Rename module in all other Enterprise Applications -Rename_module_dependencies_referencing_selected_project_5=Rename module dependencies referencing selected project -Rename_Module_Options_6=Rename Module Options -Rename_Enterprise_Application_Options_7=Rename Enterprise Application Options -Rename_could_not_be_completed_8=Rename could not be completed -Rename_error_9=Rename error -What_would_you_like_to_rename_this_to__10=What would you like to rename this to? -Context_Root__11=Context Root: -Rename_selected_Enterprise_Application_project_only_12=Rename selected Enterprise Application project only -Also_rename_module_and_utility_Java_projects_13=Also rename module and utility Java projects -Source_1=Source -Error_creating_nested_text_editor_2=Error creating nested text editor -Redirecting_Editor_1=Redirecting Editor -Problems_Opening_Editor_2_ERROR_=IWAE0018E Problems Opening Editor -The_selected_input_is_not_valid_for_this_type_of_editor.__Redirecting_to_the_XML_editor_3_ERROR_=IWAE0019E The selected input is not valid for this type of editor. Redirecting to the XML editor. -REDIRECT_TEXT_EDITOR_UI_=The selected input is not valid for this type of editor. Redirecting to the text editor. -REDIRECT_TEXT_EDITOR_BINARY_PROJECT_UI_=The selected input is not valid for this type of editor. For binary projects, you can open the editor read-only from the deployment descriptor node in the Project Navigator or J2EE Hierarchy view. Redirecting to the text editor. -Error_checking_out_files_10=Error checking out files -Inconsistent_files_detected_11=Inconsistent files detected -The_following_files_are_inconsistent_with_the_file_system._Do_you_want_to_save_and_overwrite_these_files_on_the_file_system__12_WARN_=IWAE0020W The following files are inconsistent with the file system.\nDo you want to save and overwrite these files on the file system? -Project_should_not_be_null_1_EXC_=IWAE0021E Project should not be null -Non-project_in_selection_2_EXC_=IWAE0022E Non-project in selection -Project_should_not_be_null_1_ERROR_=IWAE0023E Project should not be null -Non-project_in_selection_2_ERROR_=IWAE0024E Non-project in selection -Up_1=&Up -Down_2=&Down -Select_All_3=Select &All -Deselect_All_4=D&eselect All -Project_3=Project -Enterprise_Application_Project_4=Enterprise application project: -New_ejb_project_and__ear_project_cannot_have_the_same_non_default_location_5_UI_=New EJB project and EAR project cannot have the same non default location -New_ejb_project_and__ear_project_cannot_have_the_same_non_default_location_6_UI_=New EJB project and EAR project cannot have the same non default location -Project_already_exists,_enter_a_new_project_name_to_create_a_new_EJB_project_7_UI_=Project already exists, enter a new project name to create a new EJB project -Project_already_exists,_enter_a_new_project_name_to_create_a_new_EAR_project_8_UI_=Project already exists, enter a new project name to create a new EAR project -Jar_file_name_must_be_entered_9_UI_=JAR file name must be entered -New_project_name__1=New project name: -New_project_location__2=New project location: -New_4=New -Existing_5=Existing -Existing_project_name__6=Existing project name: -Select_Project_7=Select Project -Project_does_not_exist_8=Project does not exist -Not_a_project_9=Not a project -Select_a_project_10=Select a project -DefaultEAR_1=DefaultEAR -Default13EAR_2=Default13EAR -Enterprise_Application_Project_3=Enterprise application project: -New_ejb_project_and_the_new_ear_project_cannot_have_the_same_non_default_location_4_ERROR_=IWAE0025E New EJB project and the new EAR project cannot have the same non default location -New_project_location__1=New project location: -MapInfoPath.applyPath()_-_Could_not_successfully_apply_path_1_EXC_=IWAE0026E MapInfoPath.applyPath() - Could not successfully apply path -Enter_a_valid_name=Enter a valid {0} name -The_non_default_location___1=The non default location: {0} for module {1} is in use. -The_project_location_in_use_UI=The non default location: {0} for {1} is in use. -Inconsistent_File_1=Inconsistent File -Inconsistent_Files_3=Inconsistent Files -The_following_workspace_files_are_inconsistent_with_the_editor_4=The following workspace files are inconsistent with the editor: \n -Update_the_editor_with_the_workspace_contents__5=Update the editor with the workspace contents? -The_following_workspace_file_is_inconsistent_with_the_editor_1=The following workspace file is inconsistent with the editor: {0} \n -EAR_project_1=EAR project: -EJB_project_2=EJB project -EXPORT_SOURCE_ZIP_UI_=Also export a source ZIP file -EAR_project_UI_=EAR project: -Project_and_EAR_project_non_default_location_UI_=Project and EAR project cannot have the same non default location -Invalid_non_default_location_UI_=Invalid non default location -Project_Main_UI_=Project -There_are_no_projects_available_that_match_the_selection_criteria._1=There are no projects available that match the selection criteria. -Incompatible_EAR_and_Web_Project_Level_1=Incompatible EAR and Web Project Level -You_have_selected_a_1.2_level_EAR.__Your_Web_Project_J2EE_level_will_be_changed_to_1.2.__Would_you_like_to_proceed_ERROR_2=IWAE0027E You have selected a 1.2 level EAR. Your Web Project's J2EE level will be changed to 1.2. Would you like to proceed? -J2EE_Level_4=J2EE Level -Project_1=Project -J2EE_Level_2=J2EE Level -Please_choose_a_J2EE_1.2_level_project_3=Please choose a J2EE 1.2 level project -Please_choose_a_J2EE_1.3_level_project_4=Please choose a J2EE 1.3 level project -Problems_Opening_Editor_2=Problems Opening Editor -The_selected_input_is_not_valid_for_this_type_of_editor.__Redirecting_to_the_XML_editor._ERROR_=IWAE0028E The selected input is not valid for this type of editor. Redirecting to the XML editor. -Enterprise_Application_Project__2=Enterprise application Project: -Context_root__3=Context root: -CANT_IMPORT_TO_BINARY_PROJECT_UI_=Cannot import into the existing project "{0}" because the project is binary. -One_or_more_referenced_Web_Library_Projects_do_not_exist=One or more Web Library Projects referenced by {0} do not exist or are closed.\n\nDo you want to continue without exporting these Web Library Projects? -Warning_1=Warning -Project_Doc_Root=Context root: -NO_EAR_JARDEP_UI_=Project is not associated with an Enterprise Application project. -The_description_property_of_the_identity_2=The description property of the identity -The_role_name_property_of_the_identity_4=The role name property of the identity -The_identity_of_the_run_as_specified_identity_2=The identity of the run as specified identity -The_description_property_of_the_security_identity_2=The description property of the security identity -Binary_Project_1=Binary Project -Include_project_build_paths_and_meta-data_files_1=Include project build paths and meta-data files -new_EAR_project_1=new EAR project -_ERROR_The_jar_file_does_not_exist_2=IWAE0029E The JAR file does not exist -_ERROR_The_J2EE_level_of_the_Jar_file_does_not_match_the_Project_level_3=IWAE0030E The J2EE level of the JAR file does not match the Project level -_ERROR_The_J2EE_level_of_the_jar_file_does_not_match_the_Enterprise_Application_level_4=IWAE0031E The J2EE level of the JAR file does not match the Enterprise Application level -The_action_cannot_be_performed_on_the_selection,_which_is_part_of_a_binary_project_UI_=The action cannot be performed on the selection, which is part of a binary project. -destination_project_1=destination project -CUSTOM_DELETE_MIX_MATCH_UI_=The custom J2EE delete options are not available for the selected J2EE projects. The standard delete options will be used. -PROJECT_NOT_ACCESSIBLE=The project {0} is not accessible. -IMPORT_FAILED_UI_=Import Failed -ERROR_READING_MANIFEST_DIALOG_TITLE=Error Reading Manifest -SAVE_MANIFEST_WITH_ERROR=The manifest file contains errors and can not be parsed. The file will be saved but the Java build path will not be updated. Following are common limitations which can cause problems: -ERROR_READING_MANIFEST_DIALOG_MESSAGE_EDITOR=The manifest file contains errors and can not be parsed. Other pages cannot be used until these errors are corrected. Following are common limitations which can cause problems: -ERROR_READING_MANIFEST_DIALOG_MESSAGE_PROP_PAGE=The manifest file contains errors and can not be parsed. Following are common limitations which can cause problems: -MANIFEST_PROBLEM_1=* Lines in the file must be no greater than 72 bytes. Continuation of long lines is indicated by a new line and a space. -MANIFEST_PROBLEM_2=* The last line in the file must end with a new line or it will not be parsed. -MANIFEST_PROBLEM_3=* Blank lines with extra white space may cause parse to fail. -MANIFEST_PROBLEM_4=* The attributes must be formatted correctly. Refer to the manifest and JAR file specification for more information. -ERROR_OCCURRED_TITLE=Error -ERROR_OCCURRED_MESSAGE=An internal error occurred performing the selected action. -SAVE_ON_BINARY_PROJECT_TITLE_UI_=Binary Projects -SAVE_ON_BINARY_PROJECT_MESSAGE_UI_=Cannot edit binary projects. All changes will be lost when you click OK. Are you sure you want to continue? -The_JAR_file_does_not_exist=The JAR file does not exist. -The_J2EE_level_of_the_Jar_file_does_not_match_the_Project_level._7=The J2EE level of the JAR file does not match the project level. -Project_already_exists.=Project {0} already exists. -Enterprise_Application_Project_does_not_exist.=Enterprise Application project {0} does not exist. -Enterprise_Application_Project_name_must_be_specified.=Enterprise Application project name must be specified. -An_Enterprise_Application_Project_with_the_name_already_exists_in_the_workspace.=Enterprise Application project {0} already exists. -Context_Root_cannot_be_emp_UI_=Context Root cannot be empty -Project_With_Same_Name_Exists_UI_=The project named \"{0}\" already exists. -Use_default_label_1=Use default -Must_be_an_J2EE13_EAR_Project_UI_=Must be an J2EE 1.3 level EAR Project -Assembly_Application_Project_Suffix=EAR -Assembly_EJBJAR_Project_Suffix=EJB -Assembly_Web_Project_Suffix=Web -Assembly_ClientJAR_Project_Suffix=Client -Assembly_Connector_Project_Suffix=Connector -Advanced..._UI=Advanced... -Project_Location_UI_=Project location: -DD_GENERAL_NAME=Deployment Descriptor -Destination__1=Destination: -Resource__2=Resource: -The_file_does_not_exist._1=The file does not exist. -Resource__2=Resource: -Must_be_an_J2EE12_Module_Only_UI_=Must be a J2EE 1.2 Level module file only. -Project_location__1=Project location: -Project__1=Project: -Browse..._2=Browse... -New..._3=New... -Invalid_EAR_For_Selected_Module=The J2EE level of the Enterprise Application project is not valid for the selected module file -Invalid_Project_For_Selected_Module=The J2EE level of the destination project is not valid for the selected module file -Invalid_EAR_Name_For_Project_Creation=The J2EE level of the exisiting EAR project: {0} does not match the J2EE level of the project being creation -J2EEImportWizardPage1.EAR_project=EAR project: -J2EEImportWizardPage1.The_file_does_not_exist=The file does not exist. -NewJ2EEProjectCreationPage.Project_name=Project name: -NewJ2EEProjectCreationPage.Project_location=Project location: -NewJ2EEProjectCreationPage.EAR_project=EAR project: -Proj_EAR_Proj_Name_Cannot_Be_Same_UI_=Project and EAR project names cannot be same -Enable_Label_UI_=Enable server targeting support -Disable_Label_UI_=Disable server targeting support -Change_Module_Server_Target_Dialog_Message_UI_=EAR target server: "{0}" \nModule target server: "{1}"\n\nChange module target server to EAR target server? -Change_EAR_Server_Target_Dialog_Message_UI_=Selected module target server: "{0}"\nExisting EAR target server: "{1}" \n\nChange EAR target server to selected module target server? -CREATE_EJB_CLIENT_JAR_UI_=Create EJB client JAR projects for new EJB projects -Change_Server_Target_Dialog_Title_UI_=Change Target Server -Modify_Server_Target_Title_UI_=Modify Target Server -Server_Target_UI_=Target server: -Server_Target_Desc_UI_=Select a target server for the \"{0}\" project. -Server_Target_Checkbox_Label_UI_=Update EAR modules and utility projects to the selected target server -Server_Target_Change_Desc_UI_=The target server "{0}" of the existing EAR project "{1}" is incompatible \nwith the module project being created. \n\nDo you want to change the target server of the EAR project to the module target server:\n\n{2} ? -EJB_CLIENT_RADIO_UI_=References to EJB JARs with EJB Client JARs -USE_EJB_SERVER_JARs_UI_=Use EJB JARs -USE_EJB_CLIENT_JARs_UI_=Use EJB client JARs -USE_BOTH_UI_=Allow both -EJB_CLIENT_JARS_UI_=EJB Client JARs -JAR_DEPS_CLIENT_UI_=Java JAR Dependencies for references to EJB JARs: -USE_EJB_JAR_UI=Use EJB JAR -USE_EJB_JAR_DESC_UI=All referencing modules and JARs depend on the EJB JAR. This is compatible with WebSphere 4.x, 5.x, and most application servers. -USE_EJB_CLIENT_JAR_UI_=Use EJB Client JAR, if it exists -USE_EJB_CLIENT_JAR_DESC_UI=All referencing modules and JARs depend on the EJB client JAR. This is best practice, but is only compatibile with WebSphere 5.1 and any application servers that support EJB client JAR deployment. -NONE_SERVER_TARGET_STRING_UI_=No target server specified -Server_Invalid_For_Exisitng_EAR_UI_=Selected target server "{0}" is invalid for the existing EAR project "{1}" -Cannot_Set_Server_Target_UI_=Could not set server target\n\n -_UI_EJBLocalRef_localHome_feature=Local Home -_UI_EJBLocalRef_local_feature=Local -_UI_EJBLocalRef_type=Local Ref -_UI_QName_type=QName: -_UI_CompatibilityDescriptionGroup_description_feature=Description -_UI_CompatibilityDescriptionGroup_description_feature_desc= -_UI_CompatibilityDescriptionGroup_displayName_feature=Display name -_UI_CompatibilityDescriptionGroup_displayName_feature_desc= -_UI_CompatibilityDescriptionGroup_smallIcon_feature=Small icon -_UI_CompatibilityDescriptionGroup_smallIcon_feature_desc= -_UI_CompatibilityDescriptionGroup_largeIcon_feature=Large icon -_UI_CompatibilityDescriptionGroup_largeIcon_feature_desc= -MessageDestination_UI_=Message Destination -MessageDestinationRefItemProvider_UI_0=MessageDestRef -INCREMENTAL_DEPLOYMENT_LABEL=Perform Incremental Deployment -GROUP_DEPLOYMENT_LABEL=Deployment - -_UI_QName_localPart_feature=Local Part -_UI_QName_localPart_feature_desc=The QName local part. -_UI_QName_namespaceURI_feature=Namespace URI -_UI_QName_namespaceURI_feature_desc=The QName namespace URI -Usage_UI_=Usage -The_usage_property_UI_=The usage property -_UI_ParamValue_description_feature=Description -_UI_ParamValue_name_feature=Name -_UI_ParamValue_value_feature=Value -_UI_ParamValue_type=Param - diff --git a/plugins/org.eclipse.jst.j2ee/property_files/eararchiveops.properties b/plugins/org.eclipse.jst.j2ee/property_files/eararchiveops.properties deleted file mode 100644 index 55d601a3d..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/eararchiveops.properties +++ /dev/null @@ -1,37 +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 -############################################################################### -#This properties file contains string for Archive operations of EARs - - -ARCHIVE_OPERATION_SaveMofResources=Error occurred saving the metadata file. -ARCHIVE_OPERATION_SaveFile=Error occurred saving the file. -ARCHIVE_OPERATION_ProjectNature=Error getting project nature runtime. -ARCHIVE_OPERATION_SaveManifest=Error occurred saving the manifest. -ARCHIVE_OPERATION_FileNotFound=Error: File not found. -ARCHIVE_OPERATION_FileContents=Core exception caught in getting file contents. -ARCHIVE_OPERATION_ErroOccured=Error occurred. -ARCHIVE_OPERATION_FilesFromProject=Unable to get files, modules, or utility JARs in the EAR. Check log files. -ARCHIVE_OPERATION_OpeningArchive=Error opening archive for export. -ARCHIVE_OPERATION_ImportOperation=Import Operation Failed! -IMPORT_MOFRESOURCE_STRING=Importing metadata.. -EAR_IMPORT_FILE_STRING=Importing file.. -ERROR_IMPORTING_EAR_FILE=Error importing EAR file. -ERROR_EXPORTING_EAR_FILE=Error exporting EAR file. -IMPORTING_EAR_FILE_UI_=Importing EAR file... - -Updating_project_classpath_UI_=Updating project classpaths... - -UNABLE_TO_LOAD_MODULE_ERROR_=IWAE0001E The module \" {0} \" in Enterprise Application project \" {1} \" could not be loaded.\n {2}; -_jar_UI_=.jar -Updating_manifest_Class_Path__attributes_UI_=Updating manifest Class-Path: attributes -_preDeploy_ERROR_=IWAE0002E {0}.preDeploy -noRuntimeSelectedLabel = <none> -MISSING_CLIENT_JAR=EJB Client Jar \"{0}\" for EJB Jar \"{1}\" missing from EAR \"{2}\". diff --git a/plugins/org.eclipse.jst.j2ee/property_files/earcreation.properties b/plugins/org.eclipse.jst.j2ee/property_files/earcreation.properties deleted file mode 100644 index 0da98a345..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/earcreation.properties +++ /dev/null @@ -1,84 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2006 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 -############################################################################### -Error_occured_getting_appl_ERROR_=IWAE0001E Error occurred getting appliction.xml: -Error_occured_getting_appl1_ERROR_=IWAE0002E Error occurred getting application.xml: -Creating__UI_=Creating: -Creating_EAR_Project_UI_=Creating Enterprise Application project... -The_project_already_exist_ERROR_=IWAE0003E The project already exist. -EARProjectCreationOperatio_ERROR_=IWAE0004E EARProjectCreationOperation.getNewProject : -ABS_PATH_CHANGED_UI_=The IBM extensions file contains deprecated absolute paths. This can be auto-corrected and should be saved. This will remove the paths from the file, and only needs to be done once. Would you like to auto-correct? -UNSAVED_CHANGES_WARN_=IWAE0005W Unsaved changes exist in Application. Project: {0} -PROJECT_MAP_PROBLEMS_ERROR_=IWAE0006E Problems exist in project mappings for one or more modules in Application. Use Application editor to correct. Project: {0} -MODULE_PROJECTS_CLOSED_WARN_=IWAE0007W One or more module projects is closed. Enterprise Application project: {0}. -Add_Module_Command_Label_UI_=Add Module -Remove_Module_Command_Label_UI_=Remove Module - -Set_project_UI_=Set project -Add_Utility_JAR_UI=Add Utility JAR -REM_UTIL_JAR_UI=Remove Utility JAR -PROJ_DESC_UPDATE_ERROR_UI_=IWAE0008E The project description could not be updated. -Not_an_ear_project_UI_=Not an EAR project. -EAR_PROJECT_MUST_BE_OPEN_UI_=An EAR project must be open and must exist for properties to be edited. -Updating_absolute_paths_UI_=Updating absolute paths for the server runtime. -DuplicateModuleNames=Duplicate module names : {0} -NoModulesSelected=No module types selected. - - -KEY_1=Project must be of type Web, EJB, Application client or Connector -KEY_2=Module already exists. -KEY_3=Selected project is closed. -KEY_4=Select a project from the list. -KEY_5=URI exists. -KEY_6=Selected project is not a Java project. -KEY_7=The uri must end with '.jar'. -KEY_8=Utility JAR already exists. -KEY_9=An open EAR project is required. -KEY_10=URI cannot be empty. -KEY_11=The module "{0}" is not an Application Client module. -KEY_12=The module "{0}" is not an EAR module. -KEY_13=The module "{0}" is not an EJB module. -KEY_14=The module "{0}" is not a RAR module. -KEY_15=The module "{0}" is not a WAR module. -KEY_16=The selected server target is not valid for the specified EAR component. The selected server may not support EAR component. -EARImportDataModel_UI_0=The specified project name \" {0} \" for archive \" {1} \" already exists. Choose a different name. -EARImportDataModel_UI_1=Colliding project name \" {0} \" between EAR project name and \" {1} \" archive. -EARImportDataModel_UI_1a=Colliding case insensitive project names \" {0} \", \" {1} \" between EAR project name and \" {2} \" archive. -EARImportDataModel_UI_2=Colliding project name \" {0} \" between archives \" {1} \" and \" {2} \". -EARImportDataModel_UI_2a=Colliding case insensitive project names \" {0} \", \" {1} \" between archives \" {2} \" and \" {3} \". -EARImportDataModel_UI_3=The specified project name \" {0} \" already exists. Choose a different name. -EARImportDataModel_UI_4=The nested archive \" {0} \" could not be loaded because it has errors and can not be imported as a project. Check the error log for details. -ModuleMappingImpl_UI_0=projectName: {0} -UtilityJARMappingImpl_UI_0=projectName: {0}, uri: {1} -importWrongType=The specified project \" {0} \" is not the correct J2EE type. -importWrongVersion=The specified project \" {0} \" is not J2EE version compatible with the specified archive. -EAR_PROJECTNAME_SAMEAS_MODULE=The EAR Project name cannot be same as the Project Name. - - -#J2EE Utility Import strings -J2EEUtilityJarListImportOperation_UI_Import_Utility_Jars=Import Utility Jars -J2EEUtilityJarListImportOperation_UI_Preparing_to_import=Preparing to import utility jars... -J2EEUtilityJarListImportOperation_UI_2=Problem importing Utility Jar -J2EEUtilityJarListImportDataModel_0=Invalid path location. -J2EEUtilityJarListImportDataModel_Specify_Valid_Project=Please specify a valid Enterprise Application Project. -J2EEUtilityJarListImportDataModel_Select_Jar=Please select one or more Utility Jars. -J2EEUtilityJarListImportDataModel_Specify_Linked_Path=Please specify a non-empty value for the Linked Path Variable name. -J2EEUtilityJarListImportDataModel_Linked_Path_Exists=A Linked Path Variable with the given name already exists. \nThe path has been updated accordingly. -J2EEUtilityJarListImportOperation_There_were_no_utility_jars_selected=There were no utility jars selected. - - - -CreateProjectWithLinkedJarOperation_Cannot_link_utility_jar_into_a_clos_=Cannot link utility jar into a closed project. -CopyArchiveIntoProjectOperation_Found_existing_file_0_=Found existing file "{0}". -CreateProjectWithLinkedJarOperation_File_already_exists_0_=File already exists\: "{0}". -CopyArchiveIntoProjectOperation_Copying_archive_into_selected_proje_=Copying archive into selected project\: "{0}". -CreateProjectWithLinkedJarOperation_Creating_project_with_linked_archiv_=Creating project with linked archive\: "{0}". -LinkArchiveIntoProjectOperation_Linking_archive_into_selected_proje_=Linking archive into selected project\: "{0}". -CreateProjectWithExtractedJarOperation_Create_project_with_extracted_conte_=Create project with extracted contents\: "{0}". diff --git a/plugins/org.eclipse.jst.j2ee/property_files/ejbarchiveops.properties b/plugins/org.eclipse.jst.j2ee/property_files/ejbarchiveops.properties deleted file mode 100644 index 9bb668d46..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/ejbarchiveops.properties +++ /dev/null @@ -1,38 +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 -############################################################################### -#This properties file contains string for Archive operations of EARs,EJBs and Application Clients. - -ARCHIVE_OPERATION_SaveMofResources=Error occured saving the metadata file. -ARCHIVE_OPERATION_SaveFile=Error occured saving the File.. -ARCHIVE_OPERATION_ProjectNature=Error getting project nature runtime.. -ARCHIVE_OPERATION_SaveManifest=Error occured saving the manifest.. -ARCHIVE_OPERATION_FileNotFound=Error: File not found -ARCHIVE_OPERATION_FileContents=Core exception caught in gettting file contents.. -ARCHIVE_OPERATION_ErroOccured=Error occured... -ARCHIVE_OPERATION_FilesFromProject=Unable to get files from the project.. -ARCHIVE_OPERATION_OpeningArchive=Error opening archive for export.. -ARCHIVE_OPERATION_InvalidEJBJar=The JAR file is not a valid EJB JAR -ARCHIVE_OPERATION_InvalidImportEJBJar=The import file is not a valid EJB JAR -ARCHIVE_OPERATION_ImportOperation=Import Operation Failed! -EJB_IMPORT_OPERATION_STRING=Importing EJB JAR.. -EJB_IMPORT_FILE_STRING=Importing file.. -IMPORT_MOFRESOURCE_STRING=Importing meta-data.. -IMPORT_OPERATION_STRING=Importing JAR.. -ERROR_COPYING_FILES_FROM_ORIGINAL_JAR=An error occurred copying files from the original EJB JAR file -ERROR_IMPORTING_MODULE_FILE=Error importing Module File -Yes_UI=Yes -No_UI=No -Yes_To_All_UI=Yes to All -Cancel_UI_=Cancel -Error_exporting__UI_=Error exporting -EJB_Jar_File_UI_=EJB JAR File -Copy_Dep_JARS_UI=Copy Dependent JARs - diff --git a/plugins/org.eclipse.jst.j2ee/property_files/erefvalidation.properties b/plugins/org.eclipse.jst.j2ee/property_files/erefvalidation.properties deleted file mode 100644 index 922b8a5ba..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/erefvalidation.properties +++ /dev/null @@ -1,78 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2006 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 -############################################################################### -#This properties file hold all the externalised strings for eTools J2EE Validation project -# Validation project -# -# Messages should be according to the format at: -# http://hany.austin.ibm.com/messages/index.html -# -# Briefly: -# MESSAGE_ID=<ComponentPrefix><MessageNumber><TypeCode>: <MessageText> -# -# The prefix for this component is: -# CHKJ (IBM WebSphere Validation) -# -# Note the ": " that appears between the type code and the message text. -# -# :Begin: WebSphere Quality Validation Information :Begin: -#COMPONENTPREFIX CHKJ -#COMPONENTNAMEFOR CHKJ IBM WebSphere Validation -#CMVCPATHNAME ncf/src/java/com/ibm/websphere/validation/erefvalidation.properties -# :End: WebSphere Quality Validation Information :End: -# -# 14-October-2001: -# - -# -------------------------------- -ERROR_EAR_MISSING_EREFNAME=CHKJ3009E: In module {1}, ''ejb-ref-name'' element in ejb-ref: {0} is invalid. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_EAR_INVALID_EREFTYPE=CHKJ3010E: In module {1}, ''ejb-ref-type'' element in ejb-ref: {0} is invalid. -#EXPLANATION None. -#USERACTION None. - -ERROR_EAR_MISSING_EREFTYPE=CHKJ3014E: In module {1}, ''ejb-ref-type'' element in ejb-ref: {0} is missing. - - -# -------------------------------- -ERROR_EAR_MISSING_EREFHOME=CHKJ3011E: In module {1}, Home interface is missing from ejb-ref: {0} element. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_EAR_MISSING_EREFREMOTE=CHKJ3012E: In module {1}, Remote interface is missing from ejb-ref: {0} element. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_EAR_MISSING_EJB_ROLE=CHKJ2827W: ''security-role-ref'' element {0} defines the ''role-link'' element but no ''security-role'' elements in the application descriptor. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_EAR_DUPLICATE_RESREF=CHKJ3013E: Duplicate ''resource-ref'' element named {0}. -#EXPLANATION None. -#USERACTION None. - -# new string added for version 5 WSAD -UNRESOLVED_EJB_REF_WARN_=IWAE0034W EJB link element {0} is unresolvable in module {1} and EAR {2}. - -ERROR_EAR_DUPLICATE_SERVICEREF=CHKJ3015E: Duplicate ''service-ref'' element named {0}. -ERROR_EAR_DUPLICATE_SECURITYROLEREF=CHKJ3016E: Duplicate ''security role-ref'' element named {0}. -ERROR_EAR_DUPLICATE_EJBREF=CHKJ3017E: Duplicate ''ejb-ref'' element named {0}. -ERROR_EAR_DUPLICATE_RESENVREF=CHKJ3018E: Duplicate ''resource environment-ref'' element named {0}. -ERROR_EAR_DUPLICATE_MESSSAGEDESTINATIONREF=CHKJ3019E: Duplicate ''message destination-ref'' element named {0}. -ERROR_EAR_MISSING_MESSSAGEDESTINATION=Message destination link ''{0}'' for message destination ref ''{1}'' is unresolvable in module ''{2}'' and EAR ''{3}''. -ERROR_UNRESOLVED_MDB_MISSING_MESSAGE_DESTINATION=Message destination link ''{0}'' of MDB ''{1}'' is unresolvable in module ''{2}'' and EAR ''{3}''. -ERROR_EAR_MISSING_EMPTY_MESSSAGEDESTINATION=Message destination link is empty for message destination ref ''{0}'' in module ''{1}'' and EAR ''{2}''. -ERROR_MODULE_DD_FILE_NOT_FOUND=The deployment descriptor of the module ''{0}'' cannot be loaded. diff --git a/plugins/org.eclipse.jst.j2ee/property_files/j2ee_common.properties b/plugins/org.eclipse.jst.j2ee/property_files/j2ee_common.properties deleted file mode 100644 index e3bbaea20..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/j2ee_common.properties +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 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 -############################################################################### -ERR_SECURITY_ROLE_EMPTY=The role name cannot be empty. -ERR_SECURITY_ROLE_EXIST=The security role named "{0}" already exists. -ERR_JAVA_CLASS_NAME_EMPTY=The class name cannot be empty. -ERR_JAVA_CLASS_NAME_EXIST=The class already exists in the package. -ERR_JAVA_CLASS_FILE_NAME_EXIST=File with same name but different case exists. -ERR_JAVA_CLASS_FOLDER_NAME_EMPTY=The source folder cannot be empty. -ERR_JAVA_CLASS_FOLDER_PROJECT_NOT_OPEN=The project is not open. -ERR_JAVA_CLASS_NOT_JAVA_PROJECT=Not a Java project. -ERR_JAVA_CLASS_FOLDER_STATIC_PROJECT=Cannot be a static web project. -ERR_JAVA_CLASS_FOLDER_NOT_SOURCE=Not a Java source folder. -ERR_JAVA_CLASS_NAME_QUALIFIED=Do not use qualified class name. -ERR_JAVA_CLASS_NAME_INVALID=Invalid Java class name: -ERR_JAVA_CLASS_NAME_WARNING=Warning: -ERR_JAVA_CLASS_SUPERCLASS_NOT_EXIST=The super class does not exist. -ERR_JAVA_CLASS_SUPERCLASS_FINAL=The super class cannot be a final class. -ERR_JAVA_PACAKGE_NAME_INVALID=Invalid Java package name: -ERR_JAVA_PACKAGE_NAME_WARNING=Warning: -ERR_BOTH_FINAL_AND_ABSTRACT=Class cannot be both final and abstract. -WebServiceClientGenerator_UI_0=Generic J2EE Container -ERR_SECURITY_ROLE_LIST_EMPTY=The list of security roles to be removed cannot be empty. - -ERR_JAVA_CLASS_FOLDER_NOT_EXIST=The source folder does not exist. - -ERR_EMPTY_MODULE_NAME=Module name cannot be empty. -ERR_EMPTY_PROJECT_NAME=Project cannot be empty. -ERR_PROJECT_INACCESSIBLE=Project "{0}" is missing or inaccessible. -ERR_PROJECT_NAME_EXISTS=Project name already exists. -ERR_VERSION_NOT_SUPPORTED=This version is not supported by the server. -ERR_NOT_SUPPORTED=Not supported by the server. -ERR_JAVA_CLASS_FOLDER_NOT_ABSOLUTE=Source folder path must be a workspace relative absolute path. -ERR_NO_MODEL_PROVIDER_FOR_PROJECT=No IModelProvider exists for project {0} of version: {1} -ERR_NO_MODEL_PROVIDER_FOR_VIRTUAL_COMPONENT=No IModelProvider exists for virtual component {0} of version: {1} - -J2EE_MODULE_CLASSPATH_CONTAINER_NAME=EAR Libraries - -CLASSPATH_ENTRY_DEPENDENCY_PREFIX=(Classpath) diff --git a/plugins/org.eclipse.jst.j2ee/property_files/j2eecreation.properties b/plugins/org.eclipse.jst.j2ee/property_files/j2eecreation.properties deleted file mode 100644 index 4584303d5..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/j2eecreation.properties +++ /dev/null @@ -1,143 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2006 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 -############################################################################### -Creating__UI_=Creating: -Error_creating_an_EAR_proj_UI_=Error creating an Enterprise Application project. -JdkJarFileDoesNotExist_UI=The file {0} does not exist. -APP_PROJECT_ERROR_EXC_=IWAE0001E An error occurred accessing the Enterprise Application project. -UNKNOWN_UI_=?? -Creating_Java_Project_UI_=Creating Java Project -Errors_occurred_deleting_module_dependencies_UI_=Errors occurred deleting module dependencies. -Can_not_remove_module_dependency_from_project_UI_=Can not remove module dependency from project {0} because the project is binary. -Errors_occurred_renaming_module_dependencies_UI_=Errors occurred renaming module dependencies. -Can_not_rename_module_dependency_from_project_UI_=Can not rename module dependency from project {0} because the project is binary. - -J2EE_PROJECT_MIGRATION_TITLE_UI_=J2EE Project Migration -ENTERPRISE_APPLICATIONS_UI_=Enterprise Applications -WIZ_BAN_DESC_UI_=Select the {0} projects to be migrated. If needed, the project structures will be migrated. -ENTERPRISE_APP_PROJECTS_UI_=Enterprise application projects: -MIGRATE_J2EE_SPEC_UI_=Migrate project from version level J2EE 1.2 to J2EE 1.3 -MIGRATE_EJB_SPEC_UI_=Migrate project from version level EJB 1.1 to EJB 2.0 -MIGRATE_MODULE_PROJECTS_UI_=Migrate module projects -APPLICATION_CLIENTS_UI_=Application Clients -APPLICATION_CLIENT_PROJECTS_UI_=Application client projects: -ENTERPRISE_BEANS_BAN_UI_=Enterprise Beans -EJB_PROJECTS_UI_=EJB projects: -ADD_LOCAL_CLIENT_VIEWS_CHECK_UI_=Add local client views -MIGRATE_CMP_BEANS_UI_=Migrate CMP 1.1 beans to CMP 2.0 beans -ADD_LOCAL_CLIENT_VIEWS_BAN_UI_=Add Local Client Views -SELECT_EJB_CLIENT_VIEWS_UI_=Select the enterprise beans that will have local client views added. -ENTERPRISE_BEANS_LIST_UI_=Enterprise beans: -DELETE_REM_CLIENT_VIEWS_UI_=Delete remote client views -LOCAL_CLIENT_VIEW_SCHEME_UI_=Local client view naming scheme: -REUSE_DELETED_CLIENT_VIEW_NAME_UI_=Reuse the deleted remote client view name -SPECIFY_SUFFIX_UI_=Specify suffix: -SUFFIX_EXAMPLE_UI_=(For example, enterprise bean \'foo\' will have local client views named: \'fooLocal\' and \'fooLocalHome\'.) -MIGRATION_SUCCESS_REPORT_UI_=Migration finished successfully. -MIGRATION_WARNINGS_REPORT_UI_=Migration finished with warnings; see log files for details. -MIGRATION_ERRORS_REPORT_UI_=Migration finished with errors; see log files for details. -PROJECT_STRUCTURE_SUCCESS_UI_=Project structure migration successful: {0}. -PROJECT_STRUCTURE_FAILED_UI_=Project structure migration failed: {0}. -PROJECT_NOT_NEED_MIGRATION_UI_=Project structure did not need migration: {0}. -J2EE_VERSION_SUCCESS_UI_=J2EE version level migration successful: {0}. -J2EE_VERSION_FAILED_UI_=J2EE version level migration failed: {0}. -J2EE_VERSION_NOT_NEED_MIGRATION_UI_=J2EE version level did not need migration: {0}. -LOCAL_CLIENT_ADD_SUCCESS_UI_=Local client views added successfully: {0}. -LOCAL_CLIENT_ADD_FAILED_UI_=Local client views failed on add: {0}. -LOCAL_CLIENT_VIEWS_EXIST_UI_=Local client views already exist: {0}. -REMOTE_CLIENT_DELETE_SUCCESS_UI_=Remote client views deleted successfully: {0}. -REMOTE_CLIENT_DELETE_FAILED_UI_=Remote client views failed on delete: {0}. -REMOTE_CLIENT_VIEWS_NOT_EXIST_UI_=Remote client views did not exist: {0}. -JAR_11_IMPORT_20_UI_=The 1.1 JAR is being imported into an EJB 2.0 module. The deployment descriptor will be converted, but the CMP beans remain version 1.1. -CMP_11_IMPORT_20_UI_=The following CMP 1.1 beans are being imported into an EJB 2.0 module. The deployment descriptor will be converted, but the CMP beans remain version 1.1. -OLD_PROJECT_STRUCTURE_UI_=The J2EE project {0} has an old project structure, and should be migrated. -PROJECT_MUST_BE_SELECTED_UI_=A {0} project must be selected. -ENTERPRISE_APPLICATION_UI_=enterprise application -APPLICATION_CLIENT_UI_=application client -EJB_UI_=EJB -WEB_UI_=WEB -EJB_MUST_BE_SELECTED_UI_=An enterprise bean must be selected. -MIGRATE_UI_=Migrate... -MIGRATE_J2EE_PROJECTS_UI_=Migrate J2EE Projects... -OPEN_J2EE_MIGRATION_WIZARD_UI_=Open J2EE Migration Wizard... -MIGRATING_PROJECT_STRUCTURES_UI_=Migrating project structure... -MIGRATING_J2EE_VERSION_UI_=Migrating project J2EE version level... -ADDING_LOCAL_CLIENT_VIEWS_UI_=Adding local client views... -DELETING_REMOTE_CLIENT_VIEWS_UI_=Deleting remote client views... -MIGRATION_NOT_NEEDED_REPORT=Migration was not needed for the selected items. -MIGRATION_NOT_POSSIBLE_REPORT=Migration was not possible for the selected items. -SOURCE_FOLDER_RENAME_FAILED=Unable to rename the Java source folder {0}. -SOURCE_FOLDER_RENAME_SKIPPED=The Java source folders are not renamed when there is more than one source folder. -WEBCONTENT_FOLDER_RENAME_FAILED=Unable to rename the web content folder {0}. -WEBCONTENT_FOLDER_RENAME_SKIPPED=The web content folder {0} not renamed. -WEBPROJECT_VERSION_MIGRATE_FAILED=Unable to migrate the web project version. -ABS_PATHS_APP_EXT_REMOVED=Absolute paths were removed from the application extensions file in enterprise application project {0}. -PROJECT_REFERENCES_UPDATED=Project references were updated in enterprise application project {0}. -PROJECT_CLASSPATH_UPDATED=Project Java build path was updated for project {0}. -FAILED_MIGRATING_IMPORTED_CLASSES=Unable to migrate the imported_classes JAR file. Exception: {0} -EXTRACTED_IMPORTED_CLASSES=Imported classes were extracted from file {0}. -IMPORTED_CLASSES_FILE_DELETED=Imported classes file {0} was deleted. -BACKEND_MIGRATION_FAILED=Unable to migrate the Map and Schema file structure in project {0} -BINARY_MIGRATION_FAILED=Unable to migrate binary project {0}. -COMPLETED_BACKEND_MIG=The backend (Map and Schema) meta-data of the {0} project migrated successfully. -NOT_NEEDED_DEPLOYMENT_DESC_MIG=The deployment descriptor was not found in the project {0}. -NOT_NEEDED_BACKEND_MIG=The old backend (Map and Schema) structure was not found in the project {0}. -MIGRATION_COMPLETE=Migration Complete -MIGRATION_ERRORS=Migration Errors -MIGRATION_NOT_NEEDED=Migration Not Needed -CONFIRMATION_TITLE=Confirm Migration -OPEN_EDITORS_TITLE=Open Editors -CONFIRM_MIGRATE_PROJECT_STRUCTURE=This will migrate the project structure for the selected items to the latest format. Continue? -CONFIRM_MIGRATE_J2EE_13=This will migrate the project structure for the selected items if necessary, and migrate the J2EE version of the selected items from 1.2 to 1.3. Continue? -INFORM_OPEN_EDITORS=Open editors exist in the workbench. Please close all editors before running migration. -WEBCONTENT_LIBPATH_UPDATE_FAILED=Unable to remove JAR file from classpath. -FAILED_DEPLOY_DELETE=Failed deleting deploy code in {0} project. -COMPLETED_DEPLOY_DELETE=Completed delete of deploy code in {0} project. -FAILED_LOCAL_CLIENT_CREATE=Failed creating local client view for {0}. -COMPLETED_LOCAL_CLIENT_CREATE=Completed creation of a local client view for {0}. -COMPLETED_CMP20_CODEGEN=Completed CMP 2.0 code generation in {0} project. -LOCAL_CLIENT_NOT_NEEDED=A local client view was not created since one already exists for {0}. -INVALID_SELECTION_TITLE=Invalid Selection -INFORM_PROPER_SELECTION=Selection must be one enterprise application project or any combination of EJB, web, and application client module projects. -REQUIRED_CLIENT_VIEW_TITLE=Client View Required -CONFIRM_CLIENT_VIEW_REQUIRED=The following beans are required to have client views because of inheritance or relationship rules. These beans will be automatically selected and client views will be generated. -FILES_OUT_OF_SYNC=Cannot migrate because some resources are out-of-sync with the file system in project {0}. Refresh the project and try again. -DeleteModuleOperation_UI_0=No Projects to delete -ResourceReferenceDataModel_UI_0=Type must be indicated. -ResourceReferenceDataModel_UI_1=Authentication must be indicated. -ReferenceDataModel_UI_3=No Owner for the reference has been indicated. -ReferenceDataModel_UI_5=Reference name cannot be empty. -ReferenceDataModel_UI_6=Reference name already exists. -ServiceReferenceDataModel_ERROR_8=IWAE0041E A target Web Service must be selected. -EJBReferenceDataModel_UI_10=Selected target EJB does not have local interfaces. -EJBReferenceDataModel_UI_11=Selected target EJB does not have remote interfaces. -EJBReferenceDataModel_UI_12=Target bean must be selected. -PortComponentReferenceDataModel_ERROR_4=IWAE0042E Service Endpoint Interface must be indicated. -MessageDestReferenceDataModel_7=Type must be indicated. -MessageDestReferenceDataModel_8=Usage must be indicated. -MessageDestReferenceDataModel_9=Link must be unique within EAR. -ResourceEnvironmentReferenceDataModel_2=Type must be selected. -RenameModuleOperation_UI_0=No Projects to rename. -ServerTargetDataModel_UI_7=There are no available target servers. -ServerTargetDataModel_UI_8=A target server must be set. -ServerTargetDataModel_UI_9=Invalid target server selected. -InvalidCharsError=Invalid character #. -Remote_cannot_be_empty_UI_=Remote interface cannot be empty. -Home_cannot_be_empty_UI_=Home interface cannot be empty. -Local_home_cannot_be_empty_UI_=Local home interface cannot be empty. -Local_cannot_be_empty_UI_=Local interface cannot be empty. - -USE_REMOTE_FOR_DIFFERENT_EAR=Best practice is to create 'remote' reference for an EJB if it's in different EAR. -USE_LOCAL_FOR_DIFFERENT_EAR=Best practice is to create 'local' reference for an EJB if its in same EAR. -TARGET_ALSO_EXIST_IN_SAME_EAR=The selected EJB was detected in ''{0}'' EAR which contains the ''{1}'' module project . Did you mean to select the EJB from the ''{0}'' EAR? -APP_CLIENT_ONLY_HAVE_REMOTE=Application client module can only have remote references. -J2EE_1_2_ONLY_HAVE_REMOTE=J2EE 1.2 modules can only have remote references. -COMPONENT_ALREADYINEAR=The specified component name is already in the EAR. -VERSION_NOT_SUPPORTED=The selected runtime does not support the version of the archive. diff --git a/plugins/org.eclipse.jst.j2ee/property_files/j2eewtpplugin.properties b/plugins/org.eclipse.jst.j2ee/property_files/j2eewtpplugin.properties deleted file mode 100644 index 2a46e5259..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/j2eewtpplugin.properties +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2006 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 -############################################################################### -Could_not_find_root_object_ERROR_=IWAE0001E Could not find root object in resource: {0} -An_error_occurred_while_sa_ERROR_=IWAE0002E An error occurred while saving. -Cannot_run_J2EEUIWorkingCo_ERROR_=IWAE0003E Cannot run J2EEUIWorkingCopyManager operation because the Workspace tree is locked. -Unable_to_save_read_only_f_ERROR_=IWAE0004E Unable to save read-only file: {0} -The_following_resources_ne_UI_=The following resources need to be saved but are currently shared, do you want to save now? -Cannot_load_EJBFile_because_EJBEditModel_is_null_UI_=Cannot load EJBFile because EJBEditModel is null -WARNING_METAFOLDER_MISSING_UI_=WARNING_METAFOLDER_MISSING -Cannot_load_EJBFile_because_ejbNature_asEJBJarFile___returns_null_UI_=Cannot load EJBFile because ejbNature.asEJBJarFile() returns null -EJBProjectResources_getEJBJar_EJBEditModel__UI_=EJBProjectResources.getEJBJar(EJBEditModel) -Cannot_load_EJBJar_because_model_is_null_UI_=Cannot load EJBJar because model is null -Cannot_load_EJBFile_because_EJBNatureRuntime_is_null_UI_=Cannot load EJBFile because EJBNatureRuntime is null -WARNING_FILE_MISSING_UI_=WARNING_FILE_MISSING -CoreException_could_not_initialize_Web_Service_class_path_variables_ERROR_=IWAE0005E CoreException could not initialize Web Service class path variables -__Start_build_project_INFO_=IWAE0006I : Start build project -__Bad_builder_order_for_project_INFO_=IWAE0007I : Bad builder order for project -__No_imported_classes_folder__quitting_INFO_=IWAE0008I : No imported classes folder, quitting -__Full_first_build_INFO_=IWAE0009I : Full/first build -__Considering_delta_INFO_=IWAE0010I : Considering delta -__Delta_build_INFO_=IWAE0011I : Delta build -Minimizing_project_UI_=Minimizing project -No_library_folder_UI_=No library folder -Not_a_J2EE_project_UI_=Not a J2EE project -No_source_types_UI_=No source types -Some_source_types_have______in_their_name_ERROR_=IWAE0012E Some source types have \'$\' in their name -RAR_File=RAR File -Error_opening_archive_for_export_2=Error opening archive for export -Error_getting_project_nature_runtime_3=Error getting project nature runtime -Error_occurred_loading_ra_xml__4=Error occurred loading ra.xml: -Creating_Connector_Project_5=Creating Connector Project -Error_getting_project_nature_runtime_6=Error getting project nature runtime -Error_occurred_saving_the_manifest_7=Error occurred saving the manifest -_UI_ParamValue_type=Param: -J2EEModulePostImportHelper_0=WEB -J2EEModulePostImportHelper_1=EJB -J2EEModulePostImportHelper_2=ApplicationClient -J2EEModulePostImportHelper_3=Connector -J2EEDeployOperation_UI_0=Deploying selected modules -J2EEDeployOperation_UI_1=Fatal Exception occured -J2EEDeployOperation_UI_Null_Status=Deployed successfully. -J2EEDeployOperation_1_UI_=Deploying {0} Using {1} -J2EEDeployOperation_2_UI_=Deployment from {0} completed successfully -J2EEDeployOperation_3_UI_=Deployment from {0} had errors: {1} \r\n -J2EEDeployOperation_4_UI_=Deploying {0} -NESTED_JAVA_OUTPUT_ERROR=Nested Java output paths defined in .wtpmodules file are not allowed. -_UI_ParamValue_type=Param - diff --git a/plugins/org.eclipse.jst.j2ee/property_files/javacodegen.properties b/plugins/org.eclipse.jst.j2ee/property_files/javacodegen.properties deleted file mode 100644 index 94b1a7d30..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/javacodegen.properties +++ /dev/null @@ -1,26 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -No_source_package_fragment_EXC_=IWAE0001E No source package fragment root could be found. -Specified_root_is_not_a_so_EXC_=IWAE0002E Specified root is not a source root. -Project_name_not_specified_EXC_=IWAE0003E Project name not specified. -An_analysis_import_can_onl_EXC_=IWAE0004E An analysis import can only be executed during run(). -If_this_generation_continu_WARN_=IWAE0005W If this generation continues, the Java source file \"{0}\" will be overwritten. -Java_generation_requires_a_EXC_=IWAE0006E Java generation requires a JavaTopLevelGenerationHelper. -The_prepare_method_can_o_EXC_=IWAE0007E The prepare() method can only be called during run(). -Member_generator_does_not__EXC_=IWAE0008E Member generator does not have a declaring type generator. -Enclosing_compilation_unit_EXC_=IWAE0009E Enclosing compilation unit generator not found. -Renames_of_main_types_are__EXC_=IWAE0010E Renames of main types are only supported in the Java code generation framework via a compilation unit rename. -The_field_will_not_gen_INFO_=IWAE0011I The field \"{1}\" will not be generated because a non-generated field with the same name already exists. -The_field_will_not_del_INFO_=IWAE0012I The field \"{0}\" will not be deleted because it is not marked generated. -The_method_will_not_gen_INFO_=IWAE0013I The method \"{1}\" will not be generated because a non-generated method with the same signature already exists. -The_method_will_not_del_INFO_=IWAE0014I The method \"{0}\" will not be deleted because it is not marked generated. -The_type_will_not_gen_INFO_=IWAE0015I The type \"{1}\" will not be generated because a non-generated type with the same name already exists. -The_type_will_not_del_INFO_=IWAE0016I The type \"{0}\" will not be deleted because it is not marked generated. diff --git a/plugins/org.eclipse.jst.j2ee/property_files/projectsupport.properties b/plugins/org.eclipse.jst.j2ee/property_files/projectsupport.properties deleted file mode 100644 index d420fa7f2..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/projectsupport.properties +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2006 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 -############################################################################### -Creating_Web_Project____UI_=Creating Web Project... -The_path_for_the_links_sta_EXC_=IWAE0001E The path for the links state file is incorrect -Syntax_Error_in_the_links_UI_=Syntax Error in the links state file -Error_while_saving_links_s_EXC_=IWAE0002E Error while saving links state file -Operation_failed_due_to_SA_ERROR_=IWAE0003E Operation failed due to SAX error: -Operation_failed_due_to_IO_ERROR_=IWAE0004E Operation failed due to IO error: -Operation_failed_due_to_Co_ERROR_=IWAE0005E Operation failed due to Core error: -Operation_failed_due_to_Ja_ERROR_=IWAE0006E Operation failed due to Java Model error: -_1concat_EXC_=IWAE0007E Error occured getting web.xml: {0} -Error_importing_Module_Fil_EXC_=IWAE0008E Error importing Module File -Cannot_clone_TaglibInfo_1_EXC_=IWAE0009E Cannot clone TaglibInfo -Could_not_read_TLD_15=Could not read TLD -File_Serving_Enabler_7=File Serving Enabler -Auto_Generated___File_Enabler_9=Auto Generated - File Enabler -Generated_by_Web_Tooling_23=Generated by Web Tooling -Not_a_web_project_29=Not a web project -A_web_project_must_be_open_and_must_exist_for_properties_to_be_edited_30=A web project must be open and must exist for properties to be edited -Invalid_Servlet_Level_set_on_WebNature_3_EXC_=IWAE0010E Invalid Servlet Level set on WebNature -Context_Root_cannot_be_empty_2=Context Root cannot be empty -Names_cannot_begin_or_end_with_whitespace_5=Names cannot begin or end with whitespace -Names_cannot_contain_whitespace_=Context Root cannot contain whitespace -The_character_is_invalid_in_a_context_root=The character ''{0}'' is invalid in a context root. -Folder_name_cannot_be_empty_2=Folder name cannot be empty -Folder_names_cannot_be_equal_4=Folder names cannot be equal -Folder_name_cannot_be_the_same_as_Java_source_folder_5=Folder name cannot be the same as Java source folder -Folder_name_cannot_be_the_same_as_Java_class_folder_6=Folder name cannot be the same as Java class folder -Folder_name_is_not_valid=Folder name {0} is not valid -Could_not_rename_____2=Could not rename: ''{0}'' already exists. -Sync_WLP_Op=Synchronizing Web Library Projects\n\t -Target_Update_Op=Updating target server for {0}\n\t -Set_ClassPath__UI_=Set ClassPath: -Update_ClassPath__UI_=Update ClassPath: -Catalog_Lib_Directory__UI_=Catalog Lib Directory: -Sychronize_Class_Path_UI_=Sychronize Class Path -UNABLE_TO_LOAD_MODULE_ERROR_=UNABLE_TO_LOAD_MODULE_ERROR_ -Importing_archive=Importing archive ''{0}''. -Exporting_archive=Exporting archive ''{0}''. diff --git a/plugins/org.eclipse.jst.j2ee/property_files/refactor.properties b/plugins/org.eclipse.jst.j2ee/property_files/refactor.properties deleted file mode 100644 index 5999e1440..000000000 --- a/plugins/org.eclipse.jst.j2ee/property_files/refactor.properties +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################### -# Copyright (c) 2005 BEA Systems, Inc. -# 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: -# BEA Systems, Inc. - initial API and implementation -############################################################################### -#This properties file contains string for refactoring logic - -pre_delete_not_received_for_removed=Missed PRE_DELETE event for removed project {0}, unable to update dependencies. -pre_delete_not_received_for_renamed=Missed PRE_DELETE event for renamed project {0}, unable to update dependencies. -invalid_property_name=Invalid property name: {0} -task_name=Project refactoring -missing_natures=Refactored project does not have either the ModuleCoreNature or JavaNature -error_reading_manifest=Error reading manifest -error_updating_project_on_delete=Error updating dependencies for deleted J2EE project {0} -error_updating_project_on_rename=Error updating dependencies for renamed J2EE project {0} -error_updating_server=Error updating server {0} on refactor of project {1} diff --git a/plugins/org.eclipse.jst.j2ee/pushforpii.xml b/plugins/org.eclipse.jst.j2ee/pushforpii.xml deleted file mode 100644 index a27d1e144..000000000 --- a/plugins/org.eclipse.jst.j2ee/pushforpii.xml +++ /dev/null @@ -1,267 +0,0 @@ -<project name="Translate" default="main" basedir="."> - - - <!-- Setup temp variables --> - <target name="init"> - <!-- If the user specifies a value for these variables, it overrides the values set in this target --> - <property name="input.dir" value="D:\NLS\Corona\TVTReturns" /> - <property name="output.dir" value="D:\NLS\Corona\TVTProcessed" /> - <property name="v" value="true"/> - <property name="WAS" value="WAS"/> - <property name="WSAD" value="WSAD"/> - <property name="product" value="${WSAD}"/> - - <taskdef name="goNative" - classname="com.ibm.etools.ant.tasks.GoNative" - classpath="D:\eclipse-SDK-3.0-win32\eclipse\plugins\com.ibm.rtp.tools_3.0.0\lib\tools.jar"/> - - <!-- Plugin vars --> - <property name="emf.workbenchui.nl1" value="com.ibm.etools.emf.workbench.ui.nl1"/> - <property name="j2eecore" value="com.ibm.etools.j2ee.core"/> - <property name="j2ee.snippets.nl1" value="com.ibm.etools.j2ee.reference.snippets.nl1"/> - <property name="j2ee.ui.nl1" value="com.ibm.etools.j2ee.ui.nl1"/> - <property name="project.interchange.nl1" value="com.ibm.etools.project.interchange.nl1"/> - <property name="validation.nl1" value="com.ibm.etools.validation.nl1"/> - <property name="validation.core" value="com.ibm.etools.validation.core"/> - <property name="validation.ui.nl1" value="com.ibm.etools.validation.ui.nl1"/> - <property name="wtp.activites.nl1" value="com.ibm.wtp.activities.nl1"/> - <property name="annotations.controller.nl1" value="com.ibm.wtp.annotations.controller.nl1"/> - <property name="annotations.core.nl1" value="com.ibm.wtp.annotations.core.nl1"/> - <property name="annotations.ui.nl1" value="com.ibm.wtp.annotations.ui.nl1"/> - <property name="wtp.common" value="com.ibm.wtp.common"/> - <property name="common.navigator.nl1" value="com.ibm.wtp.common.navigator.nl1"/> - <property name="common.ui.nl1" value="com.ibm.wtp.common.ui.nl1"/> - <property name="ejb.nl1" value="com.ibm.wtp.ejb.nl1"/> - <property name="wtp.emf" value="com.ibm.wtp.emf"/> - <property name="emf.workbench.edit.nl1" value="com.ibm.wtp.emf.workbench.edit.nl1"/> - <property name="j2ee.nl1" value="com.ibm.wtp.j2ee.nl1"/> - <property name="wtp.j2eeui.nl1" value="com.ibm.wtp.j2ee.ui.nl1"/> - <property name="emf.workbench.edit.nl1" value="com.ibm.wtp.emf.workbench.edit.nl1"/> - <property name="jca.nl1" value="com.ibm.wtp.jca.nl1"/> - <property name="web.nl1" value="com.ibm.wtp.web.nl1"/> - <property name="webservice.nl1" value="com.ibm.wtp.webservice.nl1"/> - <property name="j2ee.ui.navigator.nl1" value="com.ibm.wtp.j2ee.ui.navigator.nl1"/> - <property name="views.navigator.nl1" value="org.eclipse.ui.views.navigator.nl1"/> - <property name="workbench.navigator.nl1" value="org.eclipse.ui.workbench.navigator.nl1"/> - <property name="etools.ejb.ui.nl1" value="com.ibm.etools.ejb.ui.nl1"/> - <property name="wtp.ejb.ui.nl1" value="com.ibm.wtp.ejb.ui.nl1"/> - - - - </target> - - <target name="main" depends="init"> - - <!-- EMF Workbench UI --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="com.ibm.etools.emf.workbench.ui/property_files/commonappejb.properties" plugin="${emf.workbenchui.nl1}/property_files_nl1"/> - <push name="com.ibm.etools.emf.workbench.ui/property_files/commonedit.properties" plugin="${emf.workbenchui.nl1}/property_files_nl1"/> - <push name="commonfont_windows2000.properties" plugin="${emf.workbenchui.nl1}/property_files_nl1"/> - <push name="emfui.properties" plugin="${emf.workbenchui.nl1}/property_files_nl1"/> - </goNative> - - <!-- J2EE Core --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WAS}" verbose="${v}"> - <push name="commonarchive.properties" plugin="${j2eecore}/commonarchive"/> - <push name="com.ibm.etools.j2ee.core/mofj2ee/ejb.properties" plugin="${j2eecore}/mofj2ee"/> - <push name="j2eeplugin.properties" plugin="${j2eecore}/mofj2ee"/> - <push name="j2eexml.properties" plugin="${j2eecore}/mofj2ee"/> - <push name="mofj2ee.properties" plugin="${j2eecore}/mofj2ee"/> - <push name="xmlparse.properties" plugin="${j2eecore}/mofj2ee"/> - <push name="com.ibm.etools.j2ee.core/j2ee-validation/applicationclientvalidation.properties" plugin="${j2eecore}/j2ee-validation"/> - <push name="com.ibm.etools.j2ee.core/j2ee-validation/earvalidation.properties" plugin="${j2eecore}/j2ee-validation"/> - <push name="com.ibm.etools.j2ee.core/j2ee-validation/ejbvalidator.properties" plugin="${j2eecore}/j2ee-validation"/> - <push name="com.ibm.etools.j2ee.core/j2ee-validation/erefvalidation.properties" plugin="${j2eecore}/j2ee-validation"/> - <push name="com.ibm.etools.j2ee.core/j2ee-validation/rarvalidation.properties" plugin="${j2eecore}/j2ee-validation"/> - <push name="com.ibm.etools.j2ee.core/j2ee-validation/warvalidation.properties" plugin="${j2eecore}/j2ee-validation"/> - </goNative> - - <!-- J2EE Reference Snippets --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="ReferenceSnippetsPluginResources.properties" plugin="${j2ee.snippets.nl1}/property_files_nl1"/> - </goNative> - - <!-- J2EE UI --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="appclientarchiveui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="appclientui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="applicationeditor.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="com.ibm.etools.j2ee.ui/property_files/commonedit.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="connectorui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="earcreationui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="ejbarchiveui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="ejbcreationui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="connectorui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="ejbextui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="ejbui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="j2eeui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="rararchiveui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="webserviceui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="webui.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="wizards.properties" plugin="${j2ee.ui.nl1}/property_files_nl1"/> - <push name="com.ibm.etools.j2ee.ui/plugin.properties" plugin="${j2ee.ui.nl1}"/> - </goNative> - - <!-- Project Interchange --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="projectinterchange.properties" plugin="${project.interchange.nl1}/property_files_nl1"/> - <push name="com.ibm.etools.project.interchange/plugin.properties" plugin="${project.interchange.nl1}"/> - </goNative> - - <!-- Validation --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${product}" verbose="${v}"> - <push name="com.ibm.etools.validation/property_files/validate_base.properties" plugin="${validation.nl1}/property_files_nl1"/> - <push name="com.ibm.etools.validation/plugin.properties" plugin="${validation.nl1}"/> - </goNative> - - <!-- Validation Core --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="com.ibm.etools.validation.core/property_files/validate_base.properties" plugin="${validation.core}/property_files"/> - </goNative> - - <!-- Validation UI --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="validate_ui.properties" plugin="${validation.ui.nl1}/property_files_nl1"/> - <push name="com.ibm.etools.validation.ui/plugin.properties" plugin="${validation.ui.nl1}"/> - </goNative> - - - - <!-- WTP EMF --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="wftutils.properties" plugin="${wtp.emf}/wtpemf"/> - </goNative> - - <!-- Annotation Controller --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="annotationcontroller.properties" plugin="${annotations.controller.nl1}/property_files_nl1"/> - </goNative> - - <!-- Annotation Core --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="annotationcore.properties" plugin="${annotations.core.nl1}/property_files_nl1"/> - </goNative> - - <!-- Annotation UI --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="taghandlerui.properties" plugin="${annotations.ui.nl1}/property_files_nl1"/> - </goNative> - - <!-- WTP Common --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="wtp_common.properties" plugin="${wtp.common}/src"/> - </goNative> - - <!-- WTP Common Navigator --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="wtpnavigator.properties" plugin="${common.navigator.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.common.navigator/plugin.properties" plugin="${common.navigator.nl1}"/> - </goNative> - - <!-- WTP Common UI --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="wtpcommonui.properties" plugin="${common.ui.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.common.ui/plugin.properties" plugin="${common.ui.nl1}"/> - </goNative> - - <!-- EJB --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="com.ibm.wtp.ejb/property_files/ejbarchiveops.properties" plugin="${ejb.nl1}/property_files_nl1"/> - <push name="ejbcodegen.properties" plugin="${ejb.nl1}/property_files_nl1"/> - <push name="ejbcreation.properties" plugin="${ejb.nl1}/property_files_nl1"/> - <push name="ejbproviderlibraries.properties" plugin="${ejb.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.ejb/property_files/ejbvalidator.properties" plugin="${ejb.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.ejb/plugin.properties" plugin="${ejb.nl1}"/> - </goNative> - - - - - <!-- J2EE --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="appclientarchiveops.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="appclientcreation.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="applicationclientvalidation.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="applicationproviders.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="basecodegen.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.j2ee/property_files/commonedit.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="eararchiveops.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="earcreation.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.j2ee/property_files/earvalidation.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.j2ee/property_files/ejbarchiveops.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.j2ee/property_files/erefvalidation.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="j2ee_common.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="j2eecreation.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="j2eewtpplugin.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="javacodegen.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="projectsupport.properties" plugin="${j2ee.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.j2ee/plugin.properties" plugin="${j2ee.nl1}"/> - </goNative> - - <!-- WTP J2EE UI --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="ejb_figures.properties" plugin="${wtp.j2eeui.nl1}/property_files_nl1"/> - <push name="ejb_ui.properties" plugin="${wtp.j2eeui.nl1}/property_files_nl1"/> - <push name="j2ee_ui.properties" plugin="${wtp.j2eeui.nl1}/property_files_nl1"/> - <push name="jca_ui.properties" plugin="${wtp.j2eeui.nl1}/property_files_nl1"/> - <push name="migwizards.properties" plugin="${wtp.j2eeui.nl1}/property_files_nl1"/> - <push name="web_ui.properties" plugin="${wtp.j2eeui.nl1}/property_files_nl1"/> - <push name="webserviceui.properties" plugin="${wtp.j2eeui.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.j2ee.ui/plugin.properties" plugin="${wtp.j2eeui.nl1}"/> - </goNative> - - <!-- JCA --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="rar.properties" plugin="${jca.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.jca/property_files/rarvalidation.properties" plugin="${jca.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.jca/plugin.properties" plugin="${jca.nl1}"/> - </goNative> - - <!-- Web --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="ProjectSupport.properties" plugin="${web.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.web/property_files/warvalidation.properties" plugin="${web.nl1}/property_files_nl1"/> - <push name="web.properties" plugin="${web.nl1}/property_files_nl1"/> - <push name="webedit.properties" plugin="${web.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.web/plugin.properties" plugin="${web.nl1}"/> - </goNative> - - <!-- Web Services --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="webservice.properties" plugin="${webservice.nl1}/property_files_nl1"/> - <push name="com.ibm.wtp.webservice/plugin.properties" plugin="${webservice.nl1}"/> - </goNative> - - <!-- J2EE UI Navigator --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="com.ibm.wtp.j2ee.ui.navigator/plugin.properties" plugin="${j2ee.ui.navigator.nl1}"/> - </goNative> - - <!-- Views Navigator --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="messages.properties" plugin="${views.navigator.nl1}/property_files_nl1"/> - </goNative> - - <!-- Workbench Navigator --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="wbnavigator.properties" plugin="${workbench.navigator.nl1}/property_files_nl1"/> - <push name="org.eclipse.ui.workbench.navigator/plugin.properties" plugin="${workbench.navigator.nl1}"/> - </goNative> - - <!-- WTP Activities --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="com.ibm.wtp.activities/plugin.properties" plugin="${wtp.activites.nl1}"/> - </goNative> - - <!-- Etools EJB UI --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="com.ibm.etools.ejb.ui/plugin.properties" plugin="${etools.ejb.ui.nl1}"/> - </goNative> - - <!-- WTP EJB UI --> - <goNative archivePath="${input.dir}" archive="j2ee*" native2asciiDir="${output.dir}" fragments="false" product="${WSAD}" verbose="${v}"> - <push name="com.ibm.wtp.ejb.ui/plugin.properties" plugin="${etools.ejb.ui.nl1}"/> - </goNative> - - </target> -</project> diff --git a/plugins/org.eclipse.jst.j2ee/readme.html b/plugins/org.eclipse.jst.j2ee/readme.html deleted file mode 100644 index cb64bc03f..000000000 --- a/plugins/org.eclipse.jst.j2ee/readme.html +++ /dev/null @@ -1,16 +0,0 @@ -<html><head><title></title></head> -<body> -<pre> -<!-- Enter your readme text below this line. --> - - - - - - - - -<!-- Enter your readme text above this line. --> -</pre> -</body> -</html>
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/ProjectDependencyCache.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/ProjectDependencyCache.java deleted file mode 100644 index 75c5e2ffe..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/ProjectDependencyCache.java +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jem.util.logger.proxy.Logger; - -/** - * Maintains a cache of project dependencies as represented by references in the .project file. - * - * XXX DependencyManagerGraph is being used instead now that inter-project dependencies have - * dependent-module entries, however, this type of dependency representation might be useful if - * we want to capture dependencies on projects not represented in the .component file. - */ -public class ProjectDependencyCache { - - private static ProjectDependencyCache cache; - - public synchronized static ProjectDependencyCache getCache() { - if (cache == null) { - try { - cache = new ProjectDependencyCache(); - } catch (CoreException ce) { - Logger.getLogger().logError(ce); - } - } - return cache; - } - - /* - * Map from target IProject to List of dependent IProjects - */ - private final Map dependencyCache = new HashMap(); - - /* - * Map from dependent IProject to List of target IProject - */ - private final Map referenceCache = new HashMap(); - - /** - * Creates and initializes the cache. - */ - protected ProjectDependencyCache() throws CoreException { - final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - for (int i = 0; i < projects.length; i++) { - refreshDependencies(projects[i]); - } - } - - public synchronized IProject[] getDependentProjects(final IProject project) { - List dependencies = (List) dependencyCache.get(project); - if (dependencies == null) { - return new IProject[0]; - } - return (IProject[]) dependencies.toArray(new IProject[dependencies.size()]); - } - - public synchronized void refreshDependencies(final IProject project) throws CoreException { - List oldRefs = (List) referenceCache.get(project); - if (oldRefs == null) { - oldRefs = new ArrayList(); - } - final IProject[] refProjects = project.getDescription().getReferencedProjects(); - final List newRefs = new ArrayList(); - for (int j = 0; j < refProjects.length; j++) { - addDependency(refProjects[j], project); - newRefs.add(refProjects[j]); - oldRefs.remove(refProjects[j]); - } - referenceCache.put(project, newRefs); - - // need to cull the stale refs from the reverse map - Iterator i = oldRefs.iterator(); - while (i.hasNext()) { - removeDependency((IProject) i.next(), project); - } - } - - public synchronized void refreshDependenciesForTarget(final IProject target) throws CoreException { - final IProject[] dependents= getDependentProjects(target); - for (int i = 0; i < dependents.length; i++) { - refreshDependencies(dependents[i]); - } - } - - public synchronized void removeProject(final IProject project) throws CoreException { - // remove from the dependency cache - dependencyCache.remove(project); - // remove from the reference cache and clear the from the cache of all dependent projects - List dependencies = (List) referenceCache.remove(project); - if (dependencies != null) { - final Iterator i = dependencies.iterator(); - while (i.hasNext()) { - removeDependency((IProject) i.next(), project); - } - } - } - - public synchronized void replaceProject(final IProject originalProject, final IProject newProject) throws CoreException { - // rename dependencyCache entry - dependencyCache.put(newProject, dependencyCache.remove(originalProject)); - - // rename reference cache and clear the from the cache of all dependent projects - List dependencies = (List) referenceCache.remove(originalProject); - referenceCache.put(newProject, dependencies); - if (dependencies != null) { - final Iterator i = dependencies.iterator(); - while (i.hasNext()) { - final IProject ref = (IProject) i.next(); - removeDependency(ref, originalProject); - addDependency(ref, newProject); - } - } - } - - private void removeDependency(final IProject target, final IProject dependent) { - List dependentProjects = (List) dependencyCache.get(target); - if (dependentProjects != null) { - dependentProjects.remove(dependent); - } - } - - private void addDependency(final IProject target, final IProject dependent) { - List dependentProjects = (List) dependencyCache.get(target); - if (dependentProjects == null) { - dependentProjects = new ArrayList(); - dependencyCache.put(target, dependentProjects); - } - if (!dependentProjects.contains(dependent)) { - dependentProjects.add(dependent); - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/RefactorResourceHandler.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/RefactorResourceHandler.java deleted file mode 100644 index ba04f3ac1..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/RefactorResourceHandler.java +++ /dev/null @@ -1,67 +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.refactor; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * Supports access to resource strings. - */ -public class RefactorResourceHandler { - - private static ResourceBundle fgResourceBundle; - - /** - * Returns the resource bundle used by all classes in this Project - */ - public static ResourceBundle getResourceBundle() { - try { - return ResourceBundle.getBundle("refactor");//$NON-NLS-1$ - } catch (MissingResourceException e) { - // does nothing - this method will return null and - // getString(String, String) will return the key - // it was called with - } - return null; - } - - public static String getString(String key) { - if (fgResourceBundle == null) { - fgResourceBundle = getResourceBundle(); - } - - if (fgResourceBundle != null) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - } - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - - public static String getString(String key, Object[] args) { - - try { - return MessageFormat.format(getString(key), args); - } catch (IllegalArgumentException e) { - return getString(key); - } - - } - - public static void nlsConcatenationFinder() { - // used to tag methods which have concatenated strings - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/listeners/J2EEElementChangedListener.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/listeners/J2EEElementChangedListener.java deleted file mode 100644 index d74376f0f..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/listeners/J2EEElementChangedListener.java +++ /dev/null @@ -1,330 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.refactor.listeners; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.resources.WorkspaceJob; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jdt.core.IElementChangedListener; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaElementDelta; -import org.eclipse.jdt.core.IJavaModel; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.internal.ComponentResource; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; - -/** - * Implementation of <code>IElementChangedListener that updates mappings for src folders - * in the .component file in response to changes in a project's Java classpath. - */ -public class J2EEElementChangedListener implements IElementChangedListener { - - /** - * Name of the Job family in which all component update jobs belong. - */ - public static final String PROJECT_COMPONENT_UPDATE_JOB_FAMILY = "org.eclipse.jst.j2ee.refactor.component"; //$NON-NLS-1$ - - - /* (non-Javadoc) - * @see org.eclipse.jdt.core.IElementChangedListener#elementChanged(org.eclipse.jdt.core.ElementChangedEvent) - */ - public void elementChanged(final ElementChangedEvent event) { - processJavaElementDelta(event.getDelta()); - } - - private void processJavaElementDelta(final IJavaElementDelta delta) { - final int kind = delta.getKind(); - if (kind == IJavaElementDelta.CHANGED) { - final int flags = delta.getFlags(); - final IJavaElement element = delta.getElement(); - if (element instanceof IJavaModel) { - if ((flags & IJavaElementDelta.F_CHILDREN) == IJavaElementDelta.F_CHILDREN) { - final IJavaElementDelta[] children = delta.getChangedChildren(); - for (int i = 0; i < children.length; i++) { - // handle all of the IJavaProject children - processJavaElementDelta(children[i]); - } - } else { - // not a Java project (i.e. could be an EAR project) - processResourceDeltas(flags, kind, delta); - } - } else if (element instanceof IJavaProject) { - processJavaProject((IJavaProject) element, flags, kind, delta); - } - } - } - - private void processJavaProject(final IJavaProject jproject, final int flags, final int kind, final IJavaElementDelta delta) { - - final IProject project = jproject.getProject(); - final List pathsToAdd = new ArrayList(); - final List pathsToRemove = new ArrayList(); - final List changedJavaPaths = new ArrayList(); - - // make certain this is a J2EE project - if (ModuleCoreNature.getModuleCoreNature(project) != null) { - IVirtualComponent c = ComponentCore.createComponent(project); - try { - // Did the classpath change? - if ((flags & IJavaElementDelta.F_CHILDREN) == IJavaElementDelta.F_CHILDREN) { - final boolean cpChanged = (flags & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0; - getJavaSrcMappings(c, delta.getAffectedChildren(), cpChanged, jproject, pathsToAdd, pathsToRemove, changedJavaPaths); - } - - // Did a non-Java folder change name? - final IResourceDelta[] deltas = delta.getResourceDeltas(); - if (deltas != null && deltas.length > 0) { - getNonJavaFolderMappings(deltas, c, pathsToAdd, pathsToRemove, changedJavaPaths); - } - - } catch (CoreException ce) { - Logger.getLogger(J2EEPlugin.PLUGIN_ID).logError(ce); - return; - } - updateMappingsInJob(pathsToAdd, pathsToRemove); - } - } - - private void processResourceDeltas(final int flags, final int kind, final IJavaElementDelta delta) { - final List pathsToAdd = new ArrayList(); - final List pathsToRemove = new ArrayList(); - - final IResourceDelta[] deltas = delta.getResourceDeltas(); - if (deltas != null && deltas.length > 0) { - try { - getNonJavaFolderMappings(deltas, null, pathsToAdd, pathsToRemove, Collections.EMPTY_LIST); - } catch (CoreException ce) { - Logger.getLogger(J2EEPlugin.PLUGIN_ID).logError(ce); - return; - } - } - - updateMappingsInJob(pathsToAdd, pathsToRemove); - } - - /* - * Adds and removes the specified component resource mappings in a WorkspaceJob - */ - private void updateMappingsInJob(final List pathsToAdd, final List pathsToRemove) { - // If there are corrections to the virtual path mappings, execute them in a Job - if (!pathsToAdd.isEmpty() || !pathsToRemove.isEmpty()) { - WorkspaceJob job = new WorkspaceJob("J2EEComponentMappingUpdateJob") { - public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { - for(int i=0;i<pathsToAdd.size(); i++){ - Object[] toAdd = (Object[]) pathsToAdd.get(i); - final IVirtualFolder destFolder = (IVirtualFolder) toAdd[1]; - final IPath pathToAdd = (IPath) toAdd[0]; - destFolder.createLink(pathToAdd, 0, monitor); - } - for(int i=0;i<pathsToRemove.size(); i++){ - Object[] toRemove = (Object[]) pathsToRemove.get(i); - final IVirtualFolder destFolder = (IVirtualFolder) toRemove[1]; - final IPath pathToRemove = (IPath) toRemove[0]; - destFolder.removeLink(pathToRemove, 0, monitor); - } - return Status.OK_STATUS; - } - public boolean belongsTo(final Object family) { - return PROJECT_COMPONENT_UPDATE_JOB_FAMILY.equals(family); - } - }; - job.setRule(ResourcesPlugin.getWorkspace().getRoot()); - job.schedule(); - } - } - - /* - * Computes the virtual component path mapping changes the need to be made due to - * Java src path changes. - */ - private void getJavaSrcMappings(final IVirtualComponent virtualComp, final IJavaElementDelta[] children, final boolean cpChanged, final IJavaProject jproject, final List pathsToAdd, final List pathsToRemove, final List changedPaths) - throws CoreException { - - // get the default destination folder - final IVirtualFolder defaultDestFolder = getDestinationFolder(virtualComp); - - for (int i = 0; i < children.length; i++) { - final IJavaElementDelta delta = children[i]; - final IJavaElement element = delta.getElement(); - if(element.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT){ - final IPackageFragmentRoot root = (IPackageFragmentRoot) element; - int cpeKind = IPackageFragmentRoot.K_SOURCE; - boolean abortAdd = false; - try { - cpeKind = root.getKind(); - } catch (JavaModelException jme) { - // this is thrown if the folder corresponding to the CPE has been deleted - // since it could represent another error, we need to abort adding. - abortAdd = true; - } - // only update if we know it is a src folder - if (cpeKind == IPackageFragmentRoot.K_SOURCE) { - final int kind = delta.getKind(); - if (!cpChanged) { - // if the classpath is not changed, save modifications to the Java src path - if (kind == IJavaElementDelta.CHANGED || kind == IJavaElementDelta.REMOVED) { - changedPaths.add(root.getPath().removeFirstSegments(1)); - } - } else { - - // kind and flags for CP additions are somewhat sporadic; either: - // -kind is ADDED and flags are 0 - // or - // -kind is CHANGED and flags are F_ADDED_TO_CLASSPATH - final int flags = delta.getFlags(); - - if (kind == IJavaElementDelta.ADDED || - (flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) == IJavaElementDelta.F_ADDED_TO_CLASSPATH) { - if (!abortAdd) { - final IPath pathToAdd = root.getPath().removeFirstSegments(1); - pathsToAdd.add(new Object[]{pathToAdd, defaultDestFolder}); - // if the added src path was moved from another location, remove any mapping for that - // location - if ((flags & IJavaElementDelta.F_MOVED_FROM) == IJavaElementDelta.F_MOVED_FROM) { - final IJavaElement movedFromElement = delta.getMovedFromElement(); - final IPath pathToRemove = movedFromElement.getPath().removeFirstSegments(1); - pathsToRemove.add(new Object[]{pathToRemove, defaultDestFolder}); - } - } - // getting a kind = REMOVED and flags = 0 for removal of the folder (w/o removing the CPE), probably - // should not be generated - } else if ((flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) == IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) { - IPath path = root.getPath().removeFirstSegments(1); - pathsToRemove.add(new Object[]{path, defaultDestFolder}); - } - } - } - } - } - } - - /* - * Computes the virtual component path mapping changes the need to be made due to changes to - * non-Java folders. - */ - private void getNonJavaFolderMappings(final IResourceDelta[] deltas, final IVirtualComponent virtualComp, final List pathsToAdd, final List pathsToRemove, final List changedJavaPaths) throws CoreException { - IVirtualFolder rootFolder = null; - if (virtualComp != null) { - rootFolder = virtualComp.getRootFolder(); - } - Map sourceToRuntime = null; - if (virtualComp != null) { - sourceToRuntime = getResourceMappings(virtualComp.getProject()); - } - for (int i = 0; i < deltas.length; i++) { - final IResourceDelta delta = deltas[i]; - processResourceDelta(delta, rootFolder, sourceToRuntime, pathsToAdd, pathsToRemove, changedJavaPaths); - } - } - - /* - * Processes a single IResourceDelta. - */ - private void processResourceDelta(final IResourceDelta delta, IVirtualFolder rootFolder, Map sourceToRuntime, final List pathsToAdd, final List pathsToRemove, final List changedJavaPaths) throws CoreException { - final int kind = delta.getKind(); - if (kind == IResourceDelta.CHANGED) { - IResourceDelta[] childDeltas = delta.getAffectedChildren(); - for (int i = 0; i < childDeltas.length; i++) { - processResourceDelta(childDeltas[i], rootFolder, sourceToRuntime, pathsToAdd, pathsToRemove, changedJavaPaths); - } - } else { - final int flags = delta.getFlags(); - if ((flags & IResourceDelta.MOVED_FROM) == IResourceDelta.MOVED_FROM) { - if (rootFolder == null) { - final IProject project = delta.getResource().getProject(); - // make certain this is a J2EE project - if (ModuleCoreNature.getModuleCoreNature(project) != null) { - IVirtualComponent c = ComponentCore.createComponent(project); - rootFolder = c.getRootFolder(); - sourceToRuntime = getResourceMappings(project); - } else { - // not a J2EE project - return; - } - } - final IPath movedFrom = delta.getMovedFromPath().removeFirstSegments(1); - if (changedJavaPaths.contains(movedFrom)) { - // don't update renamed Java src paths - return; - } - final IPath movedTo = delta.getFullPath().removeFirstSegments(1); - final IPath runtimePath = (IPath) sourceToRuntime.get(movedFrom); - // does the old path have a virtual component mapping? - if (runtimePath != null) { - final IVirtualFolder folder = rootFolder.getFolder(runtimePath); - pathsToRemove.add(new Object[]{movedFrom, folder}); - pathsToAdd.add(new Object[]{movedTo, folder}); - } - } - } - } - - private Map getResourceMappings(final IProject project){ - final Map sourceToRuntime = new HashMap(); - StructureEdit core = null; - try { - core = StructureEdit.getStructureEditForRead(project); - final WorkbenchComponent component = core.getComponent(); - if (null != component) { - final List currentResources = component.getResources(); - for (Iterator iter = currentResources.iterator(); iter.hasNext();) { - final ComponentResource resource = (ComponentResource) iter.next(); - sourceToRuntime.put(resource.getSourcePath().makeRelative(), resource.getRuntimePath()); - } - } - return sourceToRuntime; - } finally { - if (core != null) - core.dispose(); - } - } - - /* - * Retrieves the IVirtualFolder to which Java src folders should be mapped - */ - private IVirtualFolder getDestinationFolder(final IVirtualComponent c) throws CoreException { - final IVirtualFolder root = c.getRootFolder(); - if (J2EEProjectUtilities.isDynamicWebProject(c.getProject())) { - // web projects map to WEB-INF/classes - return root.getFolder(new Path(J2EEConstants.WEB_INF_CLASSES)); - } - // all other J2EE project types (that are Java projects) map - // Java src folders to the project root - return root; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/listeners/ProjectRefactoringListener.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/listeners/ProjectRefactoringListener.java deleted file mode 100644 index 5bd474a42..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/listeners/ProjectRefactoringListener.java +++ /dev/null @@ -1,245 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.listeners; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.resources.WorkspaceJob; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.refactor.RefactorResourceHandler; -import org.eclipse.jst.j2ee.refactor.operations.OptionalRefactorHandler; -import org.eclipse.jst.j2ee.refactor.operations.ProjectDeleteDataModelProvider; -import org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata; -import org.eclipse.jst.j2ee.refactor.operations.ProjectRefactoringDataModelProvider; -import org.eclipse.jst.j2ee.refactor.operations.ProjectRenameDataModelProvider; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -/** - * Listens for project rename/delete events and, if the project had the - * ModuleCore nature, executes the appropriate logic to update - * project references. - */ -public final class ProjectRefactoringListener implements IResourceChangeListener, IResourceDeltaVisitor { - - /** - * Name of the Job family in which all project rename/delete refactoring jobs belong. - */ - public static final String PROJECT_REFACTORING_JOB_FAMILY = "org.eclipse.jst.j2ee.refactor.project"; //$NON-NLS-1$ - - /* - * Map from name of deleted project to ProjectRefactorMetadata instances. - */ - private final Map deletedProjectMetadata = new HashMap(); - - /** - * Maintains a cache of project depencencies; - */ - //private final ProjectDependencyCache cache; - - public ProjectRefactoringListener() {//final ProjectDependencyCache dependencyCache) { - //cache = dependencyCache; - // force a refresh of the DependencyGraphManager; was hitting an NPE - // in StructureEdit when the DGM was getting constructed during the receipt of the - // first pre-delete event - DependencyGraphManager.getInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) - */ - public void resourceChanged(final IResourceChangeEvent event) { - // need to capture PRE_DELETE events so that metadata about the - // deleted project can be collected and cached - try { - if (event.getType() == IResourceChangeEvent.PRE_DELETE) { - // for now, only dependencies on ModuleCoreNature projects - final IProject project = (IProject) event.getResource(); - // ensure project is accessible and has both module core and faceted natures - if (ModuleCoreNature.getModuleCoreNature(project) != null - && ProjectFacetsManager.create(project) != null) { - cacheDeletedProjectMetadata(project); - } - } else { - event.getDelta().accept(this); - } - } catch (CoreException ce) { - Logger.getLogger().logError(ce); - } - } - - private synchronized void cacheDeletedProjectMetadata(final IProject project) { - final ProjectRefactorMetadata metadata = new ProjectRefactorMetadata(project, ProjectRefactorMetadata.REFERER_CACHING); - // precompute the metadata while the project still exists - metadata.computeMetadata(); - metadata.computeServers(); - metadata.computeDependentMetadata(ProjectRefactorMetadata.REF_CACHING, - DependencyGraphManager.getInstance().getDependencyGraph().getReferencingComponents(project)); - //, cache.getDependentProjects(project)); - deletedProjectMetadata.put(project.getName(), metadata); - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta) - */ - public boolean visit(final IResourceDelta delta) throws CoreException { - final IResource resource = delta.getResource(); - if (resource instanceof IWorkspaceRoot) { - // delta is at the workspace root so keep going - return true; - } else if (resource instanceof IProject) { - processProjectDelta((IProject) resource, delta); - } - return false; - } - - /* - * Process the project delta in a sync block. - */ - private synchronized void processProjectDelta(final IProject project, final IResourceDelta delta) throws CoreException { - final int kind = delta.getKind(); - final int flags = delta.getFlags(); - - if (kind == IResourceDelta.REMOVED) { - if (hasDeletedRemovedFlags(flags)) { - // Remove all entries int the project dependency cache - //cache.removeProject(project); - // if the kind is REMOVED and there are no special flags, the project was deleted - ProjectRefactorMetadata metadata = (ProjectRefactorMetadata) deletedProjectMetadata.remove(project.getName()); - // note: only projects with ModuleCoreNature will have cached metadata - if (metadata != null && OptionalRefactorHandler.getInstance().shouldRefactorDeletedProject(metadata)) { - processDelete(metadata); - } - } - } else if (kind == IResourceDelta.ADDED && hasRenamedAddedFlags(flags)) { // was renamed - // get the original name - final String originalName = delta.getMovedFromPath().lastSegment(); - //Logger.getLogger().logInfo("Added event for " + originalName + " with flags " + flags); - // we get PRE_DELETE events on rename so retrieve this - ProjectRefactorMetadata originalMetadata = (ProjectRefactorMetadata) deletedProjectMetadata.remove(originalName); - // get the metadata for the new project - final ProjectRefactorMetadata newMetadata = new ProjectRefactorMetadata(project); - // note: only projects with ModuleCoreNature will have cached metadata - if (originalMetadata != null && OptionalRefactorHandler.getInstance().shouldRefactorRenamedProject(originalMetadata)) { - newMetadata.computeMetadata(originalMetadata.getProject()); - processRename(originalMetadata, newMetadata, delta); - // Rename all entries in the project dependency cache - //cache.replaceProject(originalProject, project); - } else { - // likely due to missing the pre-delete event, so set the original to a metadata based on new project - // and reset project to one based on original name - //Logger.getLogger().logWarning(RefactorResourceHandler.getString("pre_delete_not_received_for_renamed", new Object[]{originalName + " " + flags})); - } - } - //else if (kind == IResourceDelta.CHANGED || kind == IResourceDelta.ADDED) { - // (re)compute the dependencies - //cache.refreshDependencies(project); - //} - } - - /* - * Determines if the added project was renamed based on the IResourceDelta flags - */ - private boolean hasRenamedAddedFlags(final int flags) { - if ((flags & IResourceDelta.DESCRIPTION) > 0 - && (flags & IResourceDelta.MOVED_FROM) > 0) { - return true; - } - return false; - } - - /* - * Determines if the removed project was deleted based on the IResourceDelta flags - */ - private boolean hasDeletedRemovedFlags(final int flags) { - if ((flags & IResourceDelta.MOVED_TO) == 0 - && (flags & IResourceDelta.REPLACED) == 0) { - return true; - } - return false; - } - - /* - * Processes the renaming of a project. - */ - private void processRename(final ProjectRefactorMetadata originalMetadata, final ProjectRefactorMetadata newMetadata, final IResourceDelta delta) { - WorkspaceJob job = new WorkspaceJob("J2EEProjectRenameJob") { - public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { - final IDataModel dataModel = DataModelFactory.createDataModel(new ProjectRenameDataModelProvider()); - dataModel.setProperty(ProjectRefactoringDataModelProvider.PROJECT_METADATA, newMetadata); - dataModel.setProperty(ProjectRenameDataModelProvider.ORIGINAL_PROJECT_METADATA, originalMetadata); - dataModel.setProperty(ProjectRenameDataModelProvider.RESOURCE_DELTA, delta); - try { - dataModel.getDefaultOperation().execute(monitor, null); - } catch (Exception e) { - final String msg = RefactorResourceHandler.getString("error_updating_project_on_rename", new Object[]{originalMetadata.getProjectName()}); - Logger.getLogger().logError(msg); - Logger.getLogger().logError(e); - return new Status(Status.ERROR, J2EEPlugin.PLUGIN_ID, 0, msg, e); - } - return Status.OK_STATUS; - } - - public boolean belongsTo(final Object family) { - return PROJECT_REFACTORING_JOB_FAMILY.equals(family); - } - }; - // XXX note: might want to consider switching to a MultiRule for optimization - job.setRule(ResourcesPlugin.getWorkspace().getRoot()); - job.schedule(); - } - - /* - * Processes the deletion of a project. - */ - private void processDelete(final ProjectRefactorMetadata metadata) { - WorkspaceJob job = new WorkspaceJob("J2EEProjectDeleteJob") { - public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { - final IDataModel dataModel = DataModelFactory.createDataModel(new ProjectDeleteDataModelProvider()); - dataModel.setProperty(ProjectRefactoringDataModelProvider.PROJECT_METADATA, metadata); - try { - dataModel.getDefaultOperation().execute(monitor, null); - } catch (Exception e) { - final String msg = RefactorResourceHandler.getString("error_updating_project_on_delete", new Object[]{metadata.getProjectName()}); - Logger.getLogger().logError(msg); - Logger.getLogger().logError(e); - return new Status(Status.ERROR, J2EEPlugin.PLUGIN_ID, 0, msg, e); - } - return Status.OK_STATUS; - } - - public boolean belongsTo(final Object family) { - return PROJECT_REFACTORING_JOB_FAMILY.equals(family); - } - }; - // XXX note: might want to consider switching to a MultiRule for optimization - job.setRule(ResourcesPlugin.getWorkspace().getRoot()); - job.schedule(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/AbstractOptionalRefactorHandler.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/AbstractOptionalRefactorHandler.java deleted file mode 100644 index 167d10e46..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/AbstractOptionalRefactorHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.refactor.operations; - -/** - * Abstract implementation of IOptionalRefactorHandler. - */ -public abstract class AbstractOptionalRefactorHandler implements IOptionalRefactorHandler{ - - public AbstractOptionalRefactorHandler(){ - - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.refactor.operations.IOptionalRefactorHandler#shouldRefactorDeletedProject(org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata) - */ - public boolean shouldRefactorDeletedProject(final ProjectRefactorMetadata metadata) { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.refactor.operations.IOptionalRefactorHandler#shouldRefactorRenamedProject(org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata) - */ - public boolean shouldRefactorRenamedProject(final ProjectRefactorMetadata metadata) { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.refactor.operations.IOptionalRefactorHandler#shouldRefactorDependentProjectOnDelete(org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata, org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata) - */ - public boolean shouldRefactorDependentProjectOnDelete(final ProjectRefactorMetadata deletedMetadata, ProjectRefactorMetadata dependentMetadata) { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.refactor.operations.IOptionalRefactorHandler#shouldRefactorDependentProjectOnRename(org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata, org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata) - */ - public boolean shouldRefactorDependentProjectOnRename(final ProjectRefactorMetadata renamedMetadata, ProjectRefactorMetadata dependentMetadata) { - return true; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/CreateOptionalReferenceOp.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/CreateOptionalReferenceOp.java deleted file mode 100644 index 35b0fb979..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/CreateOptionalReferenceOp.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsOp; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * Extension of <code>CreateReferenceComponentsOp</code> that supports the optional creation of - * the component and project references. - */ -public class CreateOptionalReferenceOp extends CreateReferenceComponentsOp { - - public CreateOptionalReferenceOp(final IDataModel model) { - super(model); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - if (!validateEdit().isOK()) - return Status.CANCEL_STATUS; - if (model.getBooleanProperty(CreateOptionalReferenceOpDataModelProvider.CREATE_COMPONENT_REF)) { - addReferencedComponents(monitor); - } - if (model.getBooleanProperty(CreateOptionalReferenceOpDataModelProvider.CREATE_PROJECT_REF)) { - addProjectReferences(); - } - return OK_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/CreateOptionalReferenceOpDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/CreateOptionalReferenceOpDataModelProvider.java deleted file mode 100644 index 348517b80..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/CreateOptionalReferenceOpDataModelProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.Set; - -import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class CreateOptionalReferenceOpDataModelProvider extends CreateReferenceComponentsDataModelProvider { - - /** - * Property that holds a Boolen which controls whether the component reference is - * added/removed. - */ - public static final String CREATE_COMPONENT_REF = "IOptionalReferenceProperties.CREATE_COMPONENT_REF"; - /** - * Property that holds a Boolen which controls whether the .project reference is - * added/removed. - */ - public static final String CREATE_PROJECT_REF = "IOptionalReferenceProperties.CREATE_PROJECT_REF"; - - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getDefaultOperation() - */ - public IDataModelOperation getDefaultOperation() { - return new CreateOptionalReferenceOp(model); - } - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(CREATE_COMPONENT_REF); - propertyNames.add(CREATE_PROJECT_REF); - return propertyNames; - } - - public Object getDefaultProperty(String propertyName) { - if (CREATE_COMPONENT_REF.equals(propertyName) - ||CREATE_PROJECT_REF.equals(propertyName)) { - return Boolean.TRUE; - } - return super.getDefaultProperty(propertyName); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/IOptionalRefactorHandler.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/IOptionalRefactorHandler.java deleted file mode 100644 index 35f5f8dc2..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/IOptionalRefactorHandler.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.refactor.operations; - -/** - * Interface for classes that compute whether the automatically executed J2EE - * refactoring logic should be executed when a project is deleted or renamed. - */ -public interface IOptionalRefactorHandler { - - /** - * Called to determine if automatic refactoring logic should be executed - * for a given deleted project. The project will already have been deleted. - * this method is called. - * - * @param metadata Metadata for the deleted project. - * - * @return True to refactor, false to skip refactoring for all dependent projects. - */ - public boolean shouldRefactorDeletedProject(ProjectRefactorMetadata metadata); - - /** - * Called to determine if automatic refactoring logic should be executed - * for a given renamed project. The project will already have been be renamed when - * this method is called. - * - * @param metadata Metadata for the renamed project (pre-rename). - * - * @return True to refactor, false to skip refactoring for all dependent projects. - */ - public boolean shouldRefactorRenamedProject(ProjectRefactorMetadata metadata); - - /** - * Called to determine if automatic refactoring logic should be executed - * on the specified dependent project when a referenced project has been deleted. - * The referenced project will already have been deleted when this method is called. - * - * @param deletedMetadata Metadata for the deleted project. - * @param dependentMetadata Metadata for the dependent project. - * - * @return True to refactor the dependent project. - */ - public boolean shouldRefactorDependentProjectOnDelete(ProjectRefactorMetadata deletedMetadata, ProjectRefactorMetadata dependentMetadata); - - /** - * Called to determine if automatic refactoring logic should be executed - * on the specified dependent project when a referenced project has been renamed. - * The referenced project will already have been renamed when this method is called. - * - * @param renamedMetadata Metadata for the renamed project. - * @param dependentMetadata Metadata for the dependent project. - * - * @return True to refactor the dependent project. - */ - public boolean shouldRefactorDependentProjectOnRename(ProjectRefactorMetadata renamedMetadata, ProjectRefactorMetadata dependentMetadata); -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/OptionalRefactorHandler.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/OptionalRefactorHandler.java deleted file mode 100644 index ac3d7dd79..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/OptionalRefactorHandler.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.refactor.operations; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - -public class OptionalRefactorHandler implements IOptionalRefactorHandler{ - - private static final String EXTENSION_POINT = "optionalRefactorHandler"; //$NON-NLS-1$ - private static final String TAG_OPTIONAL_REFACTOR = "optionalRefactorHandler"; //$NON-NLS-1$ - private static final String ATT_CLASS = "class"; //$NON-NLS-1$ - - private static OptionalRefactorHandler instance = new OptionalRefactorHandler(); - private IOptionalRefactorHandler [] handlers = null; - - private OptionalRefactorHandler () { - SafeRunner.run(new ISafeRunnable() { - - public void handleException(Throwable exception) { - J2EEPlugin.logError(0, exception.getMessage(), exception); - } - - public void run() throws Exception { - OptionalRefactorHandlerRegistryReader reader = new OptionalRefactorHandlerRegistryReader(); - reader.readRegistry(); - handlers = reader.getHandlers(); - } - - }); - } - - public static OptionalRefactorHandler getInstance() { - return instance; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.refactor.operations.IOptionalRefactorHandler#shouldRefactorDeletedProject(org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata) - */ - public boolean shouldRefactorDeletedProject(final ProjectRefactorMetadata metadata) { - for(int i=0;i<handlers.length; i++){ - if(!handlers[i].shouldRefactorDeletedProject(metadata)){ - return false; - } - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.refactor.operations.IOptionalRefactorHandler#shouldRefactorRenamedProject(org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata) - */ - public boolean shouldRefactorRenamedProject(final ProjectRefactorMetadata metadata) { - for(int i=0;i<handlers.length; i++){ - if(!handlers[i].shouldRefactorRenamedProject(metadata)){ - return false; - } - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.refactor.operations.IOptionalRefactorHandler#shouldRefactorDependentProjectOnDelete(org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata, org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata) - */ - public boolean shouldRefactorDependentProjectOnDelete(final ProjectRefactorMetadata deletedMetadata, ProjectRefactorMetadata dependentMetadata) { - for(int i=0;i<handlers.length; i++){ - if(!handlers[i].shouldRefactorDependentProjectOnDelete(deletedMetadata, dependentMetadata)){ - return false; - } - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.refactor.operations.IOptionalRefactorHandler#shouldRefactorDependentProjectOnRename(org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata, org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata) - */ - public boolean shouldRefactorDependentProjectOnRename(final ProjectRefactorMetadata renamedMetadata, ProjectRefactorMetadata dependentMetadata) { - for(int i=0;i<handlers.length; i++){ - if(!handlers[i].shouldRefactorDependentProjectOnRename(renamedMetadata, dependentMetadata)){ - return false; - } - } - return true; - } - - - private class OptionalRefactorHandlerRegistryReader extends RegistryReader { - - private List handlers = new ArrayList(); - - public OptionalRefactorHandlerRegistryReader() { - super(J2EEPlugin.PLUGIN_ID, EXTENSION_POINT); - } - - /** - * @see org.eclipse.wst.common.frameworks.internal.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement) - */ - public boolean readElement(final IConfigurationElement element) { - if (TAG_OPTIONAL_REFACTOR.equals(element.getName())) { - - /* - * Because the only instance of this type is created from a static singleton field, and - * the registry is initialized in the constructor of this type, other threads cannot - * compete with readElement() for access to <i>descriptors</i> - */ - final IOptionalRefactorHandler[] handlerArray = new IOptionalRefactorHandler[1]; - - SafeRunner.run(new ISafeRunnable() { - - public void handleException(Throwable exception) { - J2EEPlugin.logError(0, exception.getMessage(), exception); - } - - public void run() throws Exception { - handlerArray[0] = (IOptionalRefactorHandler) element.createExecutableExtension(ATT_CLASS); - } - - }); - - handlers.add(handlerArray[0]); - return true; - } - return false; - } - - public IOptionalRefactorHandler [] getHandlers() { - IOptionalRefactorHandler [] handlersArray = new IOptionalRefactorHandler[handlers.size()]; - for(int i=0;i<handlersArray.length;i++){ - handlersArray[i] = (IOptionalRefactorHandler)handlers.get(i); - } - return handlersArray; - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectDeleteDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectDeleteDataModelProvider.java deleted file mode 100644 index d06abeefe..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectDeleteDataModelProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class ProjectDeleteDataModelProvider extends ProjectRefactoringDataModelProvider { - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getDefaultOperation() - */ - public IDataModelOperation getDefaultOperation() { - return new ProjectDeleteOperation(model); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectDeleteOperation.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectDeleteOperation.java deleted file mode 100644 index 88c157527..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectDeleteOperation.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * Subclass of <code>ProjectRefactorOperation</code> that contains deletion-specific logic. - */ -public class ProjectDeleteOperation extends ProjectRefactorOperation { - - public ProjectDeleteOperation(final IDataModel model) { - super(model); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.refactor.operations.ProjectRefactorOperation#updateProject(org.eclipse.jst.j2ee.internal.refactor.operations.ProjectRefactorMetadata) - */ - protected void updateProject(final ProjectRefactorMetadata refactoredMetadata) - throws ExecutionException { - } - - /** - * Updates the metadata for dependent projects - * @throws ExecutionException - */ - protected void updateDependentProjects(final ProjectRefactorMetadata refactoredMetadata, - final IProgressMonitor monitor) throws ExecutionException { - // If this is not an EAR, update metadata for dependent projects - // (not performing any refactoring for projects that depend on EAR's right now) - if (!refactoredMetadata.isEAR()) { - super.updateDependentProjects(refactoredMetadata, monitor); - } - // update any server instance refs to the refactored project - super.updateServerRefs(refactoredMetadata, null); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.refactor.operations.ProjectRefactorOperation#updateDependentEARProject(org.eclipse.jst.j2ee.internal.refactor.operations.ProjectRefactorMetadata, org.eclipse.jst.j2ee.internal.refactor.operations.ProjectRefactorMetadata) - */ - protected void updateDependentEARProject(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata) throws ExecutionException { - if (OptionalRefactorHandler.getInstance().shouldRefactorDependentProjectOnDelete(refactoredMetadata, dependentMetadata)) { - final IDataModel dataModel = createDataModel(dependentMetadata, refactoredMetadata, - new UpdateDependentEARonDeleteProvider()); - dataModel.getDefaultOperation().execute(null, null); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.refactor.operations.ProjectRefactorOperation#updateDependentModuleProject(org.eclipse.jst.j2ee.internal.refactor.operations.ProjectRefactorMetadata, org.eclipse.jst.j2ee.internal.refactor.operations.ProjectRefactorMetadata) - */ - protected void updateDependentModuleProject(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata) throws ExecutionException { - if (OptionalRefactorHandler.getInstance().shouldRefactorDependentProjectOnDelete(refactoredMetadata, dependentMetadata)) { - final IDataModel dataModel = createDataModel(dependentMetadata, refactoredMetadata, - new UpdateDependentModuleonDeleteProvider()); - dataModel.getDefaultOperation().execute(null, null); - } - } - - private IDataModel createDataModel(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata, - final AbstractDataModelProvider provider) { - final IDataModel dataModel = DataModelFactory.createDataModel(provider); - dataModel.setProperty(PROJECT_METADATA, refactoredMetadata); - dataModel.setProperty(DEPENDENT_PROJECT_METADATA, dependentMetadata); - return dataModel; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactorMetadata.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactorMetadata.java deleted file mode 100644 index c95b788a4..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactorMetadata.java +++ /dev/null @@ -1,364 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.model.IEARModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.ServerUtil; - -/** - * IDataModel object property stored under the property name - * {@link ProjectRefactoringDataModelProvider#PROJECT_METADATA}. - * - * Note: this class is not multi-thread safe. - */ -public class ProjectRefactorMetadata { - - public static int NON_CACHING = 0; - public static int REF_CACHING = 1; - public static int REFERER_CACHING = 2; - - private int _virtualCompCaching = NON_CACHING; - private final IProject _project; - private IServer[] servers; - private IVirtualComponent virtualComp = null; - private final List dependentMetadata = new ArrayList(); - private boolean javaNature; - private boolean moduleCoreNature; - private IModule module; - private Set facets = new HashSet(); - private final Map earToModuleURI = new HashMap(); - - public ProjectRefactorMetadata(final IProject project) { - _project = project; - } - - public ProjectRefactorMetadata(final IProject project, final int virtualCompCaching) { - this(project); - _virtualCompCaching = virtualCompCaching; - } - - public void computeMetadata() { - computeMetadata(_project); - } - public void computeMetadata(final IProject oldProject) { - try { - javaNature = _project.hasNature("org.eclipse.jdt.core.javanature"); //$NON-NLS-1$ - moduleCoreNature = ModuleCoreNature.getModuleCoreNature(_project) != null; - if (moduleCoreNature) { - if (_virtualCompCaching == REF_CACHING) { - virtualComp = new RefCachingVirtualComponent(ComponentCore.createComponent(_project)); - } else if (_virtualCompCaching == REFERER_CACHING) { - virtualComp = new RefererCachingVirtualComponent(ComponentCore.createComponent(_project)); - } else { - virtualComp = ComponentCore.createComponent(_project); - } - final IFacetedProject facetedProject = ProjectFacetsManager.create(_project); - module = ServerUtil.getModule(_project); - // XXX Due to resource change listener order uncertainty, the project associated with the - // module may be either the new (correct) project or the old project so need to try both - if (module == null && !_project.equals(oldProject)) { - module = ServerUtil.getModule(oldProject); - } - if (facetedProject != null) { - facets = facetedProject.getProjectFacets(); - } - } - } catch (CoreException ce) { - Logger.getLogger().logError(ce); - } - } - - public void computeServers() { - servers = ServerUtil.getServersByModule(module, null); - } - - public IServer[] getServers() { - return servers; - } - - public void computeDependentMetadata(final int virtualComponentCaching, final IProject[] dependentProjects) { - // get all referencing projects and execute the appropriate update operation for each one - ProjectRefactorMetadata metadata; - for (int i = 0; i < dependentProjects.length; i++) { - final IProject dependentProject = dependentProjects[i]; - if (dependentProject.exists() && dependentProject.isOpen()) { - metadata = new ProjectRefactorMetadata(dependentProjects[i], virtualComponentCaching); - metadata.computeMetadata(); - dependentMetadata.add(metadata); - if (metadata.isEAR()) { - final String uri = getModuleURI(dependentProject, virtualComp); - if (uri != null) { - earToModuleURI.put(dependentProject.getName(), uri); - } - } - } - } - } - - /** - * If this project is associated with the specified EAR project, retrieves the module URI for the dependency or null if - * it could not be retrieved. - * @param earName Name of the EAR project. - * @return Module URI for the project in the context of that EAR. - */ - public String getModuleURI(final String earName) { - return (String) earToModuleURI.get(earName); - } - - private String getModuleURI(final IProject earProject, final IVirtualComponent comp) { - IEARModelProvider earModelProvider = null; - earModelProvider = (IEARModelProvider) ModelProviderManager.getModelProvider(earProject); - if (earModelProvider != null) { - return earModelProvider.getModuleURI(comp); - } - return null; - } - - /** - * Retrieves the IProject that represents the referenced project. - */ - public IProject getProject() { - return _project; - } - - /** - * Retrieves the IModule for the project, or null if no IModule representation - * exists. - */ - public IModule getModule() { - return module; - } - - /** - * Retrieves the project name. - */ - public String getProjectName() { - return _project.getName(); - } - - /** - * Retrieves all ProjectRefactorMetadata for dependent projects. - * Will be empty if not computed. - */ - public ProjectRefactorMetadata[] getDependentMetadata() { - return (ProjectRefactorMetadata[]) dependentMetadata.toArray(new ProjectRefactorMetadata[dependentMetadata.size()]); - } - - /** - * Returns the IVirtualComponent for the project. - */ - public IVirtualComponent getVirtualComponent() { - return virtualComp; - } - - public boolean hasJavaNature() { - return javaNature; - } - - public boolean hasModuleCoreNature() { - return moduleCoreNature; - } - - public Set getProjectFacets() { - return facets; - } - - public boolean hasFacet(final IProjectFacet facet) { - for(Iterator itr = facets.iterator(); itr.hasNext();) { - final IProjectFacetVersion fv = (IProjectFacetVersion) itr.next(); - - if(fv.getProjectFacet() == facet) { - return true; - } - } - - return false; - } - - public boolean isEAR() { - return hasFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EAR_MODULE)); - } - - public boolean isEJB() { - return hasFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EJB_MODULE)); - } - - public boolean isWeb() { - return hasFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE)); - } - - public boolean isAppClient() { - return hasFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_APPCLIENT_MODULE)); - } - - public boolean isConnector() { - return hasFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_CONNECTOR_MODULE)); - } - - public boolean isUtility() { - return hasFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_UTILITY_MODULE)); - } - - public class CachingVirtualComponent implements IVirtualComponent { - protected final IVirtualComponent _comp; - protected boolean _caching = true; - public CachingVirtualComponent(final IVirtualComponent comp) { - _comp = comp; - } - public void addReferences(IVirtualReference[] references) { - _comp.addReferences(references); - } - public void create(int updateFlags, IProgressMonitor aMonitor) throws CoreException { - _comp.create(updateFlags, aMonitor); - } - public boolean exists() { - return _comp.exists(); - } - public IVirtualComponent getComponent() { - return _comp.getComponent(); - } - public Properties getMetaProperties() { - return _comp.getMetaProperties(); - } - public IPath[] getMetaResources() { - return _comp.getMetaResources(); - } - public String getName() { - return _comp.getName(); - } - public String getDeployedName() { - return _comp.getDeployedName(); - } - public IProject getProject() { - return _comp.getProject(); - } - public IVirtualReference getReference(String aComponentName) { - return _comp.getReference(aComponentName); - } - public IVirtualReference[] getReferences() { - return _comp.getReferences(); - } - public void setCaching(boolean caching) { - _caching = caching; - } - public IVirtualComponent[] getReferencingComponents() { - return _comp.getReferencingComponents(); - } - public IVirtualFolder getRootFolder() { - return _comp.getRootFolder(); - } - public boolean isBinary() { - return _comp.isBinary(); - } - public void setMetaProperties(Properties properties) { - _comp.setMetaProperties(properties); - } - public void setMetaProperty(String name, String value) { - _comp.setMetaProperty(name, value); - } - public void setMetaResources(IPath[] theMetaResourcePaths) { - _comp.setMetaResources(theMetaResourcePaths); - } - public void setReferences(IVirtualReference[] theReferences) { - _comp.setReferences(theReferences); - } - public Object getAdapter(Class adapter) { - return _comp.getAdapter(adapter); - } - - public boolean equals(Object o) { - return _comp.equals(o); - } - - public int hashCode() { - return _comp.hashCode(); - } - - public String toString() { - return _comp.toString(); - } - - public void removeReference(IVirtualReference aReference) { - ((VirtualComponent)_comp).removeReference(aReference); - } - } - - public class RefCachingVirtualComponent extends CachingVirtualComponent { - private IVirtualReference[] cachedRefs; - public RefCachingVirtualComponent(final IVirtualComponent comp) { - super(comp); - cachedRefs = ((VirtualComponent)comp).getAllReferences(); - } - - public IVirtualReference getReference(String aComponentName) { - IVirtualReference[] refs = getReferences(); - for (int i = 0; i < refs.length; i++) { - IVirtualReference reference = refs[i]; - if (reference == null || reference.getReferencedComponent() == null) { - return null; - } - if (reference.getReferencedComponent().getName().equals(aComponentName)) - return reference; - } - return null; - } - public IVirtualReference[] getReferences() { - if (_caching) { - return cachedRefs; - } - return super.getReferences(); - } - } - - public class RefererCachingVirtualComponent extends CachingVirtualComponent { - private IVirtualComponent[] cachedReferers; - public RefererCachingVirtualComponent(final IVirtualComponent comp) { - super(comp); - cachedReferers = comp.getReferencingComponents(); - } - - public IVirtualComponent[] getReferencingComponents() { - if (_caching) { - return cachedReferers; - } - return _comp.getReferencingComponents(); - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactorOperation.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactorOperation.java deleted file mode 100644 index 72a9fd2f3..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactorOperation.java +++ /dev/null @@ -1,199 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.j2ee.refactor.RefactorResourceHandler; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.IModuleType; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.IServerWorkingCopy; -import org.eclipse.wst.server.core.ServerUtil; -import org.eclipse.wst.server.core.internal.DeletedModule; -import org.eclipse.wst.server.core.internal.Module; - -/** - * Abstract base class for project refactoring operations. - */ -public abstract class ProjectRefactorOperation extends AbstractDataModelOperation - implements ProjectRefactoringProperties { - - /** - * Creates a new refactoring operation for the specified data model. - * @param model The data model. - */ - public ProjectRefactorOperation(final IDataModel model) { - super(model); - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - try { - final ProjectRefactorMetadata refactoredMetadata = getProjectMetadata(); - - // Update this project's metadata - if (refactoredMetadata.hasModuleCoreNature()) { - updateProject(refactoredMetadata); - } - - updateDependentProjects(refactoredMetadata, monitor); - } finally { - if (monitor != null) { - monitor.done(); - } - } - - return Status.OK_STATUS; - } - - /** - * Updates the project's own metadata. - */ - protected abstract void updateProject(final ProjectRefactorMetadata refactoredMetadata) - throws ExecutionException; - - /** - * Updates the metadata for dependent projects - * @throws ExecutionException - */ - protected void updateDependentProjects(final ProjectRefactorMetadata refactoredMetadata, - final IProgressMonitor monitor) throws ExecutionException { - // get the metadata for all dependent projects - final ProjectRefactorMetadata[] dependentMetadata = refactoredMetadata.getDependentMetadata(); - if (monitor != null) { - monitor.beginTask(RefactorResourceHandler.getString("task_name"), dependentMetadata.length); - } - ProjectRefactorMetadata metadata; - for (int i = 0; i < dependentMetadata.length; i++) { - metadata = dependentMetadata[i]; - // if the project is an EAR, execute the update operation created by the - // DependentEARUpdateProvider; if the project is a non-EAR project with the - // module core nature, execute the appropriate update - if (metadata.isEAR()) { - updateDependentEARProject(metadata, refactoredMetadata); - } else if (metadata.hasModuleCoreNature()) { - updateDependentModuleProject(metadata, refactoredMetadata); - } - if (monitor != null) { - monitor.worked(1); - } - } - } - - /** - * Updates any server references. - */ - protected void updateServerRefs(final ProjectRefactorMetadata originalMetadata, - final ProjectRefactorMetadata newMetadata) - throws ExecutionException { - final IModule originalModule = originalMetadata.getModule(); - if (originalModule == null) { - // no module for the original project, so return - return; - } - // Need to replace the original module with a DeletedModule - final IModule[] toRemove = new IModule[1]; - toRemove[0] = new DeletedModule(originalModule.getId(), originalModule.getName(), - originalModule.getModuleType()); - - IModule newModule = null; - IModule[] toAdd = new IModule[0]; - if (newMetadata != null) { - newModule = newMetadata.getModule(); - if (newModule == null) { - // no module for the new project, so return - return; - } - // XXX Due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=124292, - // need to ensure that the IModule for the renamed project has the - // id and name for the renamed IProject and not the old name - final IProject newProject = newMetadata.getProject(); - final IModuleType moduleType = newModule.getModuleType(); - ((Module) newModule).getModuleFactory().getModules(); - newModule = new Module(((Module) newModule).getModuleFactory(), newProject.getName(), newProject.getName(), moduleType.getId(), - moduleType.getVersion(), newProject); - toAdd = new IModule[]{newModule}; - } - - final IServer[] server = originalMetadata.getServers(); - IServerWorkingCopy wc = null; - for (int i = 0; i < server.length; i++) { - try { - wc = server[i].createWorkingCopy(); - List list = Arrays.asList(server[i].getModules()); - if (list.contains(originalModule)) { - // remove the original and potentially add a new - ServerUtil.modifyModules(wc, toAdd, toRemove, null); - } - } catch (CoreException ce) { - throw new ExecutionException(RefactorResourceHandler.getString("error_updating_server", - new Object[]{server[i].getId(), originalMetadata.getProjectName()}), ce); - } finally { - try { - wc.saveAll(true, null); - } catch (CoreException ce) { - throw new ExecutionException(RefactorResourceHandler.getString("error_updating_server", - new Object[]{server[i].getId(), originalMetadata.getProjectName()}), ce); - } - } - } - } - - /** - * Updates the dependent EAR project to account for the refactoring of the referenced project. - */ - protected abstract void updateDependentEARProject(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata) throws ExecutionException; - - /** - * Updates the dependent module project to account for the refactoring of the referenced project. - */ - protected abstract void updateDependentModuleProject(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata) throws ExecutionException; - - /** - * Retrieves the ProjectRefactorMetadata property. - */ - protected ProjectRefactorMetadata getProjectMetadata() { - return (ProjectRefactorMetadata) model.getProperty(PROJECT_METADATA); - } - - /** - * Override to disable redo support - * @see org.eclipse.core.commands.operations.IUndoableOperation#canRedo() - */ - public boolean canRedo() { - return false; - } - - /** - * Override to disable undo support. - * @see org.eclipse.core.commands.operations.IUndoableOperation#canUndo() - */ - public boolean canUndo() { - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactoringDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactoringDataModelProvider.java deleted file mode 100644 index 53673ab82..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactoringDataModelProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.refactor.RefactorResourceHandler; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; - -public abstract class ProjectRefactoringDataModelProvider extends - AbstractDataModelProvider implements ProjectRefactoringProperties { - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getPropertyNames() - */ - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PROJECT_METADATA); - return propertyNames; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#validate(java.lang.String) - */ - public IStatus validate(String propertyName) { - Iterator i = getPropertyNames().iterator(); - boolean valid = false; - while (i.hasNext()) { - if (i.next().equals(propertyName)) { - valid = true; - break; - } - } - if (!valid) { - return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, IStatus.OK, - RefactorResourceHandler.getString("invalid_property_name", new Object[]{propertyName}), null); - } - return OK_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactoringProperties.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactoringProperties.java deleted file mode 100644 index 53bf78dba..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRefactoringProperties.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -public interface ProjectRefactoringProperties { - - /** - * Name of the property that holds an instance of ProjectRefactorMetadata for the - * refactored project. - */ - public static final String PROJECT_METADATA = "ProjectRefactoringProperties.PROJECT_METADATA"; //$NON-NLS-1$ - - /** - * Name of the property that holds an instance of ProjectRefactorMetadata for the original version of - * the refactored project. - */ - public static final String ORIGINAL_PROJECT_METADATA = "ProjectRefactoringProperties.ORIGINAL_PROJECT_METADATA"; //$NON-NLS-1$ - - /** - * Name of the property that holds an instance of ProjectRefactorMetadata for the - * dependent project. - */ - public static final String DEPENDENT_PROJECT_METADATA = "ProjectRefactoringProperties.DEPENDENT_PROJECT_METADATA"; //$NON-NLS-1$ - - /** - * Name of the property that holds an instance of the IResourceDelta - */ - public static final String RESOURCE_DELTA= "ProjectRefactoringProperties.RESOURCE_DELTA"; //$NON-NLS-1$ - - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRenameDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRenameDataModelProvider.java deleted file mode 100644 index 1fe5fff13..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRenameDataModelProvider.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.Set; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class ProjectRenameDataModelProvider extends ProjectRefactoringDataModelProvider - implements ProjectRefactoringProperties { - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getPropertyNames() - */ - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(ORIGINAL_PROJECT_METADATA); - propertyNames.add(RESOURCE_DELTA); - return propertyNames; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getDefaultOperation() - */ - public IDataModelOperation getDefaultOperation() { - return new ProjectRenameOperation(model); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRenameOperation.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRenameOperation.java deleted file mode 100644 index 7b924c4c7..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/ProjectRenameOperation.java +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005-2007 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jst.j2ee.common.CompatibilityDescriptionGroup; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.model.IModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.jst.javaee.application.Application; -import org.eclipse.jst.javaee.applicationclient.ApplicationClient; -import org.eclipse.jst.javaee.core.DisplayName; -import org.eclipse.jst.javaee.core.JavaeeFactory; -import org.eclipse.jst.javaee.ejb.EJBJar; -import org.eclipse.jst.javaee.web.WebApp; -import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory; -import org.eclipse.wst.common.componentcore.internal.Property; -import org.eclipse.wst.common.componentcore.internal.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate; - -public class ProjectRenameOperation extends ProjectRefactorOperation { - - public ProjectRenameOperation(final IDataModel model) { - super(model); - } - - /** - * Override to return the pre-rename metadata. - */ - protected ProjectRefactorMetadata getProjectMetadata() { - return (ProjectRefactorMetadata) model.getProperty(ProjectRenameDataModelProvider.ORIGINAL_PROJECT_METADATA); - } - - /** - * Updates the project's own metadata. - */ - protected void updateProject(final ProjectRefactorMetadata originalMetadata) - throws ExecutionException { - - // Update the project's .component file - final ProjectRefactorMetadata refactoredMetadata = super.getProjectMetadata(); - final String oldProjectName = originalMetadata.getProjectName(); - final String newProjectName = refactoredMetadata.getProjectName(); - StructureEdit core = null; - try { - core = StructureEdit.getStructureEditForWrite(refactoredMetadata.getProject()); - WorkbenchComponent component = core.getComponent(); - // if the deploy-name had been set to the old project name, update it to - // the new project name - if (component.getName().equals(originalMetadata.getProjectName())) { - component.setName(refactoredMetadata.getProjectName()); - } - // if there is a context-root property that had been set to the old project name, update it to - // the new project name - List propList = component.getProperties(); - for (int i = 0; i < propList.size(); i++) { - final Property prop = (Property) propList.get(i); - if (prop.getName().equals("context-root") && prop.getValue().equals(oldProjectName)) { - propList.remove(i); - final Property newProp = ComponentcoreFactory.eINSTANCE.createProperty(); - newProp.setName("context-root"); - newProp.setValue(newProjectName); - propList.add(newProp); - break; - } - } - } finally { - if(core != null) { - core.saveIfNecessary(null); - core.dispose(); - } - } - - // if the deploy-name equals the old project name, update it in the module-specific deployment descriptor - final IProject refactoredProject = refactoredMetadata.getProject(); - if (J2EEProjectUtilities.isUtilityProject(refactoredProject)) { - // skip if a utility project (will not have a ModelProvider and checking logs an error - return; - } - final IModelProvider model = (IModelProvider)ModelProviderManager.getModelProvider(refactoredProject); - if (model != null) { - model.modify(new Runnable() { - public void run() { - final Object modelObject = model.getModelObject(); - if (modelObject instanceof CompatibilityDescriptionGroup) { - CompatibilityDescriptionGroup cdg = (CompatibilityDescriptionGroup) modelObject; - if (cdg.getDisplayName().equals(oldProjectName)) { - cdg.setDisplayName(newProjectName); - } - } else { - DisplayName dn = JavaeeFactory.eINSTANCE.createDisplayName(); - dn.setValue(newProjectName); - List displayNames = null; - if (modelObject instanceof Application) { - displayNames = ((Application) modelObject).getDisplayNames(); - } else if (modelObject instanceof WebApp) { - displayNames = ((WebApp)modelObject).getDisplayNames(); - } else if (modelObject instanceof ApplicationClient) { - displayNames = ((ApplicationClient)modelObject).getDisplayNames(); - } else if (modelObject instanceof EJBJar) { - displayNames = ((EJBJar)modelObject).getDisplayNames(); - } - if (displayNames != null && !displayNames.isEmpty()) { - DisplayName oldDN = (DisplayName) displayNames.get(0); - if (oldDN.getValue().equals(oldProjectName)) { - displayNames.set(0, dn); - } - } - } - } - }, null); - } - } - - /** - * Updates the metadata for dependent projects - * @throws ExecutionException - */ - protected void updateDependentProjects(final ProjectRefactorMetadata originalMetadata, - final IProgressMonitor monitor) throws ExecutionException { - // If this is not an EAR, update metadata for dependent projects - // (not performing any refactoring for projects that depend on EAR's right now) - if (!originalMetadata.isEAR()) { - super.updateDependentProjects(originalMetadata, monitor); - } - // update any server instance refs to the refactored project - final ProjectRefactorMetadata refactoredMetadata = super.getProjectMetadata(); - ProjectModuleFactoryDelegate.handleGlobalProjectChange(refactoredMetadata.getProject(), - (IResourceDelta) model.getProperty(ProjectRenameDataModelProvider.RESOURCE_DELTA)); - super.updateServerRefs(originalMetadata, refactoredMetadata); - } - - /** - * Updates the dependent EAR project to account for the renaming of the referenced project. - */ - protected void updateDependentEARProject(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata originalMetadata) throws ExecutionException { - if (OptionalRefactorHandler.getInstance().shouldRefactorDependentProjectOnRename(originalMetadata, dependentMetadata)) { - final IDataModel dataModel = createDataModel(dependentMetadata, originalMetadata, - new UpdateDependentEARonRenameProvider()); - dataModel.getDefaultOperation().execute(null, null); - } - } - - /** - * Updates the dependent module project to account for the renaming of the referenced project. - */ - protected void updateDependentModuleProject(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata originalMetadata) throws ExecutionException { - if (OptionalRefactorHandler.getInstance().shouldRefactorDependentProjectOnRename(originalMetadata, dependentMetadata)) { - final IDataModel dataModel = createDataModel(dependentMetadata, originalMetadata, - new UpdateDependentModuleonRenameProvider()); - dataModel.getDefaultOperation().execute(null, null); - } - } - - private IDataModel createDataModel(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata originalMetadata, - final AbstractDataModelProvider provider) { - final ProjectRefactorMetadata refactoredMetadata = super.getProjectMetadata(); - final IDataModel dataModel = DataModelFactory.createDataModel(provider); - dataModel.setProperty(PROJECT_METADATA, refactoredMetadata); - dataModel.setProperty(DEPENDENT_PROJECT_METADATA, dependentMetadata); - dataModel.setProperty(ORIGINAL_PROJECT_METADATA, originalMetadata); - return dataModel; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/RemoveDeletedComponentFromEARDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/RemoveDeletedComponentFromEARDataModelProvider.java deleted file mode 100644 index 31596d0d8..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/RemoveDeletedComponentFromEARDataModelProvider.java +++ /dev/null @@ -1,56 +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.j2ee.refactor.operations; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class RemoveDeletedComponentFromEARDataModelProvider extends RemoveComponentFromEnterpriseApplicationDataModelProvider { - - private final ProjectRefactorMetadata _metadata; - public RemoveDeletedComponentFromEARDataModelProvider(final ProjectRefactorMetadata metadata) { - super(); - _metadata = metadata; - } - - public Object getDefaultProperty(String propertyName) { - if (TARGET_COMPONENTS_TO_URI_MAP.equals(propertyName)) { - Map map = new HashMap(); - List components = (List) getProperty(TARGET_COMPONENT_LIST); - for (int i = 0; i < components.size(); i++) { - IVirtualComponent component = (IVirtualComponent) components.get(i); -// IProject project = component.getProject(); - String name = component.getName(); - if (_metadata.isWeb()) { - name += ".war"; //$NON-NLS-1$ - } else if (_metadata.isEJB()) { - name += ".jar"; //$NON-NLS-1$ - } else if (_metadata.isAppClient()) { - name += ".jar"; //$NON-NLS-1$ - } else if (_metadata.isConnector()) { - name += ".rar"; //$NON-NLS-1$ - } - map.put(component, name); - } - return map; - } - return super.getDefaultProperty(propertyName); - } - - public IDataModelOperation getDefaultOperation() { - return new RemoveDeletedComponentFromEAROperation(model); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/RemoveDeletedComponentFromEAROperation.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/RemoveDeletedComponentFromEAROperation.java deleted file mode 100644 index a76c0fae3..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/RemoveDeletedComponentFromEAROperation.java +++ /dev/null @@ -1,34 +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.j2ee.refactor.operations; - -import java.util.Map; - -import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationOperation; -import org.eclipse.jst.j2ee.model.IEARModelProvider; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class RemoveDeletedComponentFromEAROperation extends RemoveComponentFromEnterpriseApplicationOperation { - - public RemoveDeletedComponentFromEAROperation(IDataModel model) { - super(model); - } - - protected String getModuleURI(final IEARModelProvider earModel, final IVirtualComponent targetComponent) { - String uri = earModel.getModuleURI(targetComponent); - if (uri == null) { - Map compToURI = (Map) model.getProperty(RemoveDeletedComponentFromEARDataModelProvider.TARGET_COMPONENTS_TO_URI_MAP); - uri = (String) compToURI.get(targetComponent); - } - return uri; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonDeleteOp.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonDeleteOp.java deleted file mode 100644 index 55a660a79..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonDeleteOp.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.List; -import java.util.Map; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Status; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * Subclass of <code>UpdateDependentProjectOp</code> that updates a dependent - * EAR project when one of the referenced projects has been deleted. - */ -public class UpdateDependentEARonDeleteOp extends UpdateDependentProjectOp { - - /** - * Creates a new refactoring operation for the specified data model. - * @param model The data model. - */ - public UpdateDependentEARonDeleteOp(final IDataModel model) { - super(model); - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - final ProjectRefactorMetadata dependentMetadata = (ProjectRefactorMetadata) model.getProperty(DEPENDENT_PROJECT_METADATA); - final ProjectRefactorMetadata refactoredMetadata = (ProjectRefactorMetadata) model.getProperty(PROJECT_METADATA); - removeEARDependency(dependentMetadata, refactoredMetadata); - return Status.OK_STATUS; - } - - /** - * Updates the dependent EAR project to account for the deletion of the referenced project. - */ - protected static void removeEARDependency(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata) throws ExecutionException { - - // create IVirtualComponents for the EAR and the refactored project - final IVirtualComponent earComp = dependentMetadata.getVirtualComponent(); - final IVirtualComponent refactoredComp = refactoredMetadata.getVirtualComponent(); - final IProgressMonitor monitor = new NullProgressMonitor(); - - // remove the dependency on the deleted project - if (refactoredComp != null) { - final IDataModel model = DataModelFactory.createDataModel(new RemoveDeletedComponentFromEARDataModelProvider(refactoredMetadata)); - model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComp); - final List modHandlesList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - modHandlesList.add(refactoredComp); - model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modHandlesList); - final String moduleURI = refactoredMetadata.getModuleURI(dependentMetadata.getProjectName()); - if (moduleURI != null) { - final Map compToURI = (Map) model.getProperty(RemoveDeletedComponentFromEARDataModelProvider.TARGET_COMPONENTS_TO_URI_MAP); - compToURI.put(refactoredComp, moduleURI); - model.setProperty(RemoveDeletedComponentFromEARDataModelProvider.TARGET_COMPONENTS_TO_URI_MAP, compToURI); - } - model.getDefaultOperation().execute(monitor, null); - } - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonDeleteProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonDeleteProvider.java deleted file mode 100644 index 1a4f0ca5a..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonDeleteProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class UpdateDependentEARonDeleteProvider extends UpdateDependentProjectDataModelProvider - implements ProjectRefactoringProperties { - - public IDataModelOperation getDefaultOperation() { - return new UpdateDependentEARonDeleteOp(model); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonRenameOp.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonRenameOp.java deleted file mode 100644 index de852dd24..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonRenameOp.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider; -import org.eclipse.jst.j2ee.project.facet.IJavaProjectMigrationDataModelProperties; -import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationDataModelProvider; -import org.eclipse.jst.j2ee.refactor.RefactorResourceHandler; -import org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata.RefCachingVirtualComponent; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * Subclass of <code>UpdateDependentProjectOp</code> that updates a dependent - * EAR project when a referenced project has been renamed. - */ -public class UpdateDependentEARonRenameOp extends UpdateDependentProjectOp { - - public UpdateDependentEARonRenameOp(final IDataModel model) { - super(model); - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - - final ProjectRefactorMetadata dependentMetadata = (ProjectRefactorMetadata) model.getProperty(DEPENDENT_PROJECT_METADATA); - final ProjectRefactorMetadata originalMetadata = (ProjectRefactorMetadata) model.getProperty(ORIGINAL_PROJECT_METADATA); - final ProjectRefactorMetadata refactoredMetadata = (ProjectRefactorMetadata) model.getProperty(PROJECT_METADATA); - - // create IVirtualComponents for the EAR and the refactored project - final RefCachingVirtualComponent earComp = (RefCachingVirtualComponent) dependentMetadata.getVirtualComponent(); - final IVirtualComponent refactoredComp = refactoredMetadata.getVirtualComponent(); - - if (refactoredComp == null) { - return Status.OK_STATUS; - } - - boolean hadModuleReference = hadReference(dependentMetadata, originalMetadata) != null; - boolean hadProjectReference = hadProjectReference(dependentMetadata, originalMetadata); - - // first, remove the dependency on the old project name via the - // ProjectDeleteOperation - UpdateDependentEARonDeleteOp.removeEARDependency(dependentMetadata, originalMetadata); - - // change to use not use caching - earComp.setCaching(false); - - // add back a dependency on the renamed project - if (refactoredMetadata.hasModuleCoreNature()) { - // the refactored project was a module project - final IDataModel dm = DataModelFactory.createDataModel(new AddComponentToEnterpriseApplicationDataModelProvider()); - dm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComp); - final List depList = new ArrayList(); - depList.add(refactoredComp); - dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, depList); - dm.getDefaultOperation().execute(monitor, null); - } else if (refactoredMetadata.hasJavaNature()) { - // the refactored project was a plain java project - final IDataModel migrationdm = DataModelFactory.createDataModel(new JavaProjectMigrationDataModelProvider()); - migrationdm.setProperty(IJavaProjectMigrationDataModelProperties.PROJECT_NAME, refactoredMetadata.getProjectName()); - migrationdm.getDefaultOperation().execute(new NullProgressMonitor(), null); - final IDataModel refdm = DataModelFactory.createDataModel(new CreateOptionalReferenceOpDataModelProvider()); - final List targetCompList = (List) refdm.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - targetCompList.add(refactoredComp); - refdm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComp); - refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, targetCompList); - refdm.setBooleanProperty(CreateOptionalReferenceOpDataModelProvider.CREATE_COMPONENT_REF,hadModuleReference); - refdm.setBooleanProperty(CreateOptionalReferenceOpDataModelProvider.CREATE_PROJECT_REF,hadProjectReference); - refdm.getDefaultOperation().execute(monitor, null); - } else { - throw new ExecutionException(RefactorResourceHandler.getString("missing_natures"), null); - } - return Status.OK_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonRenameProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonRenameProvider.java deleted file mode 100644 index e9abc1bca..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentEARonRenameProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class UpdateDependentEARonRenameProvider extends UpdateDependentProjectRenameDataModelProvider - implements ProjectRefactoringProperties { - - public IDataModelOperation getDefaultOperation() { - return new UpdateDependentEARonRenameOp(model); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonDeleteOp.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonDeleteOp.java deleted file mode 100644 index de1ab7f09..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonDeleteOp.java +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.jar.Manifest; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProperties; -import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.refactor.RefactorResourceHandler; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.internal.operation.RemoveReferenceComponentsDataModelProvider; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * Subclass of <code>UpdateDependentProjectOp</code> that updates a dependent - * module project when one of the referenced projects has been deleted. - */ -public class UpdateDependentModuleonDeleteOp extends UpdateDependentProjectOp { - - /** - * Creates a new refactoring operation for the specified data model. - * @param model The data model. - */ - public UpdateDependentModuleonDeleteOp(final IDataModel model) { - super(model); - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - final ProjectRefactorMetadata dependentMetadata = (ProjectRefactorMetadata) model.getProperty(DEPENDENT_PROJECT_METADATA); - final ProjectRefactorMetadata refactoredMetadata = (ProjectRefactorMetadata) model.getProperty(PROJECT_METADATA); - removeModuleDependency(dependentMetadata, refactoredMetadata); - return Status.OK_STATUS; - } - - /** - * Updates the dependent module project to account for the deletion of the referenced project. - */ - protected static void removeModuleDependency(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata) throws ExecutionException { - - // create IVirtualComponents for the dependent and the refactored project - final IVirtualComponent dependentComp = dependentMetadata.getVirtualComponent(); - final IVirtualComponent refactoredComp = refactoredMetadata.getVirtualComponent(); - final IProgressMonitor monitor = new NullProgressMonitor(); - - // Does the dependent project have a .component reference on the refactored project? - final IVirtualReference ref = hadReference(dependentMetadata, refactoredMetadata); - final boolean webLibDep = hasWebLibDependency(ref); - - // remove the component reference on the deleted project - if (refactoredComp != null) { - final IDataModel model = DataModelFactory.createDataModel(new RemoveReferenceComponentsDataModelProvider()); - model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, dependentComp); - final List modHandlesList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - modHandlesList.add(refactoredComp); - model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modHandlesList); - if (webLibDep) { - model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH,"/WEB-INF/lib"); //$NON-NLS-1$ - } - model.getDefaultOperation().execute(monitor, null); - } - - // update the manifest - if (!webLibDep) { - updateManifestDependency(refactoredMetadata, dependentMetadata, true); - } - } - - protected static void updateManifestDependency(final ProjectRefactorMetadata refactoredMetadata, - final ProjectRefactorMetadata dependentMetadata, final boolean remove) throws ExecutionException { - final IVirtualComponent dependentComp = dependentMetadata.getVirtualComponent(); - IProject project= dependentComp.getProject(); - if(project.isAccessible()){ - final String dependentProjName = dependentMetadata.getProjectName(); - final String refactoredProjName = refactoredMetadata.getProjectName(); - final IVirtualFile vf = dependentComp.getRootFolder().getFile(new Path(J2EEConstants.MANIFEST_URI) ); - final IFile manifestmf = vf.getUnderlyingFile(); - // adding this check for https://bugs.eclipse.org/bugs/show_bug.cgi?id=170074 - // (some adopters have non-jst.ear module projects that are missing manifests) - if (!manifestmf.exists()) { - return; - } - final IProgressMonitor monitor = new NullProgressMonitor(); - final IDataModel updateManifestDataModel = DataModelFactory.createDataModel(new UpdateManifestDataModelProvider()); - updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.PROJECT_NAME, dependentProjName); - updateManifestDataModel.setBooleanProperty(UpdateManifestDataModelProperties.MERGE, false); - updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.MANIFEST_FILE, manifestmf); - final ArchiveManifest manifest = getArchiveManifest(manifestmf); - String[] cp = manifest.getClassPathTokenized(); - List cpList = new ArrayList(); - String newCp = refactoredProjName + ".jar";//$NON-NLS-1$ - for (int i = 0; i < cp.length; i++) { - if (!cp[i].equals(newCp)) { - cpList.add(cp[i]); - } - } - if (!remove) { - cpList.add(newCp); - } - updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.JAR_LIST, cpList); - updateManifestDataModel.getDefaultOperation().execute(monitor, null ); - } - } - - private static ArchiveManifest getArchiveManifest(final IFile manifestFile) throws ExecutionException { - InputStream in = null; - try { - in = manifestFile.getContents(); - ArchiveManifest mf = new ArchiveManifestImpl(new Manifest(in)); - return mf; - } catch (CoreException ce) { - throw new ExecutionException(RefactorResourceHandler.getString("error_reading_manifest"), ce); - } catch (IOException io) { - throw new ExecutionException(RefactorResourceHandler.getString("error_reading_manifest"), io); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException weTried) { - //Ignore - } - } - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonDeleteProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonDeleteProvider.java deleted file mode 100644 index c3365c6fc..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonDeleteProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class UpdateDependentModuleonDeleteProvider extends UpdateDependentProjectDataModelProvider - implements ProjectRefactoringProperties { - - public IDataModelOperation getDefaultOperation() { - return new UpdateDependentModuleonDeleteOp(model); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonRenameOp.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonRenameOp.java deleted file mode 100644 index 422fcb5db..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonRenameOp.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata.RefCachingVirtualComponent; -import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * Subclass of <code>UpdateDependentProjectOp</code> that updates a dependent - * module project when a referenced project has been renamed. - */ -public class UpdateDependentModuleonRenameOp extends UpdateDependentProjectOp { - - public UpdateDependentModuleonRenameOp(final IDataModel model) { - super(model); - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - - final ProjectRefactorMetadata dependentMetadata = (ProjectRefactorMetadata) model.getProperty(DEPENDENT_PROJECT_METADATA); - final ProjectRefactorMetadata originalMetadata = (ProjectRefactorMetadata) model.getProperty(ORIGINAL_PROJECT_METADATA); - final ProjectRefactorMetadata refactoredMetadata = (ProjectRefactorMetadata) model.getProperty(PROJECT_METADATA); - - // create IVirtualComponents for the dependent project and the refactored project - final RefCachingVirtualComponent dependentComp = (RefCachingVirtualComponent) dependentMetadata.getVirtualComponent(); - final IVirtualComponent refactoredComp = refactoredMetadata.getVirtualComponent(); - - // Does the dependent project have a component and/or project references on the refactored project? - final IVirtualReference ref = hadReference(dependentMetadata, originalMetadata); - boolean hadModuleRef = ref != null; - boolean hadProjectRef = hadProjectReference(dependentMetadata, originalMetadata); - final boolean webLibDep = hasWebLibDependency(ref); - - // first, remove the dependency on the old project name via the - // ProjectDeleteOperation - UpdateDependentModuleonDeleteOp.removeModuleDependency(dependentMetadata, originalMetadata); - - // change to use not use caching - dependentComp.setCaching(false); - - // add a reference to the renamed project (need to be adding either a component or project ref) - if (refactoredComp != null && (hadModuleRef || hadProjectRef)) { - final IDataModel refdm = DataModelFactory.createDataModel(new CreateOptionalReferenceOpDataModelProvider()); - final List targetCompList = (List) refdm.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST); - targetCompList.add(refactoredComp); - refdm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, dependentComp); - refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, targetCompList); - if (webLibDep) { - refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH,"/WEB-INF/lib"); //$NON-NLS-1$ - } - refdm.setBooleanProperty(CreateOptionalReferenceOpDataModelProvider.CREATE_COMPONENT_REF,hadModuleRef); - refdm.setBooleanProperty(CreateOptionalReferenceOpDataModelProvider.CREATE_PROJECT_REF,hadProjectRef); - refdm.getDefaultOperation().execute(monitor, null); - } - - // update the manifest, unless this was a web library dependency - if (!webLibDep) { - UpdateDependentModuleonDeleteOp.updateManifestDependency(refactoredMetadata, dependentMetadata, false); - } - - return Status.OK_STATUS; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonRenameProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonRenameProvider.java deleted file mode 100644 index 291b40c2d..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentModuleonRenameProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; - -public class UpdateDependentModuleonRenameProvider extends UpdateDependentProjectRenameDataModelProvider - implements ProjectRefactoringProperties { - - public IDataModelOperation getDefaultOperation() { - return new UpdateDependentModuleonRenameOp(model); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectDataModelProvider.java deleted file mode 100644 index 574fd4017..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectDataModelProvider.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.Set; - -public abstract class UpdateDependentProjectDataModelProvider extends ProjectRefactoringDataModelProvider - implements ProjectRefactoringProperties { - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getPropertyNames() - */ - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(DEPENDENT_PROJECT_METADATA); - return propertyNames; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectOp.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectOp.java deleted file mode 100644 index 82482a86c..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectOp.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualReference; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * Abstract base class for operations that update dependent projects when a - * referenced project is refactored. - */ -public abstract class UpdateDependentProjectOp extends AbstractDataModelOperation - implements ProjectRefactoringProperties { - - /** - * Creates a new refactoring operation for the specified data model. - * @param model The data model. - */ - public UpdateDependentProjectOp(final IDataModel model) { - super(model); - } - - /** - * Does the dependent project have a .component reference on the refactored project? - * @return IVirtualReference or null if one didn't exist. - */ - protected static IVirtualReference hadReference(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata) { - final IVirtualComponent refactoredComp = refactoredMetadata.getVirtualComponent(); - if (refactoredComp == null) { - return null; - } - final IVirtualReference[] refs = dependentMetadata.getVirtualComponent().getReferences(); - IVirtualReference ref = null; - for (int i = 0; i < refs.length; i++) { - if (refs[i].getReferencedComponent().equals(refactoredComp)) { - ref = refs[i]; - break; - } - } - return ref; - } - - /** - * Does the dependent project have a .project reference on the refactored project? - * (dynamic project refs don't count) - * @return True if a project reference exists. - */ - protected static boolean hadProjectReference(final ProjectRefactorMetadata dependentMetadata, - final ProjectRefactorMetadata refactoredMetadata) { - try { - final IProject[] refs = dependentMetadata.getProject().getDescription().getReferencedProjects(); - final IProject refactoredProject= refactoredMetadata.getProject(); - for (int i = 0; i < refs.length; i++) { - if (refs[i].equals(refactoredProject)) { - return true; - } - } - } catch (CoreException ce) { - Logger.getLogger().logError(ce); - } - return false; - } - - /** - * Returns true if the dependency was a web library dependency. - * @param ref - * @return - */ - protected static boolean hasWebLibDependency(final IVirtualReference ref) { - if (ref == null) { - return false; - } - return ref.getRuntimePath().equals(new Path("/WEB-INF/lib")); //$NON-NLS-1$ - } - - /** - * Override to disable redo support - * @see org.eclipse.core.commands.operations.IUndoableOperation#canRedo() - */ - public boolean canRedo() { - return false; - } - - /** - * Override to disable undo support. - * @see org.eclipse.core.commands.operations.IUndoableOperation#canUndo() - */ - public boolean canUndo() { - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectRenameDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectRenameDataModelProvider.java deleted file mode 100644 index fe9d4feee..000000000 --- a/plugins/org.eclipse.jst.j2ee/refactor/org/eclipse/jst/j2ee/refactor/operations/UpdateDependentProjectRenameDataModelProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. - * 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: - * rfrost@bea.com - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.refactor.operations; - -import java.util.Set; - -public abstract class UpdateDependentProjectRenameDataModelProvider extends ProjectRenameDataModelProvider - implements ProjectRefactoringProperties { - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getPropertyNames() - */ - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(DEPENDENT_PROJECT_METADATA); - return propertyNames; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/rose/moduleMap.genmodel b/plugins/org.eclipse.jst.j2ee/rose/moduleMap.genmodel deleted file mode 100644 index 3c01fa09d..000000000 --- a/plugins/org.eclipse.jst.j2ee/rose/moduleMap.genmodel +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" - xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/com.ibm.etools.j2ee/earproject" - editDirectory="/com.ibm.etools.j2ee/applicationedit" editorDirectory="/com.ibm.etools.j2ee.editor/src" - modelPluginID="modulemap" modelName="Modulemap" editPluginClass="modulemap.provider.ModulemapEditPlugin" - editorPluginClass="com.ibm.etools.j2ee.plugin.J2EEPlugin" updateClasspath="false" - usedGenPackages="../../com.ibm.etools.j2ee.core/rose/j2ee.genmodel#//@genPackages.5 ../../com.ibm.etools.java.core/rose/javaModel.genmodel#//@genPackages.0 ../../com.ibm.etools.j2ee.core/rose/j2ee.genmodel#//@genPackages.1 ../../org.eclipse.emf.ecore/src/model/Ecore.genmodel#//@genPackages.0"> - <foreignModel>moduleMap.mdl</foreignModel> - <foreignModel>WORKSPACE_ROOT</foreignModel> - <foreignModel>../..</foreignModel> - <genPackages prefix="Modulemap" basePackage="com.ibm.etools.ear" ecorePackage="modulemap.ecore#/"> - <genClasses ecoreClass="modulemap.ecore#//ModuleMapping"> - <genFeatures ecoreFeature="ecore:EAttribute modulemap.ecore#//ModuleMapping/projectName"/> - <genFeatures ecoreFeature="ecore:EReference modulemap.ecore#//ModuleMapping/module"/> - </genClasses> - <genClasses ecoreClass="modulemap.ecore#//EARProjectMap"> - <genFeatures property="None" children="true" ecoreFeature="ecore:EReference modulemap.ecore#//EARProjectMap/mappings"/> - <genFeatures property="None" children="true" ecoreFeature="ecore:EReference modulemap.ecore#//EARProjectMap/utilityJARMappings"/> - </genClasses> - <genClasses ecoreClass="modulemap.ecore#//UtilityJARMapping"> - <genFeatures ecoreFeature="ecore:EAttribute modulemap.ecore#//UtilityJARMapping/projectName"/> - <genFeatures ecoreFeature="ecore:EAttribute modulemap.ecore#//UtilityJARMapping/uri"/> - </genClasses> - </genPackages> -</genmodel:GenModel> diff --git a/plugins/org.eclipse.jst.j2ee/rose/moduleMap.mdl b/plugins/org.eclipse.jst.j2ee/rose/moduleMap.mdl deleted file mode 100644 index 71f26c9cb..000000000 --- a/plugins/org.eclipse.jst.j2ee/rose/moduleMap.mdl +++ /dev/null @@ -1,7323 +0,0 @@ -
-(object Petal
- version 44
- _written "Rose 7.1.9642.27"
- charSet 0)
-
-(object Design "Logical View"
- is_unit TRUE
- is_loaded TRUE
- quid "3B7045650189"
- defaults (object defaults
- rightMargin 0.250000
- leftMargin 0.250000
- topMargin 0.250000
- bottomMargin 0.500000
- pageOverlap 0.250000
- clipIconLabels TRUE
- autoResize TRUE
- snapToGrid TRUE
- gridX 16
- gridY 16
- defaultFont (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- showMessageNum 1
- showClassOfObject TRUE
- notation "Unified")
- root_usecase_package (object Class_Category "Use Case View"
- quid "3B704565018B"
- exportControl "Public"
- global TRUE
- logical_models (list unit_reference_list)
- logical_presentations (list unit_reference_list
- (object UseCaseDiagram "Main"
- quid "3B704565019E"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- root_category (object Class_Category "Logical View"
- quid "3B704565018A"
- exportControl "Public"
- global TRUE
- subsystem "Component View"
- quidu "3B704565018C"
- logical_models (list unit_reference_list
- (object Class_Category "application"
- is_unit TRUE
- is_loaded FALSE
- file_name "$WORKSPACE_ROOT\\com.ibm.etools.j2ee.core\\rose\\application.cat"
- quid "38C03008014E")
- (object Class_Category "modulemap"
- quid "3B7045BB0314"
- exportControl "Public"
- logical_models (list unit_reference_list
- (object Class "ModuleMapping"
- quid "3B704601006B"
- class_attributes (list class_attribute_list
- (object ClassAttribute "projectName"
- quid "3B7047D600FC"
- type "String"
- exportControl "Public")))
- (object Class "EARProjectMap"
- quid "3B7046180227"
- realized_interfaces (list realize_rel_list
- (object Realize_Relationship
- quid "3B7046570029"
- supplier "Logical View::modulemap::ModuleMapping"
- quidu "3B704601006B")))
- (object Class "UtilityJARMapping"
- quid "3C570595009F"
- class_attributes (list class_attribute_list
- (object ClassAttribute "projectName"
- quid "3C5705D002AD"
- type "String"
- exportControl "Public")
- (object ClassAttribute "uri"
- quid "3C5705E2014A"
- type "String"
- exportControl "Public")))
- (object Association "$UNNAMED$0"
- quid "3B704663024D"
- roles (list role_list
- (object Role "mappings"
- quid "3B70466402A8"
- label "mappings"
- supplier "Logical View::modulemap::ModuleMapping"
- quidu "3B704601006B"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)
- (object Role "$UNNAMED$1"
- quid "3B70466402B2"
- supplier "Logical View::modulemap::EARProjectMap"
- quidu "3B7046180227"
- is_aggregate TRUE)))
- (object Association "$UNNAMED$2"
- quid "3B70480A00E3"
- roles (list role_list
- (object Role "module"
- quid "3B70480C0117"
- label "module"
- supplier "Logical View::application::Module"
- quidu "38C0322C0006"
- client_cardinality (value cardinality "1")
- Containment "By Reference"
- is_navigable TRUE)
- (object Role "$UNNAMED$3"
- quid "3B70480C012C"
- supplier "Logical View::modulemap::ModuleMapping"
- quidu "3B704601006B"
- is_aggregate TRUE)))
- (object Association "$UNNAMED$4"
- quid "3C5709D2010E"
- roles (list role_list
- (object Role "utilityJARMappings"
- quid "3C5709D3019B"
- label "utilityJARMappings"
- supplier "Logical View::modulemap::UtilityJARMapping"
- quidu "3C570595009F"
- client_cardinality (value cardinality "1..n")
- Containment "By Value"
- is_navigable TRUE)
- (object Role "$UNNAMED$5"
- quid "3C5709D3019D"
- supplier "Logical View::modulemap::EARProjectMap"
- quidu "3B7046180227"
- is_aggregate TRUE))))
- logical_presentations (list unit_reference_list
- (object ClassDiagram "Main"
- quid "3B7045E600D1"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list
- (object NoteView @1
- location (1184, 1504)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @1
- location (778, 1304)
- fill_color 13434879
- nlines 8
- max_width 777
- label "These could have had a common supertype; however, we have to maintain compatilibility with existing documents from v4, so we can't change the hierarchy of ModuleMapping. We may decide later to add a common interface.")
- line_color 3342489
- fill_color 13434879
- width 837
- height 412)
- (object ClassView "Class" "Logical View::application::Module" @2
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1520, 800)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @2
- location (1372, 671)
- fill_color 13434879
- nlines 1
- max_width 296
- justify 0
- label "Module")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "38C0322C0006"
- width 314
- height 282
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::modulemap::ModuleMapping" @3
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1504, 256)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @3
- location (1292, 175)
- fill_color 13434879
- nlines 1
- max_width 424
- justify 0
- label "ModuleMapping")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "3B704601006B"
- width 442
- height 186
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$2" @4
- location (1520, 504)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- stereotype TRUE
- line_color 3342489
- quidu "3B70480A00E3"
- roleview_list (list RoleViews
- (object RoleView "module" @5
- Parent_View @4
- location (16, 248)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @6
- Parent_View @5
- location (1622, 594)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 172
- justify 0
- label "+module"
- pctDist 0.587413
- height 102
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "3B70480C0117"
- client @4
- supplier @2
- line_style 3
- origin_attachment (1520, 504)
- terminal_attachment (1520, 659)
- label (object SegLabel @7
- Parent_View @5
- location (1574, 642)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "1"
- pctDist 0.900000
- height 54
- orientation 0))
- (object RoleView "$UNNAMED$3" @8
- Parent_View @4
- location (16, 248)
- stereotype TRUE
- line_color 3342489
- quidu "3B70480C012C"
- client @4
- supplier @3
- line_style 3
- origin_attachment (1520, 504)
- terminal_attachment (1520, 349))))
- (object AttachView "" @9
- stereotype TRUE
- line_color 3342489
- client @3
- supplier @1
- line_style 3
- origin_attachment (1309, 348)
- terminal_attachment (1309, 1297))
- (object ClassView "Class" "Logical View::modulemap::UtilityJARMapping" @10
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (544, 800)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @10
- location (332, 669)
- fill_color 13434879
- nlines 2
- max_width 424
- justify 0
- label "UtilityJARMapping")
- icon_style "Icon"
- line_color 3342489
- fill_color 16777088
- quidu "3C570595009F"
- width 442
- height 286
- annotation 8
- autoResize TRUE)
- (object AttachView "" @11
- stereotype TRUE
- line_color 3342489
- client @1
- supplier @10
- vertices (list Points
- (1088, 1297)
- (1088, 786)
- (765, 786))
- line_style 3
- origin_attachment (768, 1298)
- terminal_attachment (768, 943))
- (object ClassView "Class" "Logical View::modulemap::EARProjectMap" @12
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (544, 224)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @12
- location (376, 173)
- fill_color 13434879
- nlines 1
- max_width 336
- justify 0
- label "EARProjectMap")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "3B7046180227"
- width 354
- height 126
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$0" @13
- location (1002, 216)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- stereotype TRUE
- line_color 3342489
- quidu "3B704663024D"
- roleview_list (list RoleViews
- (object RoleView "mappings" @14
- Parent_View @13
- location (730, -24)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @15
- Parent_View @14
- location (1227, 175)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 216
- justify 0
- label "+mappings"
- pctDist 0.800000
- height 42
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "3B70466402A8"
- client @13
- supplier @3
- line_style 3
- origin_attachment (1002, 216)
- terminal_attachment (1283, 216)
- label (object SegLabel @16
- Parent_View @14
- location (1255, 270)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..n"
- pctDist 0.900000
- height 54
- orientation 1))
- (object RoleView "$UNNAMED$1" @17
- Parent_View @13
- location (730, -24)
- stereotype TRUE
- line_color 3342489
- quidu "3B70466402B2"
- client @13
- supplier @12
- line_style 3
- origin_attachment (1002, 216)
- terminal_attachment (721, 216))))
- (object AssociationViewNew "$UNNAMED$4" @18
- location (544, 471)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- stereotype TRUE
- line_color 3342489
- quidu "3C5709D2010E"
- roleview_list (list RoleViews
- (object RoleView "utilityJARMappings" @19
- Parent_View @18
- location (0, 247)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @20
- Parent_View @19
- location (341, 571)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 374
- justify 0
- label "+utilityJARMappings"
- pctDist 0.545946
- height 204
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "3C5709D3019B"
- client @18
- supplier @10
- line_style 0
- label (object SegLabel @21
- Parent_View @19
- location (598, 637)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "1..n"
- pctDist 0.897297
- height 54
- orientation 0))
- (object RoleView "$UNNAMED$5" @22
- Parent_View @18
- location (0, 247)
- stereotype TRUE
- line_color 3342489
- quidu "3C5709D3019D"
- client @18
- supplier @12
- line_style 0)))))))
- (object Class_Category "common"
- is_unit TRUE
- is_loaded FALSE
- file_name "$WORKSPACE_ROOT\\com.ibm.etools.j2ee.core\\rose\\common.cat"
- quid "38C08F0F038D")
- (object Class_Category "ecore"
- is_unit TRUE
- is_loaded FALSE
- file_name "$WORKSPACE_ROOT\\org.eclipse.emf.ecore\\src\\model\\org.eclipse.emf.Ecore.cat"
- quid "39A5ED04004E")
- (object Class_Category "java"
- is_unit TRUE
- is_loaded FALSE
- file_name "$WORKSPACE_ROOT\\com.ibm.etools.java.core\\rose\\edocjava2.cat"
- quid "36549F2C004E"))
- logical_presentations (list unit_reference_list
- (object ClassDiagram "Main"
- quid "3B7045650193"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list
- (object CategoryView "Logical View::application" @23
- location (1136, 912)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @23
- location (992, 828)
- fill_color 13434879
- nlines 2
- max_width 288
- justify 0
- label "application")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "38C03008014E"
- width 300
- height 180)))))
- root_subsystem (object SubSystem "Component View"
- quid "3B704565018C"
- physical_models (list unit_reference_list)
- physical_presentations (list unit_reference_list
- (object Module_Diagram "Main"
- quid "3B704565019D"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- process_structure (object Processes
- quid "3B704565018D"
- ProcsNDevs (list
- (object Process_Diagram "Deployment View"
- quid "3B704565018F"
- title "Deployment View"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- properties (object Properties
- attributes (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "packageName"
- value "")
- (object Attribute
- tool "Ecore"
- name "nsPrefix"
- value "")
- (object Attribute
- tool "Ecore"
- name "nsURI"
- value "")
- (object Attribute
- tool "Ecore"
- name "basePackage"
- value "")
- (object Attribute
- tool "Ecore"
- name "prefix"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "classifierName"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "operationName"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "attributeName"
- value "")
- (object Attribute
- tool "Ecore"
- name "isTransient"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isVolatile"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isChangeable"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isUnsettable"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isUnique"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isID"
- value FALSE)))
- (object Attribute
- tool "Ecore"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "referenceName"
- value "")
- (object Attribute
- tool "Ecore"
- name "isTransient"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isVolatile"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isChangeable"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isUnsettable"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isResolveProxies"
- value TRUE)))
- (object Attribute
- tool "Cplusplus"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "Cplusplus"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "Const"
- value FALSE)
- (object Attribute
- tool "Cplusplus"
- name "InitialValue"
- value "")))
- (object Attribute
- tool "Cplusplus"
- name "default__Inherit"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)))
- (object Attribute
- tool "Cplusplus"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "Copyright"
- value (value Text ""))
- (object Attribute
- tool "Cplusplus"
- name "RootPackage"
- value "C++ Reverse Engineered")
- (object Attribute
- tool "Cplusplus"
- name "InitialHeaderIncludes"
- value (value Text ""))
- (object Attribute
- tool "Cplusplus"
- name "InitialBodyIncludes"
- value (value Text ""))))
- (object Attribute
- tool "Cplusplus"
- name "default__Param"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")))
- (object Attribute
- tool "Cplusplus"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")))
- (object Attribute
- tool "Cplusplus"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "InitialCodeBody"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "Inline"
- value FALSE)))
- (object Attribute
- tool "Cplusplus"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "ImplementationType"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "HeaderSourceFile"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "BodySourceFile"
- value "")))
- (object Attribute
- tool "Cplusplus"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "IsNamespace"
- value FALSE)))
- (object Attribute
- tool "Cplusplus"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "ANSI C++ Event Watcher"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "ANSIConvert"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "propertyId"
- value "838326200")
- (object Attribute
- tool "Ada83"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "SpecFileExtension"
- value "1.ada")
- (object Attribute
- tool "Ada83"
- name "SpecFileBackupExtension"
- value "1.ad~")
- (object Attribute
- tool "Ada83"
- name "SpecFileTemporaryExtension"
- value "1.ad#")
- (object Attribute
- tool "Ada83"
- name "BodyFileExtension"
- value "2.ada")
- (object Attribute
- tool "Ada83"
- name "BodyFileBackupExtension"
- value "2.ad~")
- (object Attribute
- tool "Ada83"
- name "BodyFileTemporaryExtension"
- value "2.ad#")
- (object Attribute
- tool "Ada83"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "GenerateBodies"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "GenerateAccessorOperations"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "GenerateStandardOperations"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "ImplicitParameter"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "CommentWidth"
- value 60)
- (object Attribute
- tool "Ada83"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "Ada83"
- name "UseFileName"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "Directory"
- value "$ROSEADA83_SOURCE")))
- (object Attribute
- tool "Ada83"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "ClassName"
- value "Object")
- (object Attribute
- tool "Ada83"
- name "ClassAccess"
- value ("ImplementationSet" 43))
- (object Attribute
- tool "Ada83"
- name "ImplementationType"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "IsSubtype"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "PolymorphicUnit"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "HandleName"
- value "Handle")
- (object Attribute
- tool "Ada83"
- name "HandleAccess"
- value ("ImplementationSet" 45))
- (object Attribute
- tool "Ada83"
- name "Discriminant"
- value "")
- (object Attribute
- tool "Ada83"
- name "Variant"
- value "")
- (object Attribute
- tool "Ada83"
- name "EnumerationLiteralPrefix"
- value "A_")
- (object Attribute
- tool "Ada83"
- name "RecordFieldPrefix"
- value "The_")
- (object Attribute
- tool "Ada83"
- name "GenerateAccessorOperations"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "GenerateStandardOperations"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "ImplicitParameter"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "ClassParameterName"
- value "This")
- (object Attribute
- tool "Ada83"
- name "DefaultConstructorKind"
- value ("ConstructorKindSet" 199))
- (object Attribute
- tool "Ada83"
- name "DefaultConstructorName"
- value "Create")
- (object Attribute
- tool "Ada83"
- name "InlineDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "CopyConstructorKind"
- value ("ConstructorKindSet" 199))
- (object Attribute
- tool "Ada83"
- name "CopyConstructorName"
- value "Copy")
- (object Attribute
- tool "Ada83"
- name "InlineCopyConstructor"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "DestructorName"
- value "Free")
- (object Attribute
- tool "Ada83"
- name "InlineDestructor"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "ClassEqualityOperation"
- value "")
- (object Attribute
- tool "Ada83"
- name "HandleEqualityOperation"
- value "")
- (object Attribute
- tool "Ada83"
- name "InlineEquality"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "IsTask"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "ImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Public"
- value 45)
- (object Attribute
- tool "Ada83"
- name "Private"
- value 43)
- (object Attribute
- tool "Ada83"
- name "LimitedPrivate"
- value 200)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada83"
- name "ConstructorKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada83"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada83"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "FileName"
- value "")
- (object Attribute
- tool "Ada83"
- name "ReturnType"
- value "")
- (object Attribute
- tool "Ada83"
- name "GenericFormalParameters"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "AdditionalWiths"
- value (value Text ""))))
- (object Attribute
- tool "Ada83"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "FileName"
- value "")
- (object Attribute
- tool "Ada83"
- name "ReturnType"
- value "")
- (object Attribute
- tool "Ada83"
- name "AdditionalWiths"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "IsSubunit"
- value FALSE)))
- (object Attribute
- tool "Ada83"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "SubprogramImplementation"
- value ("SubprogramImplementationSet" 2))
- (object Attribute
- tool "Ada83"
- name "ClassParameterMode"
- value ("ParameterModeSet" 203))
- (object Attribute
- tool "Ada83"
- name "Inline"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "EntryCode"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "ExitCode"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "SubprogramImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Body"
- value 2)
- (object Attribute
- tool "Ada83"
- name "Separate"
- value 223)
- (object Attribute
- tool "Ada83"
- name "Spec"
- value 224)))
- (object Attribute
- tool "Ada83"
- name "ParameterModeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "In"
- value 204)
- (object Attribute
- tool "Ada83"
- name "Out"
- value 205)
- (object Attribute
- tool "Ada83"
- name "InOut"
- value 203)
- (object Attribute
- tool "Ada83"
- name "FunctionReturn"
- value 206)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada83"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "NameIfUnlabeled"
- value "The_${supplier}")
- (object Attribute
- tool "Ada83"
- name "DataMemberName"
- value "${relationship}")
- (object Attribute
- tool "Ada83"
- name "GetName"
- value "Get_${relationship}")
- (object Attribute
- tool "Ada83"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "SetName"
- value "Set_${relationship}")
- (object Attribute
- tool "Ada83"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada83"
- name "Variant"
- value "")
- (object Attribute
- tool "Ada83"
- name "ContainerGeneric"
- value "List")
- (object Attribute
- tool "Ada83"
- name "ContainerType"
- value "")
- (object Attribute
- tool "Ada83"
- name "ContainerDeclarations"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "SelectorName"
- value "")
- (object Attribute
- tool "Ada83"
- name "SelectorType"
- value "")))
- (object Attribute
- tool "Ada83"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "DataMemberName"
- value "${attribute}")
- (object Attribute
- tool "Ada83"
- name "GetName"
- value "Get_${attribute}")
- (object Attribute
- tool "Ada83"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "SetName"
- value "Set_${attribute}")
- (object Attribute
- tool "Ada83"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada83"
- name "Variant"
- value "")
- (object Attribute
- tool "Ada83"
- name "Representation"
- value (value Text ""))))
- (object Attribute
- tool "Ada83"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "NameIfUnlabeled"
- value "The_${targetClass}")
- (object Attribute
- tool "Ada83"
- name "GetName"
- value "Get_${association}")
- (object Attribute
- tool "Ada83"
- name "InlineGet"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "SetName"
- value "Set_${association}")
- (object Attribute
- tool "Ada83"
- name "InlineSet"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "GenerateAssociate"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada83"
- name "AssociateName"
- value "Associate")
- (object Attribute
- tool "Ada83"
- name "InlineAssociate"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "GenerateDissociate"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada83"
- name "DissociateName"
- value "Dissociate")
- (object Attribute
- tool "Ada83"
- name "InlineDissociate"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada83"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada83"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "NameIfUnlabeled"
- value "The_${targetClass}")
- (object Attribute
- tool "Ada83"
- name "DataMemberName"
- value "${target}")
- (object Attribute
- tool "Ada83"
- name "GetName"
- value "Get_${target}")
- (object Attribute
- tool "Ada83"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "SetName"
- value "Set_${target}")
- (object Attribute
- tool "Ada83"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada83"
- name "ContainerGeneric"
- value "List")
- (object Attribute
- tool "Ada83"
- name "ContainerType"
- value "")
- (object Attribute
- tool "Ada83"
- name "ContainerDeclarations"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "SelectorName"
- value "")
- (object Attribute
- tool "Ada83"
- name "SelectorType"
- value "")
- (object Attribute
- tool "Ada83"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada83"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Directory"
- value "AUTO GENERATE")))
- (object Attribute
- tool "Ada83"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "propertyId"
- value "838326200")
- (object Attribute
- tool "Ada95"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "SpecFileExtension"
- value "1.ada")
- (object Attribute
- tool "Ada95"
- name "SpecFileBackupExtension"
- value "1.ad~")
- (object Attribute
- tool "Ada95"
- name "SpecFileTemporaryExtension"
- value "1.ad#")
- (object Attribute
- tool "Ada95"
- name "BodyFileExtension"
- value "2.ada")
- (object Attribute
- tool "Ada95"
- name "BodyFileBackupExtension"
- value "2.ad~")
- (object Attribute
- tool "Ada95"
- name "BodyFileTemporaryExtension"
- value "2.ad#")
- (object Attribute
- tool "Ada95"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "UseColonNotation"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateBodies"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateAccessorOperations"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateStandardOperations"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "ImplicitParameter"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "CommentWidth"
- value 60)
- (object Attribute
- tool "Ada95"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "Ada95"
- name "UseFileName"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "Directory"
- value "$ROSEADA95_SOURCE")))
- (object Attribute
- tool "Ada95"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "TypeName"
- value "Object")
- (object Attribute
- tool "Ada95"
- name "TypeVisibility"
- value ("TypeVisibilitySet" 43))
- (object Attribute
- tool "Ada95"
- name "TypeImplementation"
- value ("TypeImplementationSet" 208))
- (object Attribute
- tool "Ada95"
- name "TypeControl"
- value ("TypeControlSet" 225))
- (object Attribute
- tool "Ada95"
- name "TypeControlName"
- value "Controlled_${type}")
- (object Attribute
- tool "Ada95"
- name "TypeDefinition"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "RecordImplementation"
- value ("RecordImplementationSet" 209))
- (object Attribute
- tool "Ada95"
- name "RecordKindPackageName"
- value "${class}_Record_Kinds")
- (object Attribute
- tool "Ada95"
- name "IsLimited"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "IsSubtype"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateAccessType"
- value ("GenerateAccessTypeSet" 230))
- (object Attribute
- tool "Ada95"
- name "AccessTypeName"
- value "Handle")
- (object Attribute
- tool "Ada95"
- name "AccessTypeVisibility"
- value ("TypeVisibilitySet" 45))
- (object Attribute
- tool "Ada95"
- name "AccessTypeDefinition"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "AccessClassWide"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "MaybeAliased"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "ParameterizedImplementation"
- value ("ParameterizedImplementationSet" 11))
- (object Attribute
- tool "Ada95"
- name "ParentClassName"
- value "Superclass")
- (object Attribute
- tool "Ada95"
- name "EnumerationLiteralPrefix"
- value "A_")
- (object Attribute
- tool "Ada95"
- name "RecordFieldPrefix"
- value "The_")
- (object Attribute
- tool "Ada95"
- name "ArrayOfTypeName"
- value "Array_Of_${type}")
- (object Attribute
- tool "Ada95"
- name "AccessArrayOfTypeName"
- value "Access_Array_Of_${type}")
- (object Attribute
- tool "Ada95"
- name "ArrayOfAccessTypeName"
- value "Array_Of_${access_type}")
- (object Attribute
- tool "Ada95"
- name "AccessArrayOfAccessTypeName"
- value "Access_Array_Of_${access_type}")
- (object Attribute
- tool "Ada95"
- name "ArrayIndexDefinition"
- value "Positive range <>")
- (object Attribute
- tool "Ada95"
- name "GenerateAccessorOperations"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateStandardOperations"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "ImplicitParameter"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "ImplicitParameterName"
- value "This")
- (object Attribute
- tool "Ada95"
- name "GenerateDefaultConstructor"
- value ("SubprogramKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "DefaultConstructorName"
- value "Create")
- (object Attribute
- tool "Ada95"
- name "InlineDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateCopyConstructor"
- value ("SubprogramKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "CopyConstructorName"
- value "Copy")
- (object Attribute
- tool "Ada95"
- name "InlineCopyConstructor"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateDestructor"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "DestructorName"
- value "Free")
- (object Attribute
- tool "Ada95"
- name "InlineDestructor"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateTypeEquality"
- value ("FunctionKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "TypeEqualityName"
- value "${quote}=${quote}")
- (object Attribute
- tool "Ada95"
- name "InlineEquality"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "TypeImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Tagged"
- value 208)
- (object Attribute
- tool "Ada95"
- name "Record"
- value 210)
- (object Attribute
- tool "Ada95"
- name "Mixin"
- value 211)
- (object Attribute
- tool "Ada95"
- name "Protected"
- value 44)
- (object Attribute
- tool "Ada95"
- name "Task"
- value 212)))
- (object Attribute
- tool "Ada95"
- name "RecordImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "SingleType"
- value 209)
- (object Attribute
- tool "Ada95"
- name "MultipleTypes"
- value 213)))
- (object Attribute
- tool "Ada95"
- name "ParameterizedImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Generic"
- value 11)
- (object Attribute
- tool "Ada95"
- name "Unconstrained"
- value 214)))
- (object Attribute
- tool "Ada95"
- name "TypeVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Public"
- value 45)
- (object Attribute
- tool "Ada95"
- name "Private"
- value 43)))
- (object Attribute
- tool "Ada95"
- name "SubprogramKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "TypeControlSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "None"
- value 225)
- (object Attribute
- tool "Ada95"
- name "InitializationOnly"
- value 226)
- (object Attribute
- tool "Ada95"
- name "AssignmentFinalizationOnly"
- value 227)
- (object Attribute
- tool "Ada95"
- name "All"
- value 228)))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Always"
- value 229)
- (object Attribute
- tool "Ada95"
- name "Auto"
- value 230)))))
- (object Attribute
- tool "Ada95"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "FileName"
- value "")
- (object Attribute
- tool "Ada95"
- name "ReturnType"
- value "")
- (object Attribute
- tool "Ada95"
- name "GenericFormalParameters"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "AdditionalWiths"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "IsPrivate"
- value FALSE)))
- (object Attribute
- tool "Ada95"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "FileName"
- value "")
- (object Attribute
- tool "Ada95"
- name "ReturnType"
- value "")
- (object Attribute
- tool "Ada95"
- name "AdditionalWiths"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "IsSubunit"
- value FALSE)))
- (object Attribute
- tool "Ada95"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "SubprogramImplementation"
- value ("SubprogramImplementationSet" 2))
- (object Attribute
- tool "Ada95"
- name "Renames"
- value "")
- (object Attribute
- tool "Ada95"
- name "GenerateOverriding"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "ImplicitParameterMode"
- value ("ParameterModeSet" 203))
- (object Attribute
- tool "Ada95"
- name "ImplicitParameterClassWide"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateAccessOperation"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "Inline"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "EntryCode"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "ExitCode"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "EntryBarrierCondition"
- value "True")
- (object Attribute
- tool "Ada95"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "SubprogramImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Abstract"
- value 221)
- (object Attribute
- tool "Ada95"
- name "Body"
- value 2)
- (object Attribute
- tool "Ada95"
- name "Renaming"
- value 222)
- (object Attribute
- tool "Ada95"
- name "Separate"
- value 223)
- (object Attribute
- tool "Ada95"
- name "Spec"
- value 224)))
- (object Attribute
- tool "Ada95"
- name "ParameterModeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "In"
- value 204)
- (object Attribute
- tool "Ada95"
- name "Out"
- value 205)
- (object Attribute
- tool "Ada95"
- name "InOut"
- value 203)
- (object Attribute
- tool "Ada95"
- name "Access"
- value 220)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "NameIfUnlabeled"
- value "The_${supplier}")
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementation"
- value ("RecordFieldImplementationSet" 216))
- (object Attribute
- tool "Ada95"
- name "RecordFieldName"
- value "${relationship}")
- (object Attribute
- tool "Ada95"
- name "GenerateGet"
- value ("FunctionKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessGet"
- value ("FunctionKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "GetName"
- value "Get_${relationship}")
- (object Attribute
- tool "Ada95"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateSet"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessSet"
- value ("ProcedureKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "SetName"
- value "Set_${relationship}")
- (object Attribute
- tool "Ada95"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "IsAliased"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada95"
- name "ContainerImplementation"
- value ("ContainerImplementationSet" 217))
- (object Attribute
- tool "Ada95"
- name "ContainerGeneric"
- value "List")
- (object Attribute
- tool "Ada95"
- name "ContainerType"
- value "")
- (object Attribute
- tool "Ada95"
- name "ContainerDeclarations"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "SelectorName"
- value "")
- (object Attribute
- tool "Ada95"
- name "SelectorType"
- value "")
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Component"
- value 216)
- (object Attribute
- tool "Ada95"
- name "Discriminant"
- value 218)
- (object Attribute
- tool "Ada95"
- name "AccessDiscriminant"
- value 219)))
- (object Attribute
- tool "Ada95"
- name "ContainerImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Array"
- value 217)
- (object Attribute
- tool "Ada95"
- name "Generic"
- value 11)))
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementation"
- value ("RecordFieldImplementationSet" 216))
- (object Attribute
- tool "Ada95"
- name "RecordFieldName"
- value "${attribute}")
- (object Attribute
- tool "Ada95"
- name "GenerateGet"
- value ("FunctionKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessGet"
- value ("FunctionKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "GetName"
- value "Get_${attribute}")
- (object Attribute
- tool "Ada95"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateSet"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessSet"
- value ("ProcedureKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "SetName"
- value "Set_${attribute}")
- (object Attribute
- tool "Ada95"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "IsAliased"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada95"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Component"
- value 216)
- (object Attribute
- tool "Ada95"
- name "Discriminant"
- value 218)
- (object Attribute
- tool "Ada95"
- name "AccessDiscriminant"
- value 219)))
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "NameIfUnlabeled"
- value "The_${targetClass}")
- (object Attribute
- tool "Ada95"
- name "GenerateGet"
- value ("FunctionKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "GetName"
- value "Get_${association}")
- (object Attribute
- tool "Ada95"
- name "InlineGet"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateSet"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "SetName"
- value "Set_${association}")
- (object Attribute
- tool "Ada95"
- name "InlineSet"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateAssociate"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "AssociateName"
- value "Associate")
- (object Attribute
- tool "Ada95"
- name "InlineAssociate"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateDissociate"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "DissociateName"
- value "Dissociate")
- (object Attribute
- tool "Ada95"
- name "InlineDissociate"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "NameIfUnlabeled"
- value "The_${targetClass}")
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementation"
- value ("RecordFieldImplementationSet" 216))
- (object Attribute
- tool "Ada95"
- name "RecordFieldName"
- value "${target}")
- (object Attribute
- tool "Ada95"
- name "GenerateGet"
- value ("FunctionKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessGet"
- value ("FunctionKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "GetName"
- value "Get_${target}")
- (object Attribute
- tool "Ada95"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateSet"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessSet"
- value ("ProcedureKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "SetName"
- value "Set_${target}")
- (object Attribute
- tool "Ada95"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "IsAliased"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada95"
- name "ContainerImplementation"
- value ("ContainerImplementationSet" 217))
- (object Attribute
- tool "Ada95"
- name "ContainerGeneric"
- value "List")
- (object Attribute
- tool "Ada95"
- name "ContainerType"
- value "")
- (object Attribute
- tool "Ada95"
- name "ContainerDeclarations"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "SelectorName"
- value "")
- (object Attribute
- tool "Ada95"
- name "SelectorType"
- value "")
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Component"
- value 216)
- (object Attribute
- tool "Ada95"
- name "Discriminant"
- value 218)
- (object Attribute
- tool "Ada95"
- name "AccessDiscriminant"
- value 219)))
- (object Attribute
- tool "Ada95"
- name "ContainerImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Array"
- value 217)
- (object Attribute
- tool "Ada95"
- name "Generic"
- value 11)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Directory"
- value "AUTO GENERATE")))
- (object Attribute
- tool "Ada95"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "CORBA"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "CORBA"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "CORBA"
- name "Editor"
- value ("EditorType" 100))
- (object Attribute
- tool "CORBA"
- name "IncludePath"
- value "")
- (object Attribute
- tool "CORBA"
- name "StopOnError"
- value TRUE)
- (object Attribute
- tool "CORBA"
- name "EditorType"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "BuiltIn"
- value 100)
- (object Attribute
- tool "CORBA"
- name "WindowsShell"
- value 101)))))
- (object Attribute
- tool "CORBA"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "ArrayDimensions"
- value "")
- (object Attribute
- tool "CORBA"
- name "ConstValue"
- value "")
- (object Attribute
- tool "CORBA"
- name "ImplementationType"
- value "")))
- (object Attribute
- tool "CORBA"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "CORBA"
- name "CmIdentification"
- value (value Text " %X% %Q% %Z% %W%"))
- (object Attribute
- tool "CORBA"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "CORBA"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")))
- (object Attribute
- tool "CORBA"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "CORBA"
- name "CmIdentification"
- value (value Text " %X% %Q% %Z% %W%"))
- (object Attribute
- tool "CORBA"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "CORBA"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")))
- (object Attribute
- tool "CORBA"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "Context"
- value "")
- (object Attribute
- tool "CORBA"
- name "OperationIsOneWay"
- value FALSE)))
- (object Attribute
- tool "CORBA"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "ArrayDimensions"
- value "")
- (object Attribute
- tool "CORBA"
- name "CaseSpecifier"
- value "")
- (object Attribute
- tool "CORBA"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "CORBA"
- name "Order"
- value "")))
- (object Attribute
- tool "CORBA"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "ArrayDimensions"
- value "")
- (object Attribute
- tool "CORBA"
- name "CaseSpecifier"
- value "")
- (object Attribute
- tool "CORBA"
- name "GenerateForwardReference"
- value FALSE)
- (object Attribute
- tool "CORBA"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "CORBA"
- name "Order"
- value "")
- (object Attribute
- tool "CORBA"
- name "BoundedRoleType"
- value ("AssocTypeSet" 47))
- (object Attribute
- tool "CORBA"
- name "AssocTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "Array"
- value 24)
- (object Attribute
- tool "CORBA"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "CORBA"
- name "default__Uses"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "GenerateForwardReference"
- value FALSE)))
- (object Attribute
- tool "CORBA"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "Data Modeler"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "project"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TableCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "DomainCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "SPPackageCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "TriggerCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "IndexCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "ConstraintCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "StoreProcedureCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "PrimaryKeyCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "ForeignKeyCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "TablePrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DomainPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TriggerPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IndexPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ConstraintPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "StoreProcedurePrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "PrimaryKeyPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ForeignKeyPrefix"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsDatabase"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "TargetDatabase"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Location"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "dmSchema"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "dmDomainPackage"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsSchema"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsDomainPackage"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsRootSchema"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsRootDomainPackage"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsSchemaPackage"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DatabaseID"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DBMS"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsTable"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsView"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsDomain"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsSPPackage"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "Synonymns"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TableSpace"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceId"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SelectClause"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsUpdatable"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "CheckOption"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "PersistToServer"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Ordinal"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "IsIdentity"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsUnique"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "NullsAllowed"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "Length"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "Scale"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "ColumnType"
- value "Native")
- (object Attribute
- tool "Data Modeler"
- name "ForBitData"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DefaultValueType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DefaultValue"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceId"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "OID"
- value FALSE)))
- (object Attribute
- tool "Data Modeler"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsRelationship"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "SourceId"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "RIMethod"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ParentUpdateRule"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ParentUpdateRuleName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ParentDeleteRule"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ParentDeleteRuleName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ChildInsertRestrict"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ChildInsertRestrictName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ChildMultiplicity"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ChildMultiplicityName"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ConstraintName"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsConstraint"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ConstraintType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsIndex"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsTrigger"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsStoredProcedure"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsCluster"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "TableSpace"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "FillFactor"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "KeyList"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "CheckPredicate"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsUnique"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DeferalMode"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "InitialCheckTime"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TriggerType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsInsertEvent"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsUpdateEvent"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsDeleteEvent"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "RefOldTable"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "RefNewTable"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "RefOldRow"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "RefNewRow"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsRow"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "WhenClause"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Language"
- value "SQL")
- (object Attribute
- tool "Data Modeler"
- name "ProcType"
- value "Procedure")
- (object Attribute
- tool "Data Modeler"
- name "IsDeterministic"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ParameterStyle"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ReturnedNull"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ExternalName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Length"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Scale"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ForBitData"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DefaultValue"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DefaultValueType"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Parameter"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsInParameter"
- value TRUE)
- (object Attribute
- tool "Data Modeler"
- name "IsOutParameter"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "Ordinal"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Length"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Scale"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ForBitData"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DefaultValueType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DefaultValue"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "OperationID"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Data Modeler Communicator"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "framework"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Java"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "Java"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "RootDir"
- value "")
- (object Attribute
- tool "Java"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "Java"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "Java"
- name "UsePrefixes"
- value FALSE)
- (object Attribute
- tool "Java"
- name "AutoSync"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ShowCodegenDlg"
- value FALSE)
- (object Attribute
- tool "Java"
- name "JavadocDefaultAuthor"
- value "")
- (object Attribute
- tool "Java"
- name "JavadocDefaultVersion"
- value "")
- (object Attribute
- tool "Java"
- name "JavadocDefaultSince"
- value "")
- (object Attribute
- tool "Java"
- name "JavadocNumAsterisks"
- value 0)
- (object Attribute
- tool "Java"
- name "MaxNumChars"
- value 80)
- (object Attribute
- tool "Java"
- name "Editor"
- value ("EditorType" 100))
- (object Attribute
- tool "Java"
- name "VM"
- value ("VMType" 200))
- (object Attribute
- tool "Java"
- name "ClassPath"
- value "")
- (object Attribute
- tool "Java"
- name "EditorType"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "BuiltIn"
- value 100)
- (object Attribute
- tool "Java"
- name "WindowsShell"
- value 101)))
- (object Attribute
- tool "Java"
- name "VMType"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Sun"
- value 200)
- (object Attribute
- tool "Java"
- name "Microsoft"
- value 201)
- (object Attribute
- tool "Java"
- name "IBM"
- value 202)))
- (object Attribute
- tool "Java"
- name "InstanceVariablePrefix"
- value "m_")
- (object Attribute
- tool "Java"
- name "ClassVariablePrefix"
- value "s_")
- (object Attribute
- tool "Java"
- name "DefaultAttributeDataType"
- value "int")
- (object Attribute
- tool "Java"
- name "DefaultOperationReturnType"
- value "void")
- (object Attribute
- tool "Java"
- name "NoClassCustomDlg"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GlobalImports"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "OpenBraceClassStyle"
- value TRUE)
- (object Attribute
- tool "Java"
- name "OpenBraceMethodStyle"
- value TRUE)
- (object Attribute
- tool "Java"
- name "UseTabs"
- value FALSE)
- (object Attribute
- tool "Java"
- name "UseSpaces"
- value TRUE)
- (object Attribute
- tool "Java"
- name "SpacingItems"
- value 3)
- (object Attribute
- tool "Java"
- name "RoseDefaultCommentStyle"
- value TRUE)
- (object Attribute
- tool "Java"
- name "AsteriskCommentStyle"
- value FALSE)
- (object Attribute
- tool "Java"
- name "JavaCommentStyle"
- value FALSE)
- (object Attribute
- tool "Java"
- name "JavadocAuthor"
- value FALSE)
- (object Attribute
- tool "Java"
- name "JavadocSince"
- value FALSE)
- (object Attribute
- tool "Java"
- name "JavadocVersion"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Static"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateDefaultConstructor"
- value TRUE)
- (object Attribute
- tool "Java"
- name "ConstructorIs"
- value ("Ctor_Set" 62))
- (object Attribute
- tool "Java"
- name "Ctor_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "public"
- value 62)
- (object Attribute
- tool "Java"
- name "protected"
- value 63)
- (object Attribute
- tool "Java"
- name "private"
- value 64)
- (object Attribute
- tool "Java"
- name "package"
- value 65)))
- (object Attribute
- tool "Java"
- name "GenerateFinalizer"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateStaticInitializer"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateInstanceInitializer"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateCode"
- value TRUE)
- (object Attribute
- tool "Java"
- name "DisableAutoSync"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "Default_Servlet__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "ServletName"
- value "")
- (object Attribute
- tool "Java"
- name "ServletContextRef"
- value FALSE)
- (object Attribute
- tool "Java"
- name "IsSingleThread"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletInitParameter"
- value "")
- (object Attribute
- tool "Java"
- name "ServletInitParameterNames"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletIsSecure"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletRequestDispatcher"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletRequestDispatcherPath"
- value "")
- (object Attribute
- tool "Java"
- name "DispatcherInclude"
- value FALSE)
- (object Attribute
- tool "Java"
- name "DispatcherForward"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletSecurityRoles"
- value "")
- (object Attribute
- tool "Java"
- name "ServletgetInfo"
- value "")))
- (object Attribute
- tool "Java"
- name "Http_Servlet__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "ServletRequestAttribute"
- value "")
- (object Attribute
- tool "Java"
- name "ServletRequestAttributesNames"
- value FALSE)
- (object Attribute
- tool "Java"
- name "MethodForRequestAttributes"
- value "")
- (object Attribute
- tool "Java"
- name "ServletRequestParameter"
- value "")
- (object Attribute
- tool "Java"
- name "ServletRequestParameterNames"
- value FALSE)
- (object Attribute
- tool "Java"
- name "MethodForRequestParameters"
- value "")
- (object Attribute
- tool "Java"
- name "ServletHeader"
- value "")
- (object Attribute
- tool "Java"
- name "ServletHeaderNames"
- value FALSE)
- (object Attribute
- tool "Java"
- name "MethodForHeaders"
- value "")
- (object Attribute
- tool "Java"
- name "ServletIntHeader"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletDateHeader"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletCookie"
- value FALSE)
- (object Attribute
- tool "Java"
- name "MethodForCookie"
- value "")
- (object Attribute
- tool "Java"
- name "ServletContentType"
- value "")
- (object Attribute
- tool "Java"
- name "GenerateHTML"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "Default_EJB__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Generate_XML_DD"
- value TRUE)
- (object Attribute
- tool "Java"
- name "EJBCmpField"
- value "")
- (object Attribute
- tool "Java"
- name "EJBEnvironmentProperties"
- value "")
- (object Attribute
- tool "Java"
- name "EJBCnxFactory"
- value "")
- (object Attribute
- tool "Java"
- name "EJBReferences"
- value "")
- (object Attribute
- tool "Java"
- name "EJBSecurityRoles"
- value "")
- (object Attribute
- tool "Java"
- name "EJBNameInJAR"
- value "")
- (object Attribute
- tool "Java"
- name "EJBSessionType"
- value ("EJBSessionType_Set" 200))
- (object Attribute
- tool "Java"
- name "EJBSessionType_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name ""
- value 200)
- (object Attribute
- tool "Java"
- name "Stateless"
- value 201)
- (object Attribute
- tool "Java"
- name "Stateful"
- value 202)))
- (object Attribute
- tool "Java"
- name "EJBTransactionType"
- value ("EJBTransactionType_Set" 211))
- (object Attribute
- tool "Java"
- name "EJBTransactionType_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Container"
- value 211)
- (object Attribute
- tool "Java"
- name "Bean"
- value 212)))
- (object Attribute
- tool "Java"
- name "EJBPersistenceType"
- value ("EJBPersistenceType_Set" 220))
- (object Attribute
- tool "Java"
- name "EJBPersistenceType_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name ""
- value 220)
- (object Attribute
- tool "Java"
- name "Bean"
- value 221)
- (object Attribute
- tool "Java"
- name "Container"
- value 222)))
- (object Attribute
- tool "Java"
- name "EJBReentrant"
- value FALSE)
- (object Attribute
- tool "Java"
- name "BMP_Extend_CMP"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "CmIdentification"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "CopyrightNotice"
- value (value Text ""))))
- (object Attribute
- tool "Java"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "CmIdentification"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "CopyrightNotice"
- value (value Text ""))))
- (object Attribute
- tool "Java"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Abstract"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Static"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Native"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Synchronized"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Transient"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Volatile"
- value FALSE)
- (object Attribute
- tool "Java"
- name "PropertyType"
- value ("BeanProperty_Set" 71))
- (object Attribute
- tool "Java"
- name "BeanProperty_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Not A Property"
- value 71)
- (object Attribute
- tool "Java"
- name "Simple"
- value 72)
- (object Attribute
- tool "Java"
- name "Bound"
- value 73)
- (object Attribute
- tool "Java"
- name "Constrained"
- value 74)))
- (object Attribute
- tool "Java"
- name "IndividualChangeMgt"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Read/Write"
- value ("Read/Write_Set" 81))
- (object Attribute
- tool "Java"
- name "Read/Write_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Read & Write"
- value 81)
- (object Attribute
- tool "Java"
- name "Read Only"
- value 82)
- (object Attribute
- tool "Java"
- name "Write Only"
- value 83)))
- (object Attribute
- tool "Java"
- name "GenerateFullyQualifiedTypes"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "Java"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Transient"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Volatile"
- value FALSE)
- (object Attribute
- tool "Java"
- name "PropertyType"
- value ("BeanProperty_Set" 71))
- (object Attribute
- tool "Java"
- name "BeanProperty_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Not A Property"
- value 71)
- (object Attribute
- tool "Java"
- name "Simple"
- value 72)
- (object Attribute
- tool "Java"
- name "Bound"
- value 73)
- (object Attribute
- tool "Java"
- name "Constrained"
- value 74)))
- (object Attribute
- tool "Java"
- name "IndividualChangeMgt"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Read/Write"
- value ("Read/Write_Set" 81))
- (object Attribute
- tool "Java"
- name "Read/Write_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Read & Write"
- value 81)
- (object Attribute
- tool "Java"
- name "Read Only"
- value 82)
- (object Attribute
- tool "Java"
- name "Write Only"
- value 83)))
- (object Attribute
- tool "Java"
- name "GenerateFullyQualifiedTypes"
- value FALSE)
- (object Attribute
- tool "Java"
- name "IsNavigable"
- value TRUE)))
- (object Attribute
- tool "Java"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "propertyId"
- value "360000002")
- (object Attribute
- tool "Oracle8"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "DDLScriptFilename"
- value "DDL1.SQL")
- (object Attribute
- tool "Oracle8"
- name "DropClause"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "PrimaryKeyColumnName"
- value "_ID")
- (object Attribute
- tool "Oracle8"
- name "PrimaryKeyColumnType"
- value "NUMBER(5,0)")
- (object Attribute
- tool "Oracle8"
- name "SchemaNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "SchemaNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TableNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TypeNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TypeNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ViewNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ViewNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "VarrayNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "VarrayNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "NestedTableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "NestedTableNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ObjectTableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ObjectTableNameSuffix"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "IsSchema"
- value FALSE)))
- (object Attribute
- tool "Oracle8"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OID"
- value "")
- (object Attribute
- tool "Oracle8"
- name "WhereClause"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CheckConstraint"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypeLength"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypePrecision"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypeScale"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionOfREFS"
- value FALSE)))
- (object Attribute
- tool "Oracle8"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "MethodKind"
- value ("MethodKindSet" 1903))
- (object Attribute
- tool "Oracle8"
- name "OverloadID"
- value "")
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")
- (object Attribute
- tool "Oracle8"
- name "IsReadNoDataState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsReadNoProcessState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsWriteNoDataState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsWriteNoProcessState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsSelfish"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "TriggerType"
- value ("TriggerTypeSet" 1801))
- (object Attribute
- tool "Oracle8"
- name "TriggerEvent"
- value ("TriggerEventSet" 1601))
- (object Attribute
- tool "Oracle8"
- name "TriggerText"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TriggerReferencingNames"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TriggerForEach"
- value ("TriggerForEachSet" 1701))
- (object Attribute
- tool "Oracle8"
- name "TriggerWhenClause"
- value "")
- (object Attribute
- tool "Oracle8"
- name "MethodKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "MapMethod"
- value 1901)
- (object Attribute
- tool "Oracle8"
- name "OrderMethod"
- value 1902)
- (object Attribute
- tool "Oracle8"
- name "Function"
- value 1903)
- (object Attribute
- tool "Oracle8"
- name "Procedure"
- value 1904)
- (object Attribute
- tool "Oracle8"
- name "Operator"
- value 1905)
- (object Attribute
- tool "Oracle8"
- name "Constructor"
- value 1906)
- (object Attribute
- tool "Oracle8"
- name "Destructor"
- value 1907)
- (object Attribute
- tool "Oracle8"
- name "Trigger"
- value 1908)
- (object Attribute
- tool "Oracle8"
- name "Calculated"
- value 1909)))
- (object Attribute
- tool "Oracle8"
- name "TriggerTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "AFTER"
- value 1801)
- (object Attribute
- tool "Oracle8"
- name "BEFORE"
- value 1802)
- (object Attribute
- tool "Oracle8"
- name "INSTEAD OF"
- value 1803)))
- (object Attribute
- tool "Oracle8"
- name "TriggerForEachSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "ROW"
- value 1701)
- (object Attribute
- tool "Oracle8"
- name "STATEMENT"
- value 1702)))
- (object Attribute
- tool "Oracle8"
- name "TriggerEventSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "INSERT"
- value 1601)
- (object Attribute
- tool "Oracle8"
- name "UPDATE"
- value 1602)
- (object Attribute
- tool "Oracle8"
- name "DELETE"
- value 1603)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR UPDATE"
- value 1604)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR DELETE"
- value 1605)
- (object Attribute
- tool "Oracle8"
- name "UPDATE OR DELETE"
- value 1606)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR UPDATE OR DELETE"
- value 1607)))))
- (object Attribute
- tool "Oracle8"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")
- (object Attribute
- tool "Oracle8"
- name "IsUnique"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "NullsAllowed"
- value TRUE)
- (object Attribute
- tool "Oracle8"
- name "Length"
- value "")
- (object Attribute
- tool "Oracle8"
- name "Precision"
- value "2")
- (object Attribute
- tool "Oracle8"
- name "Scale"
- value "6")
- (object Attribute
- tool "Oracle8"
- name "IsIndex"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsPrimaryKey"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "CompositeUnique"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "CheckConstraint"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "R2Editor"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "ComponentTest"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "cg"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "cg"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerAnnotations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerVersion"
- value FALSE)
- (object Attribute
- tool "cg"
- name "UseMSVC"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HeaderFileExtension"
- value "h")
- (object Attribute
- tool "cg"
- name "HeaderFileBackupExtension"
- value "h~")
- (object Attribute
- tool "cg"
- name "HeaderFileTemporaryExtension"
- value "h#")
- (object Attribute
- tool "cg"
- name "CodeFileExtension"
- value "cpp")
- (object Attribute
- tool "cg"
- name "CodeFileBackupExtension"
- value "cp~")
- (object Attribute
- tool "cg"
- name "CodeFileTemporaryExtension"
- value "cp#")
- (object Attribute
- tool "cg"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "cg"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "cg"
- name "Directory"
- value "$ROSECPP_SOURCE")
- (object Attribute
- tool "cg"
- name "PathSeparator"
- value "")
- (object Attribute
- tool "cg"
- name "FileNameFormat"
- value "128vx_b")
- (object Attribute
- tool "cg"
- name "BooleanType"
- value "int")
- (object Attribute
- tool "cg"
- name "AllowTemplates"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AllowExplicitInstantiations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowProtectedInheritance"
- value TRUE)
- (object Attribute
- tool "cg"
- name "CommentWidth"
- value 60)
- (object Attribute
- tool "cg"
- name "OneByValueContainer"
- value "$targetClass")
- (object Attribute
- tool "cg"
- name "OneByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "OptionalByValueContainer"
- value "OptionalByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "OptionalByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "FixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "FixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "BoundedByValueContainer"
- value "BoundedListByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByValueContainer"
- value "BoundedSetByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "BoundedByReferenceContainer"
- value "BoundedListByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByReferenceContainer"
- value "BoundedSetByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnboundedByValueContainer"
- value "UnboundedListByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByValueContainer"
- value "UnboundedSetByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnboundedByReferenceContainer"
- value "UnboundedListByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByReferenceContainer"
- value "UnboundedSetByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "QualifiedByValueContainer"
- value "AssociationByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByValueContainer"
- value "DictionaryByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "QualifiedByReferenceContainer"
- value "AssociationByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByReferenceContainer"
- value "DictionaryByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "AlwaysKeepOrphanedCode"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "compiler2.1__Project"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerAnnotations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerVersion"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HeaderFileExtension"
- value "h")
- (object Attribute
- tool "cg"
- name "HeaderFileBackupExtension"
- value "h~")
- (object Attribute
- tool "cg"
- name "HeaderFileTemporaryExtension"
- value "h#")
- (object Attribute
- tool "cg"
- name "CodeFileExtension"
- value "cpp")
- (object Attribute
- tool "cg"
- name "CodeFileBackupExtension"
- value "cp~")
- (object Attribute
- tool "cg"
- name "CodeFileTemporaryExtension"
- value "cp#")
- (object Attribute
- tool "cg"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "cg"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "cg"
- name "Directory"
- value "$ROSECPP_SOURCE")
- (object Attribute
- tool "cg"
- name "BooleanType"
- value "int")
- (object Attribute
- tool "cg"
- name "AllowTemplates"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowExplicitInstantiations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowProtectedInheritance"
- value FALSE)
- (object Attribute
- tool "cg"
- name "OneByValueContainer"
- value "$targetClass")
- (object Attribute
- tool "cg"
- name "OneByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "OptionalByValueContainer"
- value "OptionalByValue(sizeof($targetClass))")
- (object Attribute
- tool "cg"
- name "OptionalByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "FixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "FixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "BoundedByValueContainer"
- value "BoundedListByValue(sizeof($targetClass),$limit)")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByValueContainer"
- value "BoundedSetByValue(sizeof($targetClass),$limit)")
- (object Attribute
- tool "cg"
- name "BoundedByReferenceContainer"
- value "BoundedListByReference($limit)")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByReferenceContainer"
- value "BoundedSetByReference($limit)")
- (object Attribute
- tool "cg"
- name "UnboundedByValueContainer"
- value "UnboundedListByValue(sizeof($targetClass))")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByValueContainer"
- value "UnboundedSetByValue(sizeof($targetClass))")
- (object Attribute
- tool "cg"
- name "UnboundedByReferenceContainer"
- value "UnboundedListByReference")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByReferenceContainer"
- value "UnboundedSetByReference")
- (object Attribute
- tool "cg"
- name "QualifiedByValueContainer"
- value "AssociationByValue(sizeof($qualtype), sizeof($qualcont))")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByValueContainer"
- value "DictionaryByValue(sizeof($qualtype), sizeof($qualcont))")
- (object Attribute
- tool "cg"
- name "QualifiedByReferenceContainer"
- value "AssociationByReference(sizeof($qualtype), sizeof($qualcont))")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByReferenceContainer"
- value "DictionaryByReference(sizeof($qualtype), sizeof($qualcont))")
- (object Attribute
- tool "cg"
- name "PathSeparator"
- value "")
- (object Attribute
- tool "cg"
- name "FileNameFormat"
- value "128vx_b")
- (object Attribute
- tool "cg"
- name "AlwaysKeepOrphanedCode"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "compiler3.0__Project"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerAnnotations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerVersion"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HeaderFileExtension"
- value "h")
- (object Attribute
- tool "cg"
- name "HeaderFileBackupExtension"
- value "h~")
- (object Attribute
- tool "cg"
- name "HeaderFileTemporaryExtension"
- value "h#")
- (object Attribute
- tool "cg"
- name "CodeFileExtension"
- value "cpp")
- (object Attribute
- tool "cg"
- name "CodeFileBackupExtension"
- value "cp~")
- (object Attribute
- tool "cg"
- name "CodeFileTemporaryExtension"
- value "cp#")
- (object Attribute
- tool "cg"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "cg"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "cg"
- name "Directory"
- value "$ROSECPP_SOURCE")
- (object Attribute
- tool "cg"
- name "BooleanType"
- value "int")
- (object Attribute
- tool "cg"
- name "AllowTemplates"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AllowExplicitInstantiations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowProtectedInheritance"
- value TRUE)
- (object Attribute
- tool "cg"
- name "OneByValueContainer"
- value "$targetClass")
- (object Attribute
- tool "cg"
- name "OneByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "OptionalByValueContainer"
- value "OptionalByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "OptionalByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "FixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "FixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "BoundedByValueContainer"
- value "BoundedListByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByValueContainer"
- value "BoundedSetByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "BoundedByReferenceContainer"
- value "BoundedListByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByReferenceContainer"
- value "BoundedSetByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnboundedByValueContainer"
- value "UnboundedListByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByValueContainer"
- value "UnboundedSetByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnboundedByReferenceContainer"
- value "UnboundedListByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByReferenceContainer"
- value "UnboundedSetByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "QualifiedByValueContainer"
- value "AssociationByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByValueContainer"
- value "DictionaryByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "QualifiedByReferenceContainer"
- value "AssociationByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByReferenceContainer"
- value "DictionaryByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "PathSeparator"
- value "")
- (object Attribute
- tool "cg"
- name "FileNameFormat"
- value "128vx_b")
- (object Attribute
- tool "cg"
- name "AlwaysKeepOrphanedCode"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "ImplementationType"
- value "")
- (object Attribute
- tool "cg"
- name "ClassKey"
- value "class")
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "PutBodiesInSpec"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDefaultConstructor"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "DefaultConstructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ExplicitDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateCopyConstructor"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "CopyConstructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineCopyConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ExplicitCopyConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDestructor"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DestructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "DestructorKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineDestructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateAssignmentOperation"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "AssignmentVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "AssignmentKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineAssignmentOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateEqualityOperations"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "EqualityVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "EqualityKind"
- value ("FriendKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineEqualityOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateRelationalOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "RelationalVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "RelationalKind"
- value ("FriendKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineRelationalOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateStorageMgmtOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "StorageMgmtVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineStorageMgmtOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateSubscriptOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "SubscriptVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "SubscriptKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "SubscriptResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineSubscriptOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDereferenceOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DereferenceVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "DereferenceKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "DereferenceResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineDereferenceOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateIndirectionOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IndirectionVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "IndirectionKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "IndirectionResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineIndirectionOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateStreamOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "StreamVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineStreamOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ThreeKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)))
- (object Attribute
- tool "cg"
- name "KindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)))
- (object Attribute
- tool "cg"
- name "FriendKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GenerateSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "DeclareAndDefine"
- value 199)
- (object Attribute
- tool "cg"
- name "DeclareOnly"
- value 205)
- (object Attribute
- tool "cg"
- name "DoNotDeclare"
- value 206)))
- (object Attribute
- tool "cg"
- name "VisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)))))
- (object Attribute
- tool "cg"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "CmIdentification"
- value (value Text " %X% %Q% %Z% %W%"))
- (object Attribute
- tool "cg"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "AllowExtensionlessFileName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "IncludeFormat"
- value (value Text
-|// $package
-|#include "$file"
-|
- ))
- (object Attribute
- tool "cg"
- name "IncludeBySimpleName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludePrecompiledHeader"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludeOrder"
- value "AMIR")
- (object Attribute
- tool "cg"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "InliningStyle"
- value ("InliningStyleSet" 207))
- (object Attribute
- tool "cg"
- name "InliningStyleSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InClassDeclaration"
- value 208)
- (object Attribute
- tool "cg"
- name "FollowingClassDeclaration"
- value 207)))
- (object Attribute
- tool "cg"
- name "TypesDefined"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "IncludeClosure"
- value (value Text ""))))
- (object Attribute
- tool "cg"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "CmIdentification"
- value (value Text " %X% %Q% %Z% %W%"))
- (object Attribute
- tool "cg"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "AllowExtensionlessFileName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludeFormat"
- value (value Text
-|// $package
-|#include "$file"
-|
- ))
- (object Attribute
- tool "cg"
- name "IncludeBySimpleName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludePrecompiledHeader"
- value TRUE)
- (object Attribute
- tool "cg"
- name "IncludeOrder"
- value "AMIR")
- (object Attribute
- tool "cg"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "InliningStyle"
- value ("InliningStyleSet" 207))
- (object Attribute
- tool "cg"
- name "InliningStyleSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InClassDeclaration"
- value 208)
- (object Attribute
- tool "cg"
- name "FollowingClassDeclaration"
- value 207)))
- (object Attribute
- tool "cg"
- name "TypesDefined"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "IncludeClosure"
- value (value Text ""))))
- (object Attribute
- tool "cg"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "OperationKind"
- value ("OperationKindSet" 200))
- (object Attribute
- tool "cg"
- name "OperationKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GenerateAbstractBody"
- value FALSE)
- (object Attribute
- tool "cg"
- name "SpecialDeclReturnType"
- value "")
- (object Attribute
- tool "cg"
- name "OperationIsConst"
- value FALSE)
- (object Attribute
- tool "cg"
- name "OperationIsExplicit"
- value FALSE)
- (object Attribute
- tool "cg"
- name "Inline"
- value FALSE)
- (object Attribute
- tool "cg"
- name "EntryCode"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "ExitCode"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "CCRegion"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "BodyAnnotations"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "Ordered"
- value TRUE)
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$supplier")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "InitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$relationship")
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$relationship")
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "cg"
- name "SelectorName"
- value "")
- (object Attribute
- tool "cg"
- name "SelectorType"
- value "")
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HasRelTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Array"
- value 24)
- (object Attribute
- tool "cg"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "cg"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$targetClass")))
- (object Attribute
- tool "cg"
- name "default__Inherit"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InstanceArguments"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$targetClass")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$target")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "InitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "cg"
- name "ContainerGet"
- value "$data.get($keys)")
- (object Attribute
- tool "cg"
- name "ContainerSet"
- value "$data.set($keys,$value)")
- (object Attribute
- tool "cg"
- name "QualifiedContainer"
- value "")
- (object Attribute
- tool "cg"
- name "AssocClassContainer"
- value "$supplier *")
- (object Attribute
- tool "cg"
- name "AssocClassInitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetSetByReference"
- value ("QualifiedGetSetByReferenceSet" 2))
- (object Attribute
- tool "cg"
- name "QualifiedGetSetByReferenceSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_GetSetByReference"
- value 2)))
- (object Attribute
- tool "cg"
- name "GenerateQualifiedGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "QualifiedGetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "InlineQualifiedGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateQualifiedSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedSetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "QualifiedSetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineQualifiedSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateAssocClassDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberName"
- value "$target")
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AssocClassGetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GenerateAssocClassGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassGetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "AssocClassGetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassGetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "InlineAssocClassGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateAssocClassSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassSetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "AssocClassSetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineAssocClassSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassForwardReferenceOnly"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Array"
- value 24)
- (object Attribute
- tool "cg"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "cg"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$attribute")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtAttributeVisibility"
- value 211)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$attribute")
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$attribute")
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "CCRegion"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Uses"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "BodyReferenceOnly"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Directory"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "DirectoryIsOnSearchList"
- value FALSE)
- (object Attribute
- tool "cg"
- name "PrecompiledHeader"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "IsNamespace"
- value FALSE)
- (object Attribute
- tool "cg"
- name "Indent"
- value 2)
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))))
- (object Attribute
- tool "MSVC"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "MSVC"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Version"
- value "5.0")))
- (object Attribute
- tool "MSVC"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCClassTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCClassTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Interface_Part"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Connection_Part"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Class_Factory"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "CObjectFunctionality"
- value ("CObjectFunctionalitySet" 0))
- (object Attribute
- tool "MSVC"
- name "CObjectFunctionalitySet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "None"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Dynamic"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Dyncreate"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Serial"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "GenerateOverrideGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "GenerateDataGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DATA_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateFieldGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_FIELD_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateMessageGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "GenerateMessageMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MESSAGE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "OLEFactory"
- value ("OLEFactorySet" 0))
- (object Attribute
- tool "MSVC"
- name "OLEFactorySet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "None"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Built_in"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Simple"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Licensed"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "OLEName"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLEClassID"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateOLECtlType"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLECtlType"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateOLETypeLib"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLETypeLibID"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLETypeLibMajor"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLETypeLibMinor"
- value "")
- (object Attribute
- tool "MSVC"
- name "GeneratePropPageIDs"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLEPropPageIDs"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateDispatchMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockProperties"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockFunctions"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DispatchDefValue"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateDispIdEnum"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DISP_ID_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInterfaceMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "INTERFACE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "InitInterface"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateEventMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockEvents"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateEventSinkMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "PropNotifySinks"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateConnectionMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "CONNECTION_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "ConnectionPointIID"
- value "")
- (object Attribute
- tool "MSVC"
- name "InheritanceType"
- value "")
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLECommands"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MFCDeclares"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MFCImplements"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "ATL_Declares"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateCOMMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "COM_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateConnectionPointMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "CONNECTION_POINT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateMsgMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GeneratePropertyMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "PROPERTY_MAP_Entries"
- value (value Text ""))))
- (object Attribute
- tool "MSVC"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCOperationTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCOperationTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Virtual_Override"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Message_Handler"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dispatch_Handler"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Event_Firing_Function"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Event_Sink_Handler"
- value 5)
- (object Attribute
- tool "MSVC"
- name "Std_OLE_Method"
- value 6)
- (object Attribute
- tool "MSVC"
- name "Command_Parser"
- value 7)
- (object Attribute
- tool "MSVC"
- name "Property_Get_Function"
- value 8)
- (object Attribute
- tool "MSVC"
- name "Property_Set_Function"
- value 9)
- (object Attribute
- tool "MSVC"
- name "Property_Notify_Function"
- value 10)
- (object Attribute
- tool "MSVC"
- name "Macro_Generated_Function"
- value 11)))
- (object Attribute
- tool "MSVC"
- name "AFX_MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MESSAGE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "BodyImage"
- value (value Text ""))))
- (object Attribute
- tool "MSVC"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "GenerateIncludesGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_INCLUDES_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInsertLocation"
- value FALSE)))
- (object Attribute
- tool "MSVC"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "GenerateIncludesGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_INCLUDES_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInsertLocation"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Rose Model Integrator"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Rose Web Publisher"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "COM"
- name "propertyId"
- value "783606378")
- (object Attribute
- tool "COM"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "TypeKinds"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "enum"
- value 100)
- (object Attribute
- tool "COM"
- name "record"
- value 101)
- (object Attribute
- tool "COM"
- name "module"
- value 102)
- (object Attribute
- tool "COM"
- name "interface"
- value 103)
- (object Attribute
- tool "COM"
- name "dispinterface"
- value 104)
- (object Attribute
- tool "COM"
- name "coclass"
- value 105)
- (object Attribute
- tool "COM"
- name "alias"
- value 106)
- (object Attribute
- tool "COM"
- name "union"
- value 107)
- (object Attribute
- tool "COM"
- name "max"
- value 108)
- (object Attribute
- tool "COM"
- name "(none)"
- value 109)))
- (object Attribute
- tool "COM"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "COM"
- name "kind"
- value ("TypeKinds" 109))
- (object Attribute
- tool "COM"
- name "uuid"
- value "")
- (object Attribute
- tool "COM"
- name "version"
- value "")
- (object Attribute
- tool "COM"
- name "helpstring"
- value "")
- (object Attribute
- tool "COM"
- name "helpcontext"
- value "")
- (object Attribute
- tool "COM"
- name "attributes"
- value "")
- (object Attribute
- tool "COM"
- name "dllname"
- value "")
- (object Attribute
- tool "COM"
- name "alias"
- value "")))
- (object Attribute
- tool "COM"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "COM"
- name "id"
- value "")
- (object Attribute
- tool "COM"
- name "helpstring"
- value "")
- (object Attribute
- tool "COM"
- name "attributes"
- value "")))
- (object Attribute
- tool "COM"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "COM"
- name "id"
- value "")
- (object Attribute
- tool "COM"
- name "helpstring"
- value "")
- (object Attribute
- tool "COM"
- name "attributes"
- value "")))
- (object Attribute
- tool "COM"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "COM"
- name "filename"
- value "")
- (object Attribute
- tool "COM"
- name "library"
- value "")
- (object Attribute
- tool "COM"
- name "uuid"
- value "")
- (object Attribute
- tool "COM"
- name "version"
- value "")
- (object Attribute
- tool "COM"
- name "helpstring"
- value "")
- (object Attribute
- tool "COM"
- name "helpfile"
- value "")
- (object Attribute
- tool "COM"
- name "helpcontext"
- value "")
- (object Attribute
- tool "COM"
- name "lcid"
- value "")
- (object Attribute
- tool "COM"
- name "attributes"
- value "")))
- (object Attribute
- tool "COM"
- name "default__Param"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "attributes"
- value "")))
- (object Attribute
- tool "COM"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Version Control"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "propertyId"
- value "783606378")
- (object Attribute
- tool "Visual Basic"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "UpdateCode"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "UpdateModel"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "InstancingSet"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "Private"
- value 221)
- (object Attribute
- tool "Visual Basic"
- name "PublicNotCreatable"
- value 213)
- (object Attribute
- tool "Visual Basic"
- name "SingleUse"
- value 214)
- (object Attribute
- tool "Visual Basic"
- name "GlobalSingleUse"
- value 215)
- (object Attribute
- tool "Visual Basic"
- name "MultiUse"
- value 219)
- (object Attribute
- tool "Visual Basic"
- name "GlobalMultiUse"
- value 220)))
- (object Attribute
- tool "Visual Basic"
- name "BaseSet"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "(none)"
- value 222)
- (object Attribute
- tool "Visual Basic"
- name "0"
- value 223)
- (object Attribute
- tool "Visual Basic"
- name "1"
- value 224)))
- (object Attribute
- tool "Visual Basic"
- name "OptionBase"
- value ("BaseSet" 222))
- (object Attribute
- tool "Visual Basic"
- name "OptionExplicit"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "OptionCompare"
- value ("CompareSet" 202))
- (object Attribute
- tool "Visual Basic"
- name "Instancing"
- value ("InstancingSet" 219))
- (object Attribute
- tool "Visual Basic"
- name "CompareSet"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "(none)"
- value 202)
- (object Attribute
- tool "Visual Basic"
- name "Binary"
- value 203)
- (object Attribute
- tool "Visual Basic"
- name "Text"
- value 204)))))
- (object Attribute
- tool "Visual Basic"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "LibraryName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "AliasName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "IsStatic"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ProcedureID"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "ReplaceExistingBody"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "DefaultBody"
- value (value Text ""))))
- (object Attribute
- tool "Visual Basic"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "New"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "WithEvents"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ProcedureID"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "PropertyName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "Subscript"
- value "")))
- (object Attribute
- tool "Visual Basic"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "UpdateCode"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "New"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "WithEvents"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "FullName"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ProcedureID"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "PropertyName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "Subscript"
- value "")))
- (object Attribute
- tool "Visual Basic"
- name "default__Inherit"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "ImplementsDelegation"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "FullName"
- value FALSE)))
- (object Attribute
- tool "Visual Basic"
- name "default__Param"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "ByVal"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ByRef"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "Optional"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ParamArray"
- value FALSE)))
- (object Attribute
- tool "Visual Basic"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "ProjectFile"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "UpdateCode"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "UpdateModel"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "ImportReferences"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "QuickImport"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "ImportBinary"
- value FALSE)))
- (object Attribute
- tool "Visual Basic"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "VisualStudio"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Web Modeler"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "XML_DTD"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "XML_DTD"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "XML_DTD"
- name "Editor"
- value ("EditorType" 100))
- (object Attribute
- tool "XML_DTD"
- name "StopOnError"
- value TRUE)
- (object Attribute
- tool "XML_DTD"
- name "EditorType"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "BuiltIn"
- value 100)
- (object Attribute
- tool "XML_DTD"
- name "WindowsShell"
- value 101)))))
- (object Attribute
- tool "XML_DTD"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "Entity_SystemID"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "Entity_PublicID"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "NotationValue"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "InternalValue"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "ParameterEntity"
- value FALSE)
- (object Attribute
- tool "XML_DTD"
- name "ExternalEntity"
- value FALSE)
- (object Attribute
- tool "XML_DTD"
- name "Notation_SystemID"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "Notation_PublicID"
- value "")))
- (object Attribute
- tool "XML_DTD"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "DefaultDeclType"
- value "")))
- (object Attribute
- tool "XML_DTD"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "Assign All"
- value FALSE)
- (object Attribute
- tool "XML_DTD"
- name "ComponentPath"
- value "")))
- (object Attribute
- tool "XML_DTD"
- name "HiddenTool"
- value FALSE))
- quid "3B704565018E"))
diff --git a/plugins/org.eclipse.jst.j2ee/rose/modulemap.ecore b/plugins/org.eclipse.jst.j2ee/rose/modulemap.ecore deleted file mode 100644 index 00580f2bf..000000000 --- a/plugins/org.eclipse.jst.j2ee/rose/modulemap.ecore +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="modulemap" - nsURI="http:///modulemap.ecore" nsPrefix="modulemap"> - <eClassifiers xsi:type="ecore:EClass" name="ModuleMapping"> - <eReferences name="module" eType="ecore:EClass ../../com.ibm.etools.j2ee.core/rose/application.ecore#//Module" - lowerBound="1"/> - <eAttributes name="projectName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> - </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="EARProjectMap"> - <eReferences name="mappings" eType="#//ModuleMapping" upperBound="-1" containment="true"/> - <eReferences name="utilityJARMappings" eType="#//UtilityJARMapping" lowerBound="1" - upperBound="-1" containment="true"/> - </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="UtilityJARMapping"> - <eAttributes name="projectName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> - <eAttributes name="uri" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> - </eClassifiers> -</ecore:EPackage> diff --git a/plugins/org.eclipse.jst.j2ee/schema/ClasspathDep.exsd b/plugins/org.eclipse.jst.j2ee/schema/ClasspathDep.exsd deleted file mode 100644 index dbbb0d65a..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/ClasspathDep.exsd +++ /dev/null @@ -1,110 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.j2ee"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.j2ee" id="classpathdep" name="Classpath Dependency Extension"/> - </appInfo> - <documentation> - This extension point supports customization of the classpath dependency functionality whereby project classpath entries can be tagged for contribution to the published/exported structure of the module. - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <sequence> - <element ref="filteredClasspathContainer" minOccurs="1" maxOccurs="unbounded"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute translatable="true"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="filteredClasspathContainer"> - <annotation> - <documentation> - Specified a classpath container that should be filtered from the list of classpath containers considered as potential contributions to the published/exported structure of the module. - </documentation> - </annotation> - <complexType> - <attribute name="containerID" type="string"> - <annotation> - <documentation> - Classpath container ID. - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - 2.0 - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - [Enter API information here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - [Enter information about supplied implementation of this extension point.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - Copyright (c) 2007 BEA Systems, Inc.<br> -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 <a -href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.j2ee/schema/DeployerExtension.exsd b/plugins/org.eclipse.jst.j2ee/schema/DeployerExtension.exsd deleted file mode 100644 index 5f66b3611..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/DeployerExtension.exsd +++ /dev/null @@ -1,146 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.j2ee">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.j2ee" id="DeployerExtension" name="J2EE Deployer Extension"/>
- </appInfo>
- <documentation>
- The extension point gives the ability to extend deployer operations on J2EE artifacts, for eg, EJB deployment and Webservices deployment. Registration of the deployer is based on module type and server target.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="deployer"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="deployer">
- <complexType>
- <sequence>
- <element ref="runtime" minOccurs="1" maxOccurs="unbounded"/>
- <choice>
- <element ref="nature"/>
- <element ref="component"/>
- </choice>
- </sequence>
- <attribute name="deployer_class" type="string" use="required">
- <annotation>
- <documentation>
- the qualified name of the class to be used as the deployer
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtime">
- <complexType>
- <attribute name="runtime_server_id" type="string" use="required">
- <annotation>
- <documentation>
- the runtime server id for this deployer
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="nature">
- <complexType>
- <attribute name="module_nature_id" type="string" use="required">
- <annotation>
- <documentation>
- the support module nature id
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="component">
- <complexType>
- <attribute name="component_type" type="string" use="required">
- <annotation>
- <documentation>
- the supported component type for this deployer
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.<br>
-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 <a
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.j2ee/schema/EARModuleExtension.exsd b/plugins/org.eclipse.jst.j2ee/schema/EARModuleExtension.exsd deleted file mode 100644 index cd9206d9e..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/EARModuleExtension.exsd +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.j2ee">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.j2ee" id="EARModuleExtension" name="EAR Module Extension"/>
- </appInfo>
- <documentation>
- The api's for EJB, JCA and Web modules are defined in plugins separate from J2EE plugin. Those plugins have dependencies on the J2EE plugin, but not vice versa. In order for code defined within the J2EE plugin to access api's in these modules we need this extension point.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="earModuleExtension"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="earModuleExtension">
- <complexType>
- <attribute name="extensionClass" type="string" use="required">
- <annotation>
- <documentation>
- The class for the module extension.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.<br>
-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 <a
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.j2ee/schema/EJBCommandExtension.exsd b/plugins/org.eclipse.jst.j2ee/schema/EJBCommandExtension.exsd deleted file mode 100644 index 26ffe688e..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/EJBCommandExtension.exsd +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.j2ee">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.j2ee" id="EJBCommandExtension" name="EJB Command Extension"/>
- </appInfo>
- <documentation>
- Mainly used to overwrite delete and update commands for ejb's. For eg the extension was used to overwrite delete bean command.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="command"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="command">
- <complexType>
- <sequence>
- <element ref="run"/>
- </sequence>
- <attribute name="key" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="run">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.<br>
-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 <a
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.j2ee/schema/J2EEModelProvider.exsd b/plugins/org.eclipse.jst.j2ee/schema/J2EEModelProvider.exsd deleted file mode 100644 index 49ac8da8b..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/J2EEModelProvider.exsd +++ /dev/null @@ -1,134 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.j2ee"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.j2ee" id="J2EEModelProvider" name="J2EE Model Provider"/> - </appInfo> - <documentation> - [Enter description of this extension point.] - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute translatable="true"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="provider"> - <complexType> - <sequence minOccurs="1" maxOccurs="unbounded"> - <element ref="modelProvider"/> - <element ref="facet"/> - </sequence> - </complexType> - </element> - - <element name="modelProvider"> - <complexType> - <attribute name="factoryClass" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="priority" type="string"> - <annotation> - <documentation> - Default priority is 100, use a smaller # to override the default. - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <element name="facet"> - <complexType> - <attribute name="id" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="versions" type="string" use="required"> - <annotation> - <documentation> - list of facet versions comma seperated - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - [Enter the first release in which this extension point appears.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - [Enter extension point usage example here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - [Enter API information here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - [Enter information about supplied implementation of this extension point.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.j2ee/schema/J2EEModulePostImport.exsd b/plugins/org.eclipse.jst.j2ee/schema/J2EEModulePostImport.exsd deleted file mode 100644 index 6f17da52e..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/J2EEModulePostImport.exsd +++ /dev/null @@ -1,121 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.j2ee">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.j2ee" id="J2EEModulePostImport" name="J2EE Module Post Import"/>
- </appInfo>
- <documentation>
- This extension-point sends notification to all extensions when J2EEModules are imported. Each extension can specify a set of different module types to listen for or listen to them all. The default is to receive notification for all module types. Notification is sent
-to the specified class implementing com.ibm.etools.j2ee.J2EEModulePostImportHandler.
-
-Both of the following examples register for notification for all J2EEModule types, the first uses the defaults, while the second specifies each module type. To listen for only specific module types, use the second example and specify only the types to listen to.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="postImport"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="postImport">
- <complexType>
- <sequence>
- <element ref="module" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="className" type="string" use="required">
- <annotation>
- <documentation>
- the qualified class name to call during post import
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="module">
- <complexType>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- the J2EE module type to run post import on
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.<br>
-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 <a
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.j2ee/schema/WSDLServiceHelper.exsd b/plugins/org.eclipse.jst.j2ee/schema/WSDLServiceHelper.exsd deleted file mode 100644 index 3954682a0..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/WSDLServiceHelper.exsd +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.j2ee"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.j2ee" id="SpecializedModuleImport" name="Specialized Module Import"/> - </appInfo> - <documentation> - This extension point gives the ability to treat a jar file which is not an ejb jar file as an ejb jar file during ejb jar import. - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <sequence> - <element ref="wsdlHelper"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - a fully qualified identifier of the target extension point - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - an optional identifier of the extension instance - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - an optional name of the extension instance - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <element name="wsdlHelper"> - <complexType> - <attribute name="helperClass" type="string" use="required"> - <annotation> - <documentation> - helperClass is the handler class for the extension point. - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b> - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - Copyright (c) 2005 IBM Corporation and others.<br> -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 <a -href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.j2ee/schema/WebServiceClientGenerator.exsd b/plugins/org.eclipse.jst.j2ee/schema/WebServiceClientGenerator.exsd deleted file mode 100644 index 0c14384e5..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/WebServiceClientGenerator.exsd +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.j2ee">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.j2ee" id="WebServiceClientGenerator" name="Web Service Client Generator"/>
- </appInfo>
- <documentation>
- Extended by WAS or axis in generating web service client specific artifacts.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="generator"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="generator">
- <complexType>
- <sequence>
- <element ref="runtime" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="className" type="string" use="required">
- <annotation>
- <documentation>
- the qualifed class name to be used as the web service client generator
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtime">
- <complexType>
- <attribute name="serverTarget" type="string" use="required">
- <annotation>
- <documentation>
- the name of runtime server target where this client generator is used
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.<br>
-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 <a
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.j2ee/schema/archiveExportParticipants.exsd b/plugins/org.eclipse.jst.j2ee/schema/archiveExportParticipants.exsd deleted file mode 100644 index 374458262..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/archiveExportParticipants.exsd +++ /dev/null @@ -1,183 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.j2ee"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.j2ee" id="archiveExportParticipants" name="Archive Export Participants Extension Point"/> - </appInfo> - <documentation> - Used for extending the archive export operation. - </documentation> - </annotation> - - <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/> - - <element name="extension"> - <complexType> - <sequence> - <element ref="participant" minOccurs="1" maxOccurs="unbounded"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute translatable="true"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="participant"> - <annotation> - <documentation> - Registers a single archive export participant. - </documentation> - </annotation> - <complexType> - <sequence> - <element ref="runtime-component"/> - <element ref="factory"/> - <element ref="enablement" minOccurs="0" maxOccurs="1"/> - </sequence> - <attribute name="id" type="string" use="required"> - <annotation> - <documentation> - The unique identifier for this participant. This should not include the plugin id. Plugin id will be automatically prepended to the supplied id. - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <element name="runtime-component"> - <annotation> - <documentation> - Specifies the type of the runtime component that has to be present in the selected runtime in order for this participant to be applicable. - </documentation> - </annotation> - <complexType> - <attribute name="type" type="string" use="required"> - <annotation> - <documentation> - The type id of the runtime component. - </documentation> - </annotation> - </attribute> - <attribute name="version" type="string"> - <annotation> - <documentation> - Optional version or a version expression. - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <element name="factory"> - <annotation> - <documentation> - Registers the factory class that the framework will use for constructing the participant's data model and operation. - </documentation> - </annotation> - <complexType> - <attribute name="class" type="string" use="required"> - <annotation> - <documentation> - The factory implementation class. - </documentation> - <appInfo> - <meta.attribute kind="java" basedOn=":org.eclipse.jst.j2ee.archive.IArchiveExportParticipant"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - 3.0 - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - This example registers an export participant that's applicable to runtimes that contain "my.runtime.type" component type and to projects that have either the web or ear project facet. - -<pre> -<extension point="org.eclipse.jst.j2ee.archiveExportParticipants"> - <participant id="MyExportParticipant"> - <runtime-component type="my.runtime.type" version="[1.0-3.0)"/> - <factory class="com.somecorp.MyExportParticipant"/> - <enablement> - <or> - <test - forcePluginActivation="true" - property="org.eclipse.wst.common.project.facet.core.projectFacet" - value="jst.web"/> - <test - forcePluginActivation="true" - property="org.eclipse.wst.common.project.facet.core.projectFacet" - value="jst.ear"/> - </or> - </enablement> - </participant> -</extension> -</pre> - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - Copyright (c) 2005, 2007 BEA Systems, Inc. and others.<br> -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 <a -href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.j2ee/schema/optionalRefactorHandler.exsd b/plugins/org.eclipse.jst.j2ee/schema/optionalRefactorHandler.exsd deleted file mode 100644 index b672a3204..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/optionalRefactorHandler.exsd +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.j2ee"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.j2ee" id="optionalRefactorHandler" name="optionalRefactorHandlere"/> - </appInfo> - <documentation> - <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b> - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute translatable="true"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="optionalRefactorHandler"> - <complexType> - <attribute name="class" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute kind="java" basedOn="org.eclipse.jst.j2ee.refactor.operations.AbstractOptionalRefactorHandler"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b> - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - [Enter extension point usage example here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - [Enter API information here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - [Enter information about supplied implementation of this extension point.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.j2ee/schema/resourceEnvRefType.exsd b/plugins/org.eclipse.jst.j2ee/schema/resourceEnvRefType.exsd deleted file mode 100644 index 2155bcb1a..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/resourceEnvRefType.exsd +++ /dev/null @@ -1,136 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.j2ee">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.j2ee" id="resourceEnvRefType" name="Resource Environment Reference Type"/>
- </appInfo>
- <documentation>
- This extension point is used to add types to the drop down options available when creating or modifying Resource Environment References for a Application Client or EJB Project.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="reference"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="reference">
- <complexType>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- Valid resource environment reference types. Example: javax.jms.Topic
- </documentation>
- </annotation>
- </attribute>
- <attribute name="usage" use="required">
- <annotation>
- <documentation>
- The usage field is required. Valid types are Common, EJB Jar.
-A usage tag with the value Common indicates that the corresponding value will be avilable for all J2EE projects.
-A usage tag with the value EJB Jar indicates that the value is only applicable to EJB projects.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="Application Client">
- </enumeration>
- <enumeration value="EJB Jar">
- </enumeration>
- <enumeration value="Common">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="target-server-ids" type="string">
- <annotation>
- <documentation>
- list of target server id for this type
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of the extension:
-<pre>
- <extension
- point="org.eclipse.jst.j2ee.ui.resourceEnvRefType">
- <reference usage="Common" type="javax.sql.DataSource"/>
- <reference usage="EJB Jar" type="javax.jms.Topic"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- This extension point requires that the extension be defined in the plugin file of the extending plugin.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2005 IBM Corporation and others.<br>
-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 <a
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.j2ee/schema/resourceRefType.exsd b/plugins/org.eclipse.jst.j2ee/schema/resourceRefType.exsd deleted file mode 100644 index 4101126b4..000000000 --- a/plugins/org.eclipse.jst.j2ee/schema/resourceRefType.exsd +++ /dev/null @@ -1,136 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.j2ee">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.j2ee" id="resourceRefType" name="Resource Ref Type"/>
- </appInfo>
- <documentation>
- This extension point is used to add types to the drop down options available when creating or modifying Resource References for a Application Client or EJB Project.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="reference"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="reference">
- <complexType>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- Valid resource reference types. Example: javax.jms.Topic
- </documentation>
- </annotation>
- </attribute>
- <attribute name="usage" use="required">
- <annotation>
- <documentation>
- The usage field is required. Valid types are Common, EJB Jar.
-A usage tag with the value Common indicates that the corresponding value will be avilable for all J2EE projects.
-A usage tag with the value EJB Jar indicates that the value is only applicable to EJB projects.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="Application Client">
- </enumeration>
- <enumeration value="EJB Jar">
- </enumeration>
- <enumeration value="Common">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="target-server-ids" type="string">
- <annotation>
- <documentation>
- list of target server id for this resource reference target.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of the extension:
-<pre>
- <extension
- point="org.eclipse.jst.j2ee.ui.resourceRefType">
- <reference usage="Common" type="javax.jms.Queue"/>
- <reference usage="EJB Jar" type="javax.resource.cci.ConnectionFactory"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- This extension point requires that the extension be defined in the plugin file of the extending plugin.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2005 IBM Corporation and others.<br>
-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 <a
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.j2ee/smoke/construction3.gif b/plugins/org.eclipse.jst.j2ee/smoke/construction3.gif Binary files differdeleted file mode 100644 index e558d1ad7..000000000 --- a/plugins/org.eclipse.jst.j2ee/smoke/construction3.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/smoke/detour.gif b/plugins/org.eclipse.jst.j2ee/smoke/detour.gif Binary files differdeleted file mode 100644 index bf6cd868a..000000000 --- a/plugins/org.eclipse.jst.j2ee/smoke/detour.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/smoke/ejbrdb_smoke.html b/plugins/org.eclipse.jst.j2ee/smoke/ejbrdb_smoke.html deleted file mode 100644 index e735fe934..000000000 --- a/plugins/org.eclipse.jst.j2ee/smoke/ejbrdb_smoke.html +++ /dev/null @@ -1,787 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <meta name="Author" content="Raymond Leung"> - <meta name="GENERATOR" content="Mozilla/4.72 [en] (Windows NT 5.0; U) [Netscape]"> - <title>EJB-RDB Mapping Smoke Test</title> -</head> -<body> - -<h2> -EJB-RDB Mapping Smoke Test (07/12/01)</h2> - -<h3> -Top-down Scenario (also tests meet-in-middle functions):</h3> - -<ol> -<li> -Open an empty workbench.</li> - -<li> -Import university3.jar</li> - -<ol TYPE=a> -<li> -Select Menu "File/Import".</li> - -<li> -Select "EJB Jar File" as import source. Hit the "Next" button.</li> - -<li> -Enter the path name to the EJB Jar file "university3.jar" or use the "browse" -button to locate the jar file.</li> - -<li> -Give an EJB Project name "University".</li> - -<li> -Hit the "Finish" button to import everything in the jar file.</li> - -<li> -The wizard will take a while to import the EJB jar file.</li> - -<li> -Verify that a project named "University" has been created in the Navigator -view.</li> -</ol> - -<li> -Creating a Top-Down EJB-RDB Mapping</li> - -<ol TYPE=a> -<li> -Select the "University" project, right click to bring up the pop-up menu -and select "New/Others...".</li> - -<li> -A dialogue will come up. On the left pane, select "EJB". Then on the right -pane, select "EJB to RDB Mapping".</li> - -<li> -Hit the "Next" button.</li> - -<li> -Accept the default to create a Top Down mapping. Hit the "Next" button.</li> - -<li> -Accept the default for Target Database etc. and hit the "Next" button to -go to the Advanced Option page.</li> - -<li> -Mark the checkboxes for "VapFaculty", "VapInstructor" and "VapPartTimeInstructor" -and leave the checkbox for "VapSubstituteInstructor" unchecked.</li> - -<li> -Hit the "Finish" button. The wizard will now create the mappings.</li> - -<li> -Expand the "university" project if it is not already expanded by clicking -on the "+" sign.</li> - -<li> -Expand along the folders "University/ejbModule/META-INF". Verify that there -is a folder "Schema".</li> - -<li> -Expand the folder "Schema" and verify there is a file "Schema.dbxmi" in -it.</li> - -<li> -Verify that there is also a file "Map.mapxmi" in the "META-INF" folder.</li> -</ol> - -<li> -Open the Mapping</li> - -<ol TYPE=a> -<li> -Select the file "Map.mapxmi".</li> - -<li> -Double-click on it or select the menu item "Open" in the pop-up menu.</li> - -<li> -Verify that the mapping editor is launched in the main window.</li> - -<li> -Verify that at the upper left of the main window, the contents of the EJB -Jar is displayed, "VapFaculty", "VapCourse"...</li> - -<li> -Verify that at the upper right of the main window, the contents contains -a database named "SAMPLE" containing RDB Tables "VAPFACULTY", "VAPCOURSE"...</li> - -<li> -Verify that below the EJB Jar and RDB Table views is the Overview of the -mapping. Verify that both columns (EJBs and Tables) are not empty.</li> - -<li> -Look for the Outline View. If it is not open, it can be opened by selecting -from the "Perspective" menu "Perspective/Show View/Outline".</li> - -<li> -Verify that the outline view is not empty. Mappings are displayed using -the symbol "<->".</li> -</ol> - -<li> -Verify that different types of attributes and nested beans are imported.</li> - -<ol TYPE=a> -<li> -Expand the "VapFaculty" EJB in the EJBs view.</li> - -<li> -Verify that there is a "VapInstructor" EJB nested in it.</li> - -<li> -Verify that there are attributes "hireDate", "name", "numberOfDependents", -"salary", "facultyNumber", "address" and "deptSortKey". Verify that "facultyNumber" -is a key.</li> - -<li> -Verify that there are relationship roles "advisedStudents", "headsDepartment", -"classes" and "department".</li> - -<li> -Expand the "VapInstructor" EJB.</li> - -<li> -Verify that there are two EJBs nested inside it: "VapSubstituteInstructor" -and "VapPartTimeInstructor".</li> - -<li> -Verify that there is also an attribute "terminationDate" under "VapInstructor".</li> -</ol> - -<li> -Verify that the correct leaf tables are created.</li> - -<ol TYPE=a> -<li> -Inspect the Tables view on the right hand side.</li> - -<li> -Verify that there are tables "VAPFACULTY", "VAPINSTRUCTOR", "VAPPARTTIMEINSTRUCTOR".</li> - -<li> -Verify that there is NO table named "VAPSUBSTITUTEINSTRUCTOR". Remember -"VapSubstituteInstructor" wais not marked as a leaf table when the mapping -was created.</li> -</ol> - -<li> -Verify that the various views are in sync.</li> - -<ol TYPE=a> -<li> -Collapse "VapFaculty" in the EJBs view.</li> - -<li> -Select the "VapFaculty <-> VAPFACULTY" item (mapping) in the Outline -view. Verify that the corresponding items in the EJBs view, Tables view -and Overview view are selected.</li> - -<li> -Select the "VapCourse <-> VAPCOURSE" item in the Outline view -and verify the selected items in the other views are updated correspondingly.</li> - -<li> -Now, go to the EJBs view (upper left in the main window) and select the -"VapStudent" (single click). Verify that the "VapStudent <-> VAPSTUDENT" -item in the Outline view is selected. Also verify that "VapStudent" is -selected in the Overview view. However, the Tables view should still stay -on "VAPCOURSE".</li> - -<li> -Now, double-click "VapStudent" in the EJBs view, verify that "VAPSTUDENT" -in the Tables view is selected and no other selections should change.</li> - -<li> -Next, select "VAPSCHEDULEDCLASS" in the Tables view (upper right in the -main window) and verify that the selected items in the Outline view and -Overview view change to "VapScheduledClass" and "VapScheduledClass <-> -VAPSCHEDULEDCLASS" correspondingly. However, the selection in the EJBs -view should still stay on "VapStudent".</li> - -<li> -Now, double-click on "VAPSCHEDULEDCLASS" in the Tables view. verify that -"VapSheduledClass" in the EJBs view is selected. No other selections should -change.</li> - -<li> -Now, select "VapDepartment" in the first column of the Overview view and -verify that the corresponding items in the other views are updated.</li> - -<li> -Now, select "VAPSTAFF" in the 2nd column of the Overview view and verify -that the corresponding items in other views are updated.</li> -</ol> - -<li> -Verify nested EJB mappings</li> - -<ol TYPE=a> -<li> -Double-click on "VapFaculty" in the EJBs view. Verify that only "VAPFACULTY" -in the Tables view is selected.</li> - -<li> -Expand "VapFaculty" in the EJBs view. Double-click on "VapInstructor". -Verify that both "VAPFACULTY" and "VAPINSTRUCTOR" are selected in the Tables -view.</li> - -<li> -Expand "VapInstructor" in the EJBs view. Double-click on "VapSubstituteInstructor". -Verify that both "VAPFACULTY" and "VAPINSTRUCTOR" are selected in the Tables -view, i.e. same as for "VapInstructor".</li> - -<li> -Double-click on "VapPartTimeInstructor" in the EJBs view and verify that -"VAPFACULTY", "VAPINSTRUCTOR" and "VAPPARTTIMEINSTRUCTOR" in Tables view -are selected.</li> - -<li> -Now, double-click on "VAPFACULTY" in Tables view. Verify that "VapFaculty", -"VapInstructor", "VapSubstituteInstructor" and "VapPartTimeInstructor" -in the EJBs view are selected. Also verify that the 4 corresponding mappings -are selected in the Outline and Overview views.</li> - -<li> -Double-click on "VAPINSTRUCTOR" in the Tables view. Verify that "VapInstructor", -"VapSubstituteInstructor" and "VapPartTimeInstructor" in the EJBs view -are selected. Also verify the 3 corresponding mappings are selected in -the Outline and Overview views.</li> - -<li> -Double-click on "VAPPARTTIMEINSTRUCTOR" in the Tables view. Verify that -only "VapPartTimeInstructor" in the EJBs view is selected.</li> -</ol> - -<li> -Verify that deletion and undo/redo work</li> - -<ol TYPE=a> -<li> -Select "VapCourse <-> VAPCOURSE" mapping in the Outline view.</li> - -<li> -Right-click to bring up the pop-up menu and select "Delete".</li> - -<li> -Verify that the row corresponding to this mapping in the Overview view -disappeared.</li> - -<li> -Verify that the mapping icons for "VapFaculty" in the EJBs view and "VAPFACULTY" -in the Tables view now have a hollow circle indicating the items are not -mapped.</li> - -<li> -From the menu bar, select "Edit/Undo Remove" to undo the deletion. Verify -that "VapFaculty" and "VAPFACULTY" reappear in the Overview view, the mapping -"VapFaculty <-> VAPFACULTY" reappears in the Outline view and the mapping -icons in the EJBs view and Tables view become solid again.</li> - -<li> -Right-click on the "VapFaculty" item in the EJBs view to bring up the pop-up -menu and select "Redo Remove". Verify that it goes back to the state before -the undo step.</li> -</ol> - -<li> -Remove all tables. This is to prepare for the next two tests.</li> - -<ol TYPE=a> -<li> -Select all the tables in the Tables view by clicking on the first table -and then holding down the shift-key and clicking on the last table.</li> - -<li> -Select the "Delete" item from the "Edit" menu in the menu bar.</li> - -<li> -Verify that there are no mappings, other than the root EJB <-> Database -mapping, in the Overview and Outline views.</li> -</ol> - -<li> -Verify that copy and paste works.</li> - -<ol TYPE=a> -<li> -Select "VapStaff" in the EJBs view.</li> - -<li> -Right-click to bring up the pop-up menu and select "Copy".</li> - -<li> -Move over to the Tables view, right-click on "SAMPLE" and select "Paste".</li> - -<li> -Verify that a table "VAPSTAFF" is created and mappings are established -between the attributes in "VapStaff" and the columns in "VAPSTAFF".</li> -</ol> - -<li> -Verify that drag and drop works.</li> - -<ol TYPE=a> -<li> -Select "VapDepartment" in the EJBs view.</li> - -<li> -Drag and drop it onto "SAMPLE" in the Tables view.</li> - -<li> -Verify that a table "VAPDEPARTMENT" is created and mappings are established -between the attributes in "VapDepartment" and the columns in "VAPDEPARTMENT".</li> -</ol> - -<li> -Verify that there are no internal errors</li> - -<ol TYPE=a> -<li> -Because the EJBs cross reference each other and these cross references -are mapped to foreign keys in Tables, the columns and their mappings are -not complete until tables corresponding to all the EJBs are created. Expand -the tables "VAPSTAFF" and "VAPDEPARTMENT" and click on some of the columns -(especially the foreigh keys) to display their properties. Verify that -there are no internal errors or exceptions.</li> -</ol> - -<li> -Verify add/delete mapping actions are properly enabled</li> - -<ol TYPE=a> -<li> -Select "VapStaff" on the EJBs view. (single click)</li> - -<li> -Select "VAPSTAFF" on the Tables view. (single click)</li> - -<li> -Verify that the icons for removing/creating mappings and matching items -are disabled.</li> - -<li> -Click on the menu item "EJB to RDB Mapping Editor" in the menu bar and -verify that all the menu items for creating/removing mappings (including -matching items) are disabled.</li> - -<li> -Expand "VapStaff" in the EJBs view and select "salary".</li> - -<li> -Expand "VAPSTAFF" in the Tables view and select "SALARY".</li> - -<li> -Verify that the remove mapping icon is enabled.</li> - -<li> -Verify that the "Remove Mapping" menu item is enabled in the "EJB to RDB -Mapping Editor" menu.</li> -</ol> - -<li> -Remove mappings.</li> - -<ol TYPE=a> -<li> -Remove the mapping by clicking on the remove mapping icon (the scissors -icon).</li> - -<li> -Verify that the icons for "salary" and "SALARY" have a hollow circle indicating -there are no mappings for the two items.</li> - -<li> -Verify also that the corresponding items representing the mapping were -removed from the Overview and Outline views.</li> - -<li> -Go to the Overview view and expand "VapStaff" if it is not already expanded.</li> - -<li> -Select all the items under "VapStaff" (but not "VapStaff" itself) in the -first column. Use Shift-click or Ctrl-Click.</li> - -<li> -Right click to bring up the pop-up menu and select "Delete".</li> - -<li> -Verify all the mappings under "VapStaff" are deleted in both the Overview -and Outline views.</li> - -<li> -Verify the columns "SALARY", "NUMBER", "NAME" etc. still exist under "VAPSTAFF" -in the Tables view. Only the mappings were deleted, not the columns themselves.</li> - -<li> -Verify all the attributes under "VapStaff" and columns under "VAPSTAFF" -have no mappings by inspecting their icons.</li> -</ol> - -<li> -Verify that "Remove Mapping" is enabled only when there are no sub-mappings.</li> - -<ol TYPE=a> -<li> -Select "VapStaff" in the EJBs view and select "VAPSTAFF" in the Tables -view.</li> - -<li> -Verify that the "Remove Mapping", "Match by Name" and "Match by Type" icons -and menu itmes under "EJB to RDB Mapping Editor" are enabled. Verify that -the "Create Mapping" menu item is disabled because there is already a mapping -between "VapStaff" and "VAPSTAFF". We only deleted the mappings between -the attributes and columns, not between the EJB and Table.</li> -</ol> - -<li> -Rename column (Prepare for Match by Type/Name)</li> - -<ol TYPE=a> -<li> -Find the Properties view. If it is not visible, you can add it to your -workbench through the menu "Perspective/Show View/Properties".</li> - -<li> -Select the Column "SALARY" in Table "VAPSTAFF".</li> - -<li> -Go to the Properties view and click on the value of the property "Name". -This will make the string editable.</li> - -<li> -Move to the end of the string and add a "2", i.e. change the name from -"SALARY" to "SALARY2".</li> - -<li> -Hit the "Enter" key and verify that the name of the column is updated on -all the other views.</li> -</ol> - -<li> -Match by Type/Name.</li> - -<ol TYPE=a> -<li> -With "VapStaff" selected in the EJBs view and "VAPSTAFF" in the Tables -view, click the "Match by Name" icon or select the "Match by Name" menu -item under the "EJB to RDB Mapping Editor" menu.</li> - -<li> -Verify that "number", "name", "title", and "department" are mapped.</li> - -<li> -Reselect "VapStaff" in the EJBs view and "VAPSTAFF" in the Tables view.</li> - -<li> -Verify that now only the "Match by Type" icon and menu item is enabled.</li> - -<li> -Click the "Match by Type" icon.</li> - -<li> -Verify that the "salary" attribute under "VapStaff" is mapped.</li> -</ol> - -<li> -Verify role / foreign key mapping.</li> - -<ol TYPE=a> -<li> -Double-click on "department" under "VapStaff". Verify that the "DEPARTMENT" -foreign key under "VAPSTAFF" in the Tables view is selected.</li> - -<li> -Double-click on "DEPARTMENT" under "VAPSTAFF" in the Tables view. Verify -that two roles are selected in the EJBs view: the "department" role under -"VapStaff" and the "staff" (reverse) role under "VapDepartment".</li> -</ol> - -<li> -Undo the creatation of mappings.</li> - -<ol TYPE=a> -<li> -Select the "Undo" menu item under the "Edit" menu to undo the "Match by -Type" action.</li> - -<li> -Select the "Undo" menu item again to undo the "Match by Name" action.</li> - -<li> -Verify that all the items under "VapStaff" and "VAPSTAFF" are not mapped -by inspecting their icons.</li> -</ol> - -<li> -Verify that mapping icons are enabled base on types.</li> - -<ol TYPE=a> -<li> -Select "salary" under "VapStaff" in the EJBs view.</li> - -<li> -Select "SALARY" under "VAPSTAFF" in the Tables view.</li> - -<li> -Verify that the "Create Mapping", "Match by Type" and "Match by Name" icons -and menu items are enabled.</li> - -<li> -Select "NUMBER" under "VAPSTAFF" in the Tables view.</li> - -<li> -Verify that the "Create Mapping", "Match by Type" and "Match by Name" icons -and menu items are now disabled.</li> -</ol> - -<li> -Verify Redo of Match commands work.</li> - -<ol TYPE=a> -<li> -Select "Redo Match by Name" under the "Edit" menu on the menu bar.</li> - -<li> -Verify that now "number", "name", "title", and "department" are mapped.</li> - -<li> -Verify there are no exceptions or internal errors.</li> - -<li> -Select "Redo Match by Type" under the "Edit" menu on the menu bar.</li> - -<li> -Verify that now "salary" is also mapped.</li> -</ol> -</ol> - -<h3> -Bottom-Up Scenario:</h3> - -<ol> -<li> -Open an empty workbench or close all editors and delete the "University" -project.</li> - -<li> -Create a Database by importing the univeristy3.jar, creating a top-down -mapping and then deleting everything except the tables in the database.</li> - -<ol TYPE=a> -<li> -Import university3.jar and create a Top-Down EJB-RDB Mapping as described -in step 2 and 3 above.</li> - -<li> -Expand "University/ejbModule/META-INF" in the Navigator view.</li> - -<li> -Delete everything under the "University" project except "ejbModule/META-INF/Schema/Schema.dbxmi", -especially the "Map.mapxmi", "ejb-jar.xmi", "ibm-ejb-jar-bnd.xmi", "ibm-ejb-jar-ext.xmi" -files under "ejbModule/META-INF".</li> -</ol> - -<li> -Create a Bottom-Up Mapping.</li> - -<ol TYPE=a> -<li> -Select the project "University" in the Navigator view.</li> - -<li> -Right-click to bring up the pop-up menu. Select "Generate for enterprise -bean(s)/Create EJB to RDB Mapping".</li> - -<li> -A "Create new EJB/RDB Mapping" dialog will come up with the "Bottom Up" -option selected.</li> - -<li> -Hit the "Finish" button.</li> - -<li> -Verify that "ejb-jar.xml", "ibm-ejb-jar-ext.xmi" and "Map.mapxmi" are created -under "ejbModule/META-INF".</li> - -<li> -Verify that some java files are created under the "bottom/up" folder.</li> -</ol> - -<li> -Open the mapping.</li> - -<ol TYPE=a> -<li> -Select "Map.mapxmi" and double-click on it.</li> - -<li> -Expand all the EJBs and verify that all the attributes and roles are mapped -(i.e. the icons have solid circles)</li> - -<li> -Verify that all the attributes have a type.</li> - -<li> -Expand the EJB "Vapstaff".</li> - -<li> -Verify that the "salary" attribute has a type "java.math.BigDecimal".</li> - -<li> -Verify that the "number" attribute is a key (the icon has a key).</li> - -<li> -Verify that the type for "number" is "byte[]".</li> - -<li> -Verify that there is a role "department" and the type is "Vapdepartment".</li> -</ol> - -<li> -Verify that tables cannot be deleted.</li> - -<ol TYPE=a> -<li> -Select the table "VAPSTAFF" in the Tables view.</li> - -<li> -Right-click to bring up the pop-up menu and verify that the "Delete" item -is disabled.</li> - -<li> -Click on the "Edit' menu on the menu bar and verify that the "Delete" item -is disabled.</li> -</ol> - -<li> -Delete an EJB and undo.</li> - -<ol TYPE=a> -<li> -Select the EJB "Vapstaff" in the EJBs view.</li> - -<li> -Right-click to bring up the pop-up menu and select "Delete" to delete the -EJB "Vapstaff".</li> - -<li> -Verify that the EJB "Vapstaff" disappears from the EJBs view.</li> - -<li> -Verify that there are no mappings in the Outline and Overview views that -reference "Vapstaff" and "VAPSTAFF".</li> - -<li> -Verify that there is no mappings in the Outline and Overview views that -reference a null object.</li> - -<li> -Select "Edit/Undo Remove" from the menu bar.</li> - -<li> -Verify that the EJB "Vapstaff" reappears and all the mappings between "Vapstaff" -and "VAPSTAFF" also reappear.</li> -</ol> - -<li> -Change the name of an EJB.</li> - -<ol TYPE=a> -<li> -Open the Properties view if it is not already open by selecting "Perspective/Show -View/Properties".</li> - -<li> -Select "Vapstaff" in the EJBs view.</li> - -<li> -Click on the value field of the property "Name", i.e. the string "Vapstaff". -This should enable editing of the cell.</li> - -<li> -Change the string to "Vapstaff2". Hit the enter key.</li> - -<li> -Verify that "Vapstaff" is now changed to "Vapstaff2" in the EJBs view as -well as in the Overview and Outline views.</li> -</ol> - -<li> -Change properties of an EJB attribute.</li> - -<ol TYPE=a> -<li> -Select the "salary" attribute of "Vapstaff2".</li> - -<li> -Go to the Properties view and change the name to "salary2".</li> - -<li> -Hit the return key and verify that "salary" is changed to "salary2" everywhere.</li> - -<li> -Click on the value field for "Type" in the Properties view. The field should -turn into a combo box with a button on the right.</li> - -<li> -Click on the button to reveal the list of possible types. Select a different -type, say, "java.lang.Integer".</li> - -<li> -Verify that the type of the "salary2" is changed in all the various views.</li> -</ol> - -<li> -Order of EJBs can be re-arranged by drag-and-drop.</li> - -<ol TYPE=a> -<li> -Select the EJB "Vapstaff2" in the EJBs view.</li> - -<li> -Hold down the left mouse button and drag the item away from its location. -A horizontal line should appear as an indication the new position of the -dragged item. Move the mouse upwards until the line indicate that "Vapstaff2" -will be the first item in the ejb-jar. Release the mouse button.</li> - -<li> -Verify that "Vapstaff2" is now the first EJB in the ejb-jar.</li> -</ol> - -<li> -EJBs can be made subtypes by drag-and-drop.</li> - -<ol TYPE=a> -<li> -Select the EJB "Vapstaff2" in the EJBs view.</li> - -<li> -Hold down the left mouse button and drag and drop it onto EJB "Vapstudent".</li> - -<li> -Verify that "Vapstaff2" is now an unmapped subtype of "Vapstudent".</li> -</ol> - -<li> -Verify that the content of the Database cannot be changed.</li> - -<ol TYPE=a> -<li> -Select Table "VAPSTAFF". Click the left mouse button and drag the item -away from its current location.</li> - -<li> -Verify that no horizontal line appears and the order of the tables cannot -be changed.</li> -</ol> -</ol> - -</body> -</html> diff --git a/plugins/org.eclipse.jst.j2ee/smoke/slippery.gif b/plugins/org.eclipse.jst.j2ee/smoke/slippery.gif Binary files differdeleted file mode 100644 index 47ef4d9d2..000000000 --- a/plugins/org.eclipse.jst.j2ee/smoke/slippery.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee/smoke/smoke.html b/plugins/org.eclipse.jst.j2ee/smoke/smoke.html deleted file mode 100644 index 0e3e17402..000000000 --- a/plugins/org.eclipse.jst.j2ee/smoke/smoke.html +++ /dev/null @@ -1,202 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <meta name="Generator" content="Lotus Word Pro"> - <meta name="GENERATOR" content="Mozilla/4.74 [en] (Windows NT 5.0; U) [Netscape]"> - <title>Body</title> -</head> -<body bgcolor="#FFFFFF"> - -<h2> -J2EE (EJB) Smoke Test</h2> - -<ol> -<li> -Open an empty workbench.</li> - -<li> -Switch to the J2EE perspective: Perspective->Open->Other->J2EE</li> - -<ol> -<li> -Verify that the J2EE toolbar actions appear (create an EJB, create a Servlet, -create an EJB project, create an Application Client module, create a Web -Project, create EJB to RDB mapping, create and Enterprise Application)</li> - -<li> -Verify that the J2EE view appears in the navigator frame. It will probably -be empty.</li> - -<li> -Verify that the appropriate New menu items are visible, these are the project -actions from the toolbar, plus create a new EJB example</li> -</ol> - -<li> -Create a new EJB project for testing EJB creation. Press the "New EJB Project" -toolbar button. Call the project "TestEJBs", use the default location, -check the "Add to an EAR" option and call the ear "default_ear".</li> - -<ol> -<li> -Verify that a new EJB project called "TestEJBs" is created.</li> - -<ol> -<li> -The corresponding module should appear in the J2EE view in the EJB Modules -folder. (175916 - the module does not appear until it contains at least -one EJB.)</li> -</ol> - -<li> -Verify that a new EAR project called "default_app" is created.</li> - -<ol> -<li> -The corresponding module should appear in the J2EE view in the Enterprise -Applications folder. It should contain the nested EJB module.</li> -</ol> - -<li> -Open "default_app" by double-clicking in the J2EE view. The EAR editor -should be opened. Verify that the application.xml source looks good in -the source page.</li> - -<li> -Modify the module display name in the source page, switch to the General -page and verify that the change is reflected. Verify that save is enabled -for the application.xml. Save and close the editor. Re-open the editor -and verify the description change.</li> - -<li> -Modify the display name on the general page, and verify it in the source -page. Save should be enabled, and the resource tab should be marked dirty -(with a "*").</li> -</ol> - -<li> -Add a new session bean to the EJB module.</li> - -<ol> -<li> -Press the Create an Enterprise Java Bean toolbar button. This will -launch the new Enterprise Java Bean wizard. Name the bean "Hello", -select "Session bean" as the EJB type. Verify that the target project -is already selected.</li> - -<br><img SRC="construction3.gif" height=43 width=49>(175845) Project selection -is not being picked up from the J2EE view, so you'll need to manually select -the project for now. -<li> -Provide the package name for the generated classes by entering "testing" -into the first package name field. Verify that it propogates to the -other fields.</li> - -<li> -Press Finish to generate the Session bean classes.</li> - -<li> -Open the Java perspective: Perspective->Open Perspective->Other...->Java.</li> - -<br><img SRC="detour.gif" height=21 width=68 align=ABSCENTER> For now this -has to be done in the Java perspective, the generated classes will appear -in the J2EE view under the EJB when 175608 is implemented. -<ol> -<li> -In the package view, verify that the package "testing" appears under "TestEJBs\ejbModule".</li> - -<li> -Verify that the files hello.java, hellobean.java, and hellohome.java exist.</li> - -<li> -Switch to the J2EE view, the new EJB should appear under the "Test_EJB" -module in "EJB Modules".</li> -</ol> - -<li> -Add a test method to Hello. Open the java editor on hellobean.java -by double-clicking on it. Add a new method String sayHello(String) -using the Java tooling like so:</li> - -<br> public String sayHello(String message) { -<br> return "Hello, " + message + "!"; -<br> } -<li> -Add the method to the remote interface.</li> - -<br><img SRC="detour.gif" height=21 width=68 align=ABSCENTER> This is currently -done manually, by copying and pasting the method into the remote interface. -The method in the remote interface should appear like this: -<br> public String sayHello(String -message) throws java.rmi.RemoteException; -<br>Use code assist, ctrl-Space to lookup RemoteException, to verify that -the project's Java environment is working properly. -<br>When 175610 is completed, there will be a "Promote to remote interface" -menu item available on the specialized Bean class Java editor which will -do this for you.</ol> - -<li> -Open the EJB editor for "TestEJBs" by double-clicking on the module under -"EJB Modules"</li> - -<ol> -<li> -The EJB editor should be opened. Verify that the source for the ejb-jar -looks reasonable.</li> - -<br><img SRC="construction3.gif" height=43 width=49 align=TEXTTOP>(175817) -Once we get our DTD's registered, add a step to use code-assist in the -source page. -<ol> -<li> -Verify that the EJB editor is working properly. Edit the display -name field. When you tab out of that field, the display name in the -J2EE view should be updated. Sitch to the source page and verify -that the XML is also updated.</li> - -<br>Verify that source changes flow to the general page, too. In -the source page, copy and paste the display-name element from the JAR to -the Hello entity. The display-name element must be the first element -under <session>. Switch to the general tab, select Hello in the -Enterprise Beans list, and verify the display name you entered.</ol> -</ol> - -<li> -Generate Deployed code for Hello. Select the project TestEJBs, pop-up -Generate for enterprise beans...->Generate deployed code. Make sure -Hello is checked on the prompter, and hit finish.</li> - -<ol> -<li> -Switch to the Java perspective, and verify that three new .java files were -generated and do not have compile errors. They are EJSRemoteStatelessHello.java, -EJBRemoteStatelessHelloHome.java, and EJSStatelessHelloHomeBean.java.</li> -</ol> - -<li> -Generate RMIC code for Hello. Select the project TestEJBs, pop-up -Generate for enterprise beans...->Generate RMIC stub and tie code. -Make sure Hello is checked on the prompter, and hit finish.</li> - -<ol> -<li> -Switch to the Java perspective, and verify that a whole slew of incomprehensible -classes were generated in multiple packages, some of which have names like -_Hello_Stub.java, and _HelloHome_stub.java. Check the task list and -make sure there are no compile errors. Even better, make sure the -corresponding .class files exist in \bin\....</li> -</ol> - -<li> -<img SRC="slippery.gif" height=66 width=76>Next, testing with the unit -test environment...</li> - -<ol> -<li> -</li> -</ol> -</ol> - -</body> -</html> |