Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jst.common.frameworks')
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/.classpath7
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/.cvsignore7
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/.project28
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/META-INF/MANIFEST.MF29
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/about.html34
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/build.properties18
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/component.xml12
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/plugin.properties4
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/plugin.xml123
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/frameworks/CommonFrameworksPlugin.java51
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/ClasspathDecorations.java75
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/ClasspathDecorationsManager.java371
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainer.java512
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java119
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/IJavaProjectCreationProperties.java46
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModel.java217
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModelFactory.java63
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationDataModelProvider.java57
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationOperation.java122
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectValidationHandler.java56
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WTPWorkingCopyManager.java542
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManager.java49
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManagerFactory.java57
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyProvider.java60
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/IJavaFacetInstallDataModelProperties.java17
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetInstallDataModelProvider.java60
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetInstallDelegate.java112
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetRuntimeChangedDelegate.java60
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetUtils.java324
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetUtils.properties1
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetValidator.java71
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetValidator.properties1
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetVersionChangeDelegate.java80
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaProjectFacetCreationDataModelProvider.java30
-rw-r--r--plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/WtpUtils.java70
35 files changed, 0 insertions, 3485 deletions
diff --git a/plugins/org.eclipse.jst.common.frameworks/.classpath b/plugins/org.eclipse.jst.common.frameworks/.classpath
deleted file mode 100644
index 751c8f2e5..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jst.common.frameworks/.cvsignore b/plugins/org.eclipse.jst.common.frameworks/.cvsignore
deleted file mode 100644
index 2bd29c06b..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-temp.folder
-build.xml
-jdt_integration.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/plugins/org.eclipse.jst.common.frameworks/.project b/plugins/org.eclipse.jst.common.frameworks/.project
deleted file mode 100644
index 22c0bcb29..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.common.frameworks</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.common.frameworks/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.common.frameworks/META-INF/MANIFEST.MF
deleted file mode 100644
index fcf3c7508..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,29 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jst.common.frameworks; singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Vendor: %pluginVendor
-Bundle-Localization: plugin
-Export-Package:
- org.eclipse.jst.common.frameworks,
- org.eclipse.jst.common.jdt.internal.classpath;x-internal:=true,
- org.eclipse.jst.common.jdt.internal.integration;x-internal:=true,
- org.eclipse.jst.common.project.facet
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.jdt.launching;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.emf.ecore;bundle-version="[2.2.0,2.3.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.2.0,2.3.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jem.util;bundle-version="[1.2.0,1.3.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.core.commands;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jem.workbench;bundle-version="[1.2.0,1.3.0)",
- org.eclipse.wst.web;bundle-version="[1.1.0,1.2.0)"
diff --git a/plugins/org.eclipse.jst.common.frameworks/about.html b/plugins/org.eclipse.jst.common.frameworks/about.html
deleted file mode 100644
index 4ec598958..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/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>May 2, 2006</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.common.frameworks/build.properties b/plugins/org.eclipse.jst.common.frameworks/build.properties
deleted file mode 100644
index 37515139d..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/build.properties
+++ /dev/null
@@ -1,18 +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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- .,\
- META-INF/,\
- about.html,\
- plugin.properties
-src.includes = component.xml
diff --git a/plugins/org.eclipse.jst.common.frameworks/component.xml b/plugins/org.eclipse.jst.common.frameworks/component.xml
deleted file mode 100644
index 4a896475b..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model"
- name="org.eclipse.jst.common.frameworks">
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.jst.common.frameworks" fragment="false" />
- <plugin id="org.eclipse.jst.common.navigator.java" fragment="false" />
- <plugin id="org.eclipse.jst.common.annotations.controller"
- fragment="false" />
- <plugin id="org.eclipse.jst.common.annotations.core"
- fragment="false" />
- <plugin id="org.eclipse.jst.common.annotations.ui" fragment="false" />
-</component> \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/plugin.properties b/plugins/org.eclipse.jst.common.frameworks/plugin.properties
deleted file mode 100644
index 9dafe1dcd..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/plugin.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-jstJavaFacetDescription = Adds support for writing applications using Java programming language.
-javaVersionMismatchMarkerName = Faceted Project Problem (Java Version Mismatch)
-pluginName=Integration Plug-in
-pluginVendor=Eclipse.org \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/plugin.xml b/plugins/org.eclipse.jst.common.frameworks/plugin.xml
deleted file mode 100644
index 4aef042d6..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/plugin.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension
- id="context.Sensitive.Class.workingCopyManager"
- name="Working Copy Manager - Headless Context Class"
- point="org.eclipse.jem.util.uiContextSensitiveClass">
- <uiContextSensitiveClass
- key="workingCopyManager"
- context="Headless"
- className="org.eclipse.jst.common.jdt.internal.integration.WTPWorkingCopyManager">
- </uiContextSensitiveClass>
- </extension>
-
- <extension
- id="javaProjectValidationHandler"
- name="javaProjectValidationHandler"
- point="org.eclipse.wst.validation.validationSelectionHandler">
- <validationSelectionHandler
- id="javaProjectValidationHandler"
- handlerClass="org.eclipse.jst.common.jdt.internal.integration.JavaProjectValidationHandler"
- selectionType="org.eclipse.jdt.core.IJavaProject"/>
- </extension>
- <extension
- point="org.eclipse.wst.common.emfworkbench.integration.editModel">
- <editModel
- editModelID="jst.utility"
- factoryClass="org.eclipse.jst.common.jdt.internal.integration.JavaArtifactEditModelFactory">
- </editModel>
- </extension>
-
- <!-- Project Facets -->
- <extension point="org.eclipse.wst.common.project.facet.core.facets">
-
- <project-facet id="jst.java">
- <label>Java</label>
- <description>%jstJavaFacetDescription</description>
- </project-facet>
-
- <project-facet-version facet="jst.java" version="1.3">
- <action type="install">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetInstallDelegate"/>
- <config-factory class="org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider"/>
- </action>
- <action type="version-change">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetVersionChangeDelegate"/>
- </action>
- <event-handler type="RUNTIME_CHANGED">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetRuntimeChangedDelegate"/>
- </event-handler>
- <constraint>
- <conflicts facet="wst.web"/>
- </constraint>
- </project-facet-version>
-
- <project-facet-version facet="jst.java" version="1.4">
- <action type="install">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetInstallDelegate"/>
- <config-factory class="org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider"/>
- </action>
- <action type="version-change">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetVersionChangeDelegate"/>
- </action>
- <event-handler type="RUNTIME_CHANGED">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetRuntimeChangedDelegate"/>
- </event-handler>
- <constraint>
- <conflicts facet="wst.web"/>
- </constraint>
- </project-facet-version>
-
- <project-facet-version facet="jst.java" version="5.0">
- <action type="install">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetInstallDelegate"/>
- <config-factory class="org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider"/>
- </action>
- <action type="version-change">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetVersionChangeDelegate"/>
- </action>
- <event-handler type="RUNTIME_CHANGED">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetRuntimeChangedDelegate"/>
- </event-handler>
- <constraint>
- <conflicts facet="wst.web"/>
- </constraint>
- </project-facet-version>
-
- <project-facet-version facet="jst.java" version="6.0">
- <action type="install">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetInstallDelegate"/>
- <config-factory class="org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider"/>
- </action>
- <action type="version-change">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetVersionChangeDelegate"/>
- </action>
- <event-handler type="RUNTIME_CHANGED">
- <delegate class="org.eclipse.jst.common.project.facet.JavaFacetRuntimeChangedDelegate"/>
- </event-handler>
- <constraint>
- <conflicts facet="wst.web"/>
- </constraint>
- </project-facet-version>
-
- </extension>
-
- <extension point="org.eclipse.wst.common.project.facet.core.validators">
- <validator class="org.eclipse.jst.common.project.facet.JavaFacetValidator">
- <facet id="jst.java"/>
- </validator>
- </extension>
-
- <extension
- point="org.eclipse.core.resources.markers"
- id="javaVersionMismatch"
- name="%javaVersionMismatchMarkerName">
- <super type="org.eclipse.wst.common.project.facet.core.validation.marker"/>
- <attribute name="facetVersion"/>
- <attribute name="compilerLevel"/>
- <persistent value="true"/>
- </extension>
-
-</plugin>
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/frameworks/CommonFrameworksPlugin.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/frameworks/CommonFrameworksPlugin.java
deleted file mode 100644
index f28eeb856..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/frameworks/CommonFrameworksPlugin.java
+++ /dev/null
@@ -1,51 +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.common.frameworks;
-
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.internal.WTPPlugin;
-
-public final class CommonFrameworksPlugin
-
- extends WTPPlugin
-
-{
- public static final String PLUGIN_ID = "org.eclipse.jst.common.frameworks"; //$NON-NLS-1$
-
- private static final CommonFrameworksPlugin inst
- = new CommonFrameworksPlugin();
-
- /**
- * Get the plugin singleton.
- */
-
- public static CommonFrameworksPlugin getDefault()
- {
- return inst;
- }
-
- public String getPluginID()
- {
- return PLUGIN_ID;
- }
-
- public static void log( final Exception e )
- {
- final ILog log = CommonFrameworksPlugin.getDefault().getLog();
- final String msg = "Encountered an unexpected exception."; //$NON-NLS-1$
-
- log.log( new Status( IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, e ) );
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/ClasspathDecorations.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/ClasspathDecorations.java
deleted file mode 100644
index 4e4cb5f5d..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/ClasspathDecorations.java
+++ /dev/null
@@ -1,75 +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.common.jdt.internal.classpath;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.JavaCore;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public final class ClasspathDecorations
-{
- private IPath sourceAttachmentPath;
- private IPath sourceAttachmentRootPath;
- private ArrayList extraAttributes = new ArrayList();
-
- public IPath getSourceAttachmentPath()
- {
- return this.sourceAttachmentPath;
- }
-
- public void setSourceAttachmentPath( final IPath sourceAttachmentPath )
- {
- this.sourceAttachmentPath = sourceAttachmentPath;
- }
-
- public IPath getSourceAttachmentRootPath()
- {
- return this.sourceAttachmentRootPath;
- }
-
- public void setSourceAttachmentRootPath( final IPath sourceAttachmentRootPath )
- {
- this.sourceAttachmentRootPath = sourceAttachmentRootPath;
- }
-
- public IClasspathAttribute[] getExtraAttributes()
- {
- final IClasspathAttribute[] array
- = new IClasspathAttribute[ this.extraAttributes.size() ];
-
- return (IClasspathAttribute[]) this.extraAttributes.toArray( array );
- }
-
- public void setExtraAttributes( final IClasspathAttribute[] attrs )
- {
- for( int i = 0; i < attrs.length; i++ )
- {
- this.extraAttributes.add( attrs[ i ] );
- }
- }
-
- public void addExtraAttribute( final String name,
- final String value )
- {
- final IClasspathAttribute attr
- = JavaCore.newClasspathAttribute( name, value );
-
- this.extraAttributes.add( attr );
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/ClasspathDecorationsManager.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/ClasspathDecorationsManager.java
deleted file mode 100644
index c66358a53..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/ClasspathDecorationsManager.java
+++ /dev/null
@@ -1,371 +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.common.jdt.internal.classpath;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jst.common.frameworks.CommonFrameworksPlugin;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public final class ClasspathDecorationsManager
-{
- private final File f;
- private final HashMap decorations;
-
- public ClasspathDecorationsManager( final String plugin )
- {
- final IWorkspace ws = ResourcesPlugin.getWorkspace();
- final File wsdir = ws.getRoot().getLocation().toFile();
- final File wsmdroot = new File( wsdir, ".metadata/.plugins" ); //$NON-NLS-1$
- final File pmdroot = new File( wsmdroot, plugin );
-
- this.f = new File( pmdroot, "classpath.decorations.xml" ); //$NON-NLS-1$
- this.decorations = read();
- }
-
- public ClasspathDecorations getDecorations( final String key,
- final String entry )
- {
- final HashMap submap = (HashMap) this.decorations.get( key );
-
- if( submap == null )
- {
- return null;
- }
-
- return (ClasspathDecorations) submap.get( entry );
- }
-
- public void setDecorations( final String key,
- final String entry,
- final ClasspathDecorations dec )
- {
- HashMap submap = (HashMap) this.decorations.get( key );
-
- if( submap == null )
- {
- submap = new HashMap();
- this.decorations.put( key, submap );
- }
-
- submap.put( entry, dec );
- }
-
- public void clearAllDecorations( final String key )
- {
- this.decorations.remove( key );
- }
-
- public void save()
- {
- final File folder = this.f.getParentFile();
-
- if( ! folder.exists() && ! folder.mkdirs() )
- {
- return;
- }
-
- PrintWriter w = null;
-
- try
- {
- w = new PrintWriter( new BufferedWriter( new FileWriter( this.f ) ) );
-
- w.println( "<classpath>" ); //$NON-NLS-1$
-
- for( Iterator itr1 = decorations.entrySet().iterator();
- itr1.hasNext(); )
- {
- final Map.Entry entry1 = (Map.Entry) itr1.next();
- final Map submap = (Map) entry1.getValue();
-
- w.print( " <container id=\"" ); //$NON-NLS-1$
- w.print( (String) entry1.getKey() );
- w.println( "\">" ); //$NON-NLS-1$
-
- for( Iterator itr2 = submap.entrySet().iterator();
- itr2.hasNext(); )
- {
- final Map.Entry entry2 = (Map.Entry) itr2.next();
-
- final ClasspathDecorations dec
- = (ClasspathDecorations) entry2.getValue();
-
- w.print( " <entry id=\"" ); //$NON-NLS-1$
- w.print( (String) entry2.getKey() );
- w.println( "\">" ); //$NON-NLS-1$
-
- if( dec.getSourceAttachmentPath() != null )
- {
- w.print( " <source-attachment-path>" ); //$NON-NLS-1$
- w.print( dec.getSourceAttachmentPath().toString() );
- w.println( "</source-attachment-path>" ); //$NON-NLS-1$
- }
-
- if( dec.getSourceAttachmentRootPath() != null )
- {
- w.print( " <source-attachment-root-path>" ); //$NON-NLS-1$
- w.print( dec.getSourceAttachmentRootPath().toString() );
- w.println( "</source-attachment-root-path>" ); //$NON-NLS-1$
- }
-
- final IClasspathAttribute[] attrs
- = dec.getExtraAttributes();
-
- for( int i = 0; i < attrs.length; i++ )
- {
- final IClasspathAttribute attr = attrs[ i ];
-
- w.print( " <attribute name=\"" ); //$NON-NLS-1$
- w.print( attr.getName() );
- w.print( "\">" ); //$NON-NLS-1$
- w.print( attr.getValue() );
- w.println( "</attribute>" ); //$NON-NLS-1$
- }
-
- w.println( " </entry>" ); //$NON-NLS-1$
- }
-
- w.println( " </container>" ); //$NON-NLS-1$
- }
-
- w.println( "</classpath>" ); //$NON-NLS-1$
- }
- catch( IOException e )
- {
- CommonFrameworksPlugin.log( e );
- }
- finally
- {
- w.close();
- }
- }
-
- private HashMap read()
- {
- final HashMap map = new HashMap();
- if( ! this.f.exists() ) return map;
-
- InputStream in = null;
- Element root = null;
-
- try
- {
- final DocumentBuilderFactory factory
- = DocumentBuilderFactory.newInstance();
-
- final DocumentBuilder docbuilder = factory.newDocumentBuilder();
-
- in = new BufferedInputStream( new FileInputStream( f ) );
- root = docbuilder.parse( in ).getDocumentElement();
- }
- catch( Exception e )
- {
- CommonFrameworksPlugin.log( e );
- return map;
- }
- finally
- {
- if( in != null )
- {
- try
- {
- in.close();
- }
- catch( IOException e ) {}
- }
- }
-
- for( Iterator itr1 = elements( root, "container" ); itr1.hasNext(); ) //$NON-NLS-1$
- {
- final Element e1 = (Element) itr1.next();
- final String cid = e1.getAttribute( "id" ); //$NON-NLS-1$
-
- final HashMap submap = new HashMap();
- map.put( cid, submap );
-
- for( Iterator itr2 = elements( e1, "entry" ); itr2.hasNext(); ) //$NON-NLS-1$
- {
- final Element e2 = (Element) itr2.next();
- final String eid = e2.getAttribute( "id" ); //$NON-NLS-1$
- final ClasspathDecorations dec = new ClasspathDecorations();
-
- submap.put( eid, dec );
-
- for( Iterator itr3 = elements( e2 ); itr3.hasNext(); )
- {
- final Element e3 = (Element) itr3.next();
- final String n = e3.getNodeName();
-
- if( n.equals( "source-attachment-path" ) ) //$NON-NLS-1$
- {
- dec.setSourceAttachmentPath( new Path( text( e3 ) ) );
- }
- else if( n.equals( "source-attachment-root-path" ) ) //$NON-NLS-1$
- {
- dec.setSourceAttachmentRootPath( new Path( text( e3 ) ) );
- }
- else if( n.equals( "attribute" ) ) //$NON-NLS-1$
- {
- final String name = e3.getAttribute( "name" ); //$NON-NLS-1$
- dec.addExtraAttribute( name, text( e3 ) );
- }
- }
- }
- }
-
- return map;
- }
-
- private static String text( final Element el )
- {
- final NodeList nodes = el.getChildNodes();
-
- String str = null;
- StringBuffer buf = null;
-
- for( int i = 0, n = nodes.getLength(); i < n; i++ )
- {
- final Node node = nodes.item( i );
-
- if( node.getNodeType() == Node.TEXT_NODE )
- {
- final String val = node.getNodeValue();
-
- if( buf != null )
- {
- buf.append( val );
- }
- else if( str != null )
- {
- buf = new StringBuffer();
- buf.append( str );
- buf.append( val );
-
- str = null;
- }
- else
- {
- str = val;
- }
- }
- }
-
- if( buf != null )
- {
- return buf.toString();
- }
- return str;
- }
-
- private static Iterator elements( final Element el,
- final String name )
- {
- return new ElementsIterator( el, name );
- }
-
- private static Iterator elements( final Element el )
- {
- return new ElementsIterator( el, null );
- }
-
- private static final class ElementsIterator
-
- implements Iterator
-
- {
- private final NodeList nodes;
- private final int length;
- private final String name;
- private int position;
- private Element element;
-
- public ElementsIterator( final Element parent,
- final String name )
- {
- this.nodes = parent.getChildNodes();
- this.length = nodes.getLength();
- this.position = -1;
- this.name = name;
-
- advance();
- }
-
- private void advance()
- {
- this.element = null;
- this.position++;
-
- for( ; this.position < this.length && this.element == null;
- this.position++ )
- {
- final Node node = this.nodes.item( this.position );
-
- if( node.getNodeType() == Node.ELEMENT_NODE &&
- ( this.name == null ||
- node.getNodeName().equals( this.name ) ) )
- {
- this.element = (Element) node;
- }
- }
- }
-
- public boolean hasNext()
- {
- return ( this.element != null );
- }
-
- public Object next()
- {
- final Element el = this.element;
-
- if( el == null )
- {
- throw new NoSuchElementException();
- }
-
- advance();
-
- return el;
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainer.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainer.java
deleted file mode 100644
index ad9a82d79..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainer.java
+++ /dev/null
@@ -1,512 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005, 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.common.jdt.internal.classpath;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-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.IWorkspace;
-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.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.logger.proxy.Logger;
-import org.eclipse.jst.common.frameworks.CommonFrameworksPlugin;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-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.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public abstract class FlexibleProjectContainer
-
- implements IClasspathContainer
-
-{
- protected static final class PathType
- {
- public static final PathType
- LIB_DIRECTORY = new PathType(),
- CLASSES_DIRECTORY = new PathType();
- }
-
- private static ClasspathDecorationsManager decorations;
-
- static
- {
- // Register the resource listener that will listen for changes to
- // resources relevant to flexible project containers across the
- // workspace and refresh them as necessary.
-
- final IWorkspace ws = ResourcesPlugin.getWorkspace();
-
- ws.addResourceChangeListener( new Listener(),
- IResourceChangeEvent.POST_CHANGE );
-
- // Read the decorations from the workspace metadata.
-
- final String plugin = CommonFrameworksPlugin.PLUGIN_ID;
- decorations = new ClasspathDecorationsManager( plugin );
- }
-
- private static final String SEPARATOR = "!"; //$NON-NLS-1$
-
- public static String getDecorationManagerKey(IProject project, String container){
- return project.getName() + SEPARATOR + container;
- }
-
- protected final IPath path;
- protected final IJavaProject owner;
- protected final IProject project;
- private final IPath[] paths;
- private final PathType[] pathTypes;
- private final List entries;
- private final IClasspathEntry[] cpentries;
-
- public FlexibleProjectContainer( final IPath path,
- final IJavaProject owner,
- final IProject project,
- final IPath[] paths,
- final PathType[] types )
- {
- this.path = path;
- this.owner = owner;
- this.project = project;
- this.paths = paths;
- this.pathTypes = types;
-
- if( ! isFlexibleProject( this.project ) )
- {
- // Silently noop if the referenced project is not a flexible
- // project. Should I be doing something else here?
-
- this.entries = Collections.EMPTY_LIST;
- this.cpentries = new IClasspathEntry[ 0 ];
-
- return;
- }
-
- this.entries = computeClasspathEntries();
- this.cpentries = new IClasspathEntry[ this.entries.size() ];
-
- for( int i = 0, n = this.entries.size(); i < n; i++ )
- {
- IPath entryPath = (IPath) this.entries.get( i );
- IResource resource =ResourcesPlugin.getWorkspace().getRoot().findMember(entryPath);
- if(null != resource && resource.getType() == IResource.PROJECT)
- this.cpentries[ i ] = JavaCore.newProjectEntry(entryPath, false);
- else
- this.cpentries[ i ] = newLibraryEntry( entryPath );
- }
- }
-
- public int getKind()
- {
- return K_APPLICATION;
- }
-
- public IPath getPath()
- {
- return this.path;
- }
-
- public IClasspathEntry[] getClasspathEntries()
- {
- return this.cpentries;
- }
-
- public boolean isOutOfDate( final IResourceDelta delta )
- {
- if( delta == null )
- {
- return false;
- }
-
- final List currentEntries = computeClasspathEntries();
- return ! this.entries.equals( currentEntries );
- }
-
- public abstract void refresh();
-
- static ClasspathDecorationsManager getDecorationsManager()
- {
- return decorations;
- }
-
- private List computeClasspathEntries()
- {
- final List entries = new ArrayList();
-
- final IVirtualComponent vc
- = ComponentCore.createComponent( this.project );
-
- if( vc == null )
- {
- return entries;
- }
-
- final Set existingEntries = computeExistingClasspathEntries();
-
- IVirtualReference[] refs = vc.getReferences();
- IVirtualComponent comp = null;
- Set jarsHandled = new HashSet();
- String jarName = null;
- for (int i = 0; i < refs.length; i++) {
- comp = refs[i].getReferencedComponent();
- if (!refs[i].getRuntimePath().equals(paths[0].makeAbsolute()))
- continue;
- jarName = refs[i].getArchiveName();
- if(null != jarName){
- jarsHandled.add(jarName);
- }
- IPath newPath = null;
- if (comp.isBinary()) {
- VirtualArchiveComponent archiveComp = (VirtualArchiveComponent) comp;
- java.io.File diskFile = archiveComp.getUnderlyingDiskFile();
- if (diskFile.exists()) {
- newPath =new Path(diskFile.getAbsolutePath());
- } else {
- IFile iFile = archiveComp.getUnderlyingWorkbenchFile();
- if (!entries.contains(iFile.getFullPath())){
- newPath = iFile.getFullPath();
- }
- }
- } else {
- IProject project = comp.getProject();
- newPath = project.getFullPath();
- }
-
- if(null != newPath && !isAlreadyOnClasspath(existingEntries, newPath)){
- entries.add(newPath);
- }
-
- }
-
- for( int i = 0; i < this.paths.length; i++ )
- {
- final IVirtualFolder rootFolder = vc.getRootFolder();
- final IVirtualFolder vf = rootFolder.getFolder( paths[ i ] );
-
- if( this.pathTypes[ i ] == PathType.LIB_DIRECTORY )
- {
- final IVirtualResource[] contents;
-
- try
- {
- contents = vf.members();
- }
- catch( CoreException e )
- {
- CommonFrameworksPlugin.log( e );
- continue;
- }
-
- for( int j = 0; j < contents.length; j++ )
- {
- final IResource r = contents[ j ].getUnderlyingResource();
- final IPath p = r.getFullPath();
-
- if(!jarsHandled.contains(p.lastSegment()) && isJarFile( r.getLocation().toFile() ) )
- {
- jarsHandled.add(p.lastSegment());
- if(!isAlreadyOnClasspath(existingEntries, p)){
- entries.add( p );
- }
- }
- }
- }
- else
- {
- final IContainer[] uf = vf.getUnderlyingFolders();
-
- for( int j = 0; j < uf.length; j++ )
- {
- final IPath p = uf[ j ].getFullPath();
-
- if( ! jarsHandled.contains( p.lastSegment() ) &&
- ! isSourceOrOutputDirectory( p ) )
- {
- jarsHandled.add(p.lastSegment());
- if(!isAlreadyOnClasspath(existingEntries, p)){
- entries.add( p );
- }
- }
- }
- }
- }
-
- return entries;
- }
-
- private Set computeExistingClasspathEntries()
- {
- final IJavaProject jproj = JavaCore.create( this.project );
- final Set existing = new HashSet();
-
- try
- {
- // Get all resolved entries first.
-
- final IClasspathEntry[] entries = jproj.getResolvedClasspath( true );
- existing.addAll( Arrays.asList( entries ) );
-
- // Then remove any entries provided by this container's prior self.
-
- final IClasspathEntry[] cp = jproj.getRawClasspath();
-
- for( int i = 0; i < cp.length; i++ )
- {
- final IPath path = cp[ i ].getPath();
-
- if( path.equals( this.path ) )
- {
- final IClasspathContainer container
- = JavaCore.getClasspathContainer( path, jproj );
- if(null != container){
- final IClasspathEntry[] containerEntries
- = container.getClasspathEntries();
-
- existing.removeAll( Arrays.asList( containerEntries ) );
-
- break;
- }
- }
- }
- }
- catch( JavaModelException e )
- {
- Logger.getLogger().logError( e );
- }
-
- return existing;
- }
-
- private IClasspathEntry newLibraryEntry( final IPath p )
- {
- IPath srcpath = null;
- IPath srcrootpath = null;
- IClasspathAttribute[] attrs = {};
- IAccessRule[] access = {};
-
- final ClasspathDecorations dec
- = decorations.getDecorations( getDecorationManagerKey(project, getPath().toString()), p.toString() );
-
- if( dec != null )
- {
- srcpath = dec.getSourceAttachmentPath();
- srcrootpath = dec.getSourceAttachmentRootPath();
- attrs = dec.getExtraAttributes();
- }
-
- return JavaCore.newLibraryEntry( p, srcpath, srcrootpath, access, attrs,
- false );
-
- }
-
- private boolean isSourceOrOutputDirectory( final IPath aPath )
- {
- if( isJavaProject( this.project ) )
- {
- try
- {
- final IJavaProject jproject = JavaCore.create( this.project );
- final IClasspathEntry[] cp = jproject.getRawClasspath();
-
- for( int i = 0; i < cp.length; i++ )
- {
- final IClasspathEntry cpe = cp[ i ];
-
- if( cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE )
- {
- final IPath src = cpe.getPath();
- final IPath output = cpe.getOutputLocation();
-
- if( src.equals( aPath ) ||
- output != null && output.equals( aPath ) )
- {
- return true;
- }
- }
- }
-
- if( jproject.getOutputLocation().equals( aPath ) )
- {
- return true;
- }
- }
- catch( JavaModelException e )
- {
- CommonFrameworksPlugin.log( e );
- }
- }
-
- return false;
- }
-
- private static boolean isJavaProject( final IProject pj )
- {
- try
- {
- return pj.getNature( JavaCore.NATURE_ID ) != null;
- }
- catch( CoreException e )
- {
- return false;
- }
- }
-
- private static boolean isFlexibleProject( final IProject pj )
- {
- try
- {
- return pj.getNature( IModuleConstants.MODULE_NATURE_ID ) != null;
- }
- catch( CoreException e )
- {
- return false;
- }
- }
-
- private static boolean isJarFile( final File f )
- {
- if( f.isFile() )
- {
- final String fname = f.getName();
-
- if( fname.endsWith( ".jar" ) || fname.endsWith( ".zip" ) ) //$NON-NLS-1$ //$NON-NLS-2$
- {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * 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;
- }
-
- private static class Listener
-
- implements IResourceChangeListener
-
- {
- public void resourceChanged( final IResourceChangeEvent event )
- {
- // Locate all of the flexible project containers.
-
- final ArrayList containers = new ArrayList();
-
- final IProject[] projects
- = ResourcesPlugin.getWorkspace().getRoot().getProjects();
-
- for( int i = 0; i < projects.length; i++ )
- {
- final IProject project = projects[ i ];
-
- try
- {
- if( isJavaProject( project ) )
- {
- final IJavaProject jproj = JavaCore.create( project );
- final IClasspathEntry[] cpes = jproj.getRawClasspath();
-
- for( int j = 0; j < cpes.length; j++ )
- {
- final IClasspathEntry cpe = cpes[ j ];
-
- if( cpe.getEntryKind() == IClasspathEntry.CPE_CONTAINER )
- {
- final IClasspathContainer cont
- = JavaCore.getClasspathContainer( cpe.getPath(), jproj );
-
- if( cont instanceof FlexibleProjectContainer )
- {
- containers.add( cont );
- }
- }
- }
- }
- }
- catch( JavaModelException e )
- {
- CommonFrameworksPlugin.log( e );
- }
- }
-
- // Refresh the containers that are out of date.
-
- final IResourceDelta delta = event.getDelta();
-
- for( int i = 0, n = containers.size(); i < n; i++ )
- {
- final FlexibleProjectContainer c
- = (FlexibleProjectContainer) containers.get( i );
-
- if( c.isOutOfDate( delta ) )
- {
- c.refresh();
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java
deleted file mode 100644
index d9a6d4a88..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java
+++ /dev/null
@@ -1,119 +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.common.jdt.internal.classpath;
-
-import java.lang.reflect.Field;
-
-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;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public abstract class FlexibleProjectContainerInitializer
-
- extends ClasspathContainerInitializer
-
-{
- private static final ClasspathDecorationsManager decorations
- = FlexibleProjectContainer.getDecorationsManager();
-
- public boolean canUpdateClasspathContainer( final IPath containerPath,
- final IJavaProject project)
- {
- return true;
- }
-
- public void requestClasspathContainerUpdate( final IPath containerPath,
- final IJavaProject project,
- final IClasspathContainer sg )
-
- throws CoreException
-
- {
- final String key = FlexibleProjectContainer.getDecorationManagerKey(project.getProject(), containerPath.toString());
-
- final IClasspathEntry[] entries = sg.getClasspathEntries();
-
- decorations.clearAllDecorations( key );
-
- 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, project );
-
- // ( (FlexibleProjectContainer) container ).refresh();
-
- refresh( container );
- }
-
- // Workaround for bug 145784.
- // this same hack is also being used in J2EEComponentClasspathInitializer
- private static void refresh( final IClasspathContainer container )
- {
- if( container instanceof FlexibleProjectContainer )
- {
- ( (FlexibleProjectContainer) container ).refresh();
- }
- else
- {
- try
- {
- final Field field
- = container.getClass().getDeclaredField( "fOriginal" ); //$NON-NLS-1$
-
- field.setAccessible( true );
-
- refresh( (IClasspathContainer) field.get( container ) );
- }
- catch( NoSuchFieldException e )
- {
- // Should not happen.
- throw new RuntimeException( e );
- }
- catch( IllegalAccessException e )
- {
- // Should not happen.
- throw new RuntimeException( e );
- }
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/IJavaProjectCreationProperties.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/IJavaProjectCreationProperties.java
deleted file mode 100644
index fcd86cf5b..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/IJavaProjectCreationProperties.java
+++ /dev/null
@@ -1,46 +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.common.jdt.internal.integration;
-
-import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties;
-import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15;
-import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationProperties;
-
-/**
- * This has been slated for removal post WTP 1.5. Do not use this class/interface
- *
- * @deprecated
- *
- * @see IJavaFacetInstallDataModelProperties
- */
-public interface IJavaProjectCreationProperties extends IProjectCreationProperties, DoNotUseMeThisWillBeDeletedPost15 {
-
- /**
- * Optional, type String []. These names are relative.
- */
- public static final String SOURCE_FOLDERS = "JavaProjectCreationDataModel.SOURCE_FOLDERS"; //$NON-NLS-1$
- /**
- * Optional, type Boolean default is True
- */
- public static final String CREATE_SOURCE_FOLDERS = "JavaProjectCreationDataModel.CREATE_SOURCE_FOLDERS"; //$NON-NLS-1$
-
-
- /**
- * Optional, type IClasspathEntry[]
- */
- public static final String CLASSPATH_ENTRIES = "JavaProjectCreationDataModel.CLASSPATH_ENTRIES"; //$NON-NLS-1$
-
- /**
- * Optional, type String
- */
- public static final String OUTPUT_LOCATION = "JavaProjectCreationDataModel.OUTPUT_LOCATION"; //$NON-NLS-1$
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModel.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModel.java
deleted file mode 100644
index 19e360d32..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModel.java
+++ /dev/null
@@ -1,217 +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.common.jdt.internal.integration;
-
-import java.util.Set;
-
-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.IProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel;
-import org.eclipse.wst.common.frameworks.internal.SaveFailedException;
-import org.eclipse.wst.common.internal.emf.resource.CompatibilityXMIResource;
-import org.eclipse.wst.common.internal.emf.resource.ReferencedResource;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext;
-
-public class JavaArtifactEditModel extends ArtifactEditModel implements WorkingCopyProvider {
-
- private WorkingCopyManager workingCopyManager = null;
-
- /**
- * @param anEditModelId
- * @param aContext
- * @param toMakeReadOnly
- * @param toAccessUnknownResourcesAsReadOnly
- * @param aModuleURI
- */
- public JavaArtifactEditModel(String anEditModelId, EMFWorkbenchContext aContext, boolean toMakeReadOnly, boolean toAccessUnknownResourcesAsReadOnly, URI aModuleURI) {
- super(anEditModelId, aContext, toMakeReadOnly,
- toAccessUnknownResourcesAsReadOnly, aModuleURI);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param anEditModelId
- * @param aContext
- * @param toMakeReadOnly
- * @param aModuleURI
- */
- public JavaArtifactEditModel(String anEditModelId, EMFWorkbenchContext aContext, boolean toMakeReadOnly, URI aModuleURI) {
- super(anEditModelId, aContext, toMakeReadOnly, aModuleURI);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * 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);
- }
-
- /**
- * This method should only be called by the J2EENature.
- */
- public void dispose() {
- super.dispose();
- resetWorkingCopyManager();
- }
-
- public Set getAffectedFiles() {
- java.util.Set affected = super.getAffectedFiles();
- if (getWorkingCopyManager() != null)
- affected.addAll(getWorkingCopyManager().getAffectedFiles());
-
- return affected;
- }
-
- /**
- * 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 org.eclipse.jdt.core.ICompilationUnit getExistingWorkingCopy(org.eclipse.jdt.core.ICompilationUnit cu) throws org.eclipse.core.runtime.CoreException {
- return getWorkingCopyManager().getExistingWorkingCopy(cu);
- }
-
- /**
- * 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 org.eclipse.jdt.core.ICompilationUnit getWorkingCopy(ICompilationUnit cu, boolean forNewCU) throws CoreException {
- return getWorkingCopyManager().getWorkingCopy(cu, forNewCU);
- }
-
- /**
- * Save the new compilation units only.
- */
- protected void handleSaveIfNecessaryDidNotSave(IProgressMonitor monitor) {
- getWorkingCopyManager().saveOnlyNewCompilationUnits(monitor);
- }
-
- /**
- * @see org.eclipse.jst.j2ee.internal.internal.workbench.J2EEEditModel#isDirty()
- */
- public boolean isDirty() {
- boolean dirtyBool = super.isDirty();
- if (!dirtyBool && getWorkingCopyManager() != null)
- dirtyBool = getWorkingCopyManager().hasWorkingCopies();
- return dirtyBool;
- }
-
- /**
- * This will force all of the referenced Resources to be saved.
- */
- public void primSave(IProgressMonitor monitor) {
- saveCompilationUnits(monitor);
- if (monitor == null || !monitor.isCanceled())
- super.primSave(monitor);
- }
- protected void runSaveOperation(IWorkspaceRunnable runnable, IProgressMonitor monitor) throws SaveFailedException {
- try {
- ResourcesPlugin.getWorkspace().run(runnable, null,IWorkspace.AVOID_UPDATE,monitor);
- } catch (CoreException e) {
- throw new SaveFailedException(e);
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (4/11/2001 4:14:26 PM)
- *
- * @return java.util.Set
- */
- public void processResource(Resource aResource) {
- if (aResource != null && !getResources().contains(aResource)) {
- if (aResource instanceof ReferencedResource) {
- access((ReferencedResource) aResource);
- //We need a better way to pass this through the save options instead.
- //We also need to make this dynamic based on the project target
- ((ReferencedResource) aResource).setFormat(CompatibilityXMIResource.FORMAT_MOF5);
- } else if (!isReadOnly())
- aResource.setTrackingModification(true);
- addResource(aResource);
- }
- }
-
- /**
- * Release each of the referenced resources.
- */
- protected void release(Resource aResource) {
-
- removeResource(aResource);
- if (aResource != null) {
- boolean isRefRes = aResource instanceof ReferencedResource;
- if (isRefRes)
- release((ReferencedResource) aResource);
- if (!isDisposing())
- resetWorkingCopyManager();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.j2ee.internal.internal.workbench.J2EEEditModel#resourceIsLoadedChanged(org.eclipse.emf.ecore.resource.Resource,
- * boolean, boolean)
- */
- protected void resourceIsLoadedChanged(Resource aResource, boolean oldValue, boolean newValue) {
- if (!isReverting && !disposing && !isReadOnly() && oldValue && !newValue && aResource instanceof TranslatorResource)
- resetWorkingCopyManager();
- super.resourceIsLoadedChanged(aResource, oldValue, newValue);
- }
-
- protected void reverted(ReferencedResource revertedResource) {
- if (getWorkingCopyManager() != null)
- getWorkingCopyManager().revert();
- revertAllResources();
- }
-
- /**
- * This will save all of the referenced CompilationUnits to be saved.
- */
- public void saveCompilationUnits(IProgressMonitor monitor) {
- getWorkingCopyManager().saveCompilationUnits(monitor);
- }
-
- public WorkingCopyManager getWorkingCopyManager() {
- if (workingCopyManager == null)
- workingCopyManager = WorkingCopyManagerFactory.newRegisteredInstance();
- return workingCopyManager;
- }
-
- /**
- * Reset the working copy manager because the ejb-jar.xml was removed without disposing.
- */
- protected void resetWorkingCopyManager() {
- if (workingCopyManager != null) {
- workingCopyManager.dispose();
- workingCopyManager = null;
- }
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModelFactory.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModelFactory.java
deleted file mode 100644
index 892b2ab56..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModelFactory.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.common.jdt.internal.integration;
-
-import java.util.Map;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory;
-
-/**
- * <p>
- * The following class is experimental until fully documented.
- * </p>
- */
-public class JavaArtifactEditModelFactory extends EditModelFactory {
-
- public static final String MODULE_EDIT_MODEL_ID = "org.eclipse.jst.modulecore.editModel"; //$NON-NLS-1$
-
- public static final String PARAM_MODULE_URI = "MODULE_URI"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory#createEditModelForRead(java.lang.String, org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext, java.util.Map)
- */
- public EditModel createEditModelForRead(String editModelID, EMFWorkbenchContext context, Map params) {
- URI moduleURI = (URI) ((params != null) ? params.get(PARAM_MODULE_URI) : null);
- if(moduleURI == null)
- throw new IllegalStateException("A Module URI must be provided"); //$NON-NLS-1$
-
- return new JavaArtifactEditModel(editModelID, context, true, moduleURI);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory#createEditModelForWrite(java.lang.String, org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext, java.util.Map)
- */
- public EditModel createEditModelForWrite(String editModelID, EMFWorkbenchContext context, Map params) {
- URI moduleURI = (URI) ((params != null) ? params.get(PARAM_MODULE_URI) : null);
- if(moduleURI == null)
- throw new IllegalStateException("A Module URI must be provided"); //$NON-NLS-1$
- return new JavaArtifactEditModel(editModelID, context, false,false, moduleURI);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory#getCacheID(java.lang.String, java.util.Map)
- */
- public String getCacheID(String editModelID, Map params) {
- URI moduleURI = (URI)params.get(PARAM_MODULE_URI);
- if(moduleURI != null)
- return editModelID+":"+moduleURI.toString(); //$NON-NLS-1$
- return editModelID+":NOURI"; //$NON-NLS-1$
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationDataModelProvider.java
deleted file mode 100644
index dca114848..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationDataModelProvider.java
+++ /dev/null
@@ -1,57 +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.common.jdt.internal.integration;
-
-import java.util.Set;
-
-import org.eclipse.jst.common.project.facet.JavaProjectFacetCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15;
-import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModelProvider;
-
-/**
- * This has been slated for removal post WTP 1.5. Do not use this class/interface
- *
- * @deprecated
- *
- * @see JavaProjectFacetCreationDataModelProvider
- */
-public class JavaProjectCreationDataModelProvider extends ProjectCreationDataModelProvider implements IJavaProjectCreationProperties, DoNotUseMeThisWillBeDeletedPost15 {
-
-
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(OUTPUT_LOCATION);
- propertyNames.add(SOURCE_FOLDERS);
- propertyNames.add(CLASSPATH_ENTRIES);
- propertyNames.add(CREATE_SOURCE_FOLDERS);
- return propertyNames;
- }
-
- public IDataModelOperation getDefaultOperation() {
- return new JavaProjectCreationOperation(model);
- }
-
- public Object getDefaultProperty(String propertyName) {
- // TODO pull these from the java preferences
- if (propertyName.equals(OUTPUT_LOCATION)) {
- return "bin"; //$NON-NLS-1$
- }
- if (propertyName.equals(SOURCE_FOLDERS)) {
- return new String[0];
- }
- if (propertyName.equals(CREATE_SOURCE_FOLDERS))
- return Boolean.TRUE;
- return null;
- }
-
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationOperation.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationOperation.java
deleted file mode 100644
index 3a5b5663f..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationOperation.java
+++ /dev/null
@@ -1,122 +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 Nov 4, 2003
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.jst.common.jdt.internal.integration;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFolder;
-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.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.common.project.facet.JavaProjectFacetCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15;
-import org.eclipse.wst.common.frameworks.internal.WTPProjectUtilities;
-import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationProperties;
-import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationOperation;
-
-/**
- * This has been slated for removal post WTP 1.5. Do not use this class/interface
- *
- * @deprecated
- *
- * @see JavaProjectFacetCreationDataModelProvider
- */
-public class JavaProjectCreationOperation extends ProjectCreationOperation implements DoNotUseMeThisWillBeDeletedPost15 {
-
- public JavaProjectCreationOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- super.execute(monitor, info);
- try {
- createJavaProject(monitor);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return OK_STATUS;
- }
-
- private void createJavaProject(IProgressMonitor monitor) throws CoreException {
- IProject project = (IProject) model.getProperty(IProjectCreationProperties.PROJECT);
- WTPProjectUtilities.addNatureToProjectLast(project, JavaCore.NATURE_ID);
- IJavaProject javaProject = JavaCore.create(project);
- javaProject.setOutputLocation(getOutputPath(project), monitor);
- javaProject.setRawClasspath(getClasspathEntries(project), monitor);
- if (model.getBooleanProperty(IJavaProjectCreationProperties.CREATE_SOURCE_FOLDERS)) {
- String[] sourceFolders = (String[]) model.getProperty(IJavaProjectCreationProperties.SOURCE_FOLDERS);
- IFolder folder = null;
- for (int i = 0; i < sourceFolders.length; i++) {
- folder = project.getFolder(sourceFolders[i]);
- folder.create(true, true, monitor);
- }
- }
- }
-
- private IPath getOutputPath(IProject project) {
- String outputLocation = model.getStringProperty(IJavaProjectCreationProperties.OUTPUT_LOCATION);
- return project.getFullPath().append(outputLocation);
- }
-
- private IClasspathEntry[] getClasspathEntries(IProject project) {
- IClasspathEntry[] entries = (IClasspathEntry[]) model.getProperty(IJavaProjectCreationProperties.CLASSPATH_ENTRIES);
- IClasspathEntry[] sourceEntries = null;
- if (model.getBooleanProperty(IJavaProjectCreationProperties.CREATE_SOURCE_FOLDERS))
- sourceEntries = getSourceClasspathEntries(project);
- return combineArrays(sourceEntries, entries);
- }
-
- private IClasspathEntry[] getSourceClasspathEntries(IProject project) {
- String[] sourceFolders = (String[]) model.getProperty(IJavaProjectCreationProperties.SOURCE_FOLDERS);
- ArrayList list = new ArrayList();
- for (int i = 0; i < sourceFolders.length; i++) {
- list.add(JavaCore.newSourceEntry(project.getFullPath().append(sourceFolders[i])));
- }
- IClasspathEntry[] classpath = new IClasspathEntry[list.size()];
- for (int i = 0; i < classpath.length; i++) {
- classpath[i] = (IClasspathEntry) list.get(i);
- }
- return classpath;
- }
-
- private IClasspathEntry[] combineArrays(IClasspathEntry[] sourceEntries, IClasspathEntry[] entries) {
- if (sourceEntries != null) {
- if (entries == null)
- return sourceEntries;
- return doCombineArrays(sourceEntries, entries);
- } else if (entries != null)
- return entries;
- return new IClasspathEntry[0];
- }
-
- private IClasspathEntry[] doCombineArrays(IClasspathEntry[] sourceEntries, IClasspathEntry[] entries) {
- IClasspathEntry[] result = new IClasspathEntry[sourceEntries.length + entries.length];
- System.arraycopy(sourceEntries, 0, result, 0, sourceEntries.length);
- System.arraycopy(entries, 0, result, sourceEntries.length, entries.length);
- return result;
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectValidationHandler.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectValidationHandler.java
deleted file mode 100644
index cf2c3902a..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectValidationHandler.java
+++ /dev/null
@@ -1,56 +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.common.jdt.internal.integration;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.wst.validation.internal.IValidationSelectionHandler;
-
-
-/**
- * Java Project validation
- */
-public class JavaProjectValidationHandler implements IValidationSelectionHandler {
-
- private String validationType = null;
-
- /**
- * Default constructor
- */
- public JavaProjectValidationHandler() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.frameworks.internal.IValidationSelectionHandler#getBaseValidationType(java.lang.Object)
- */
- public IResource getBaseValidationType(Object selection) {
- if (selection instanceof IJavaProject)
- return ((IJavaProject)selection).getProject();
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.frameworks.internal.IValidationSelectionHandler#getValidationTypeString()
- */
- public String getValidationTypeString() {
- return validationType;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.frameworks.internal.IValidationSelectionHandler#setValidationTypeString(java.lang.String)
- */
- public void setValidationTypeString(String validationType) {
- this.validationType = validationType;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WTPWorkingCopyManager.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WTPWorkingCopyManager.java
deleted file mode 100644
index fa74accfb..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WTPWorkingCopyManager.java
+++ /dev/null
@@ -1,542 +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.common.jdt.internal.integration;
-
-
-
-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 java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.wst.common.frameworks.internal.ISaveHandler;
-import org.eclipse.wst.common.frameworks.internal.SaveFailedException;
-import org.eclipse.wst.common.frameworks.internal.SaveHandlerHeadless;
-import org.eclipse.wst.common.frameworks.internal.SaveHandlerRegister;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-/**
- * Insert the type's description here. Creation date: (4/27/2001 4:14:30 PM)
- *
- * @author: Administrator
- */
-public class WTPWorkingCopyManager implements WorkingCopyManager {
-
- //New CUs that will need to be deleted upon dispose
- private List originalNewCompilationUnits;
- //New CUs that were created that need saved immediately (after each gen)
- private List needsSavingCompilationUnits;
- //A complete list of new CUs that is only cleared on save and dispose
- private List newCompilationUnits;
- private HashMap deletedCompilationUnits;
- protected static final Class IRESOURCE_CLASS = IResource.class;
-
- /**
- * WTPWorkingCopyManager constructor comment.
- */
- public WTPWorkingCopyManager() {
- super();
- }
-
- protected void addDeletedCompilationUnit(ICompilationUnit cu) {
- getNeedsSavingCompilationUnits().remove(cu);
- if (!getOriginalNewCompilationUnits().contains(cu) && !getDeletedCompilationUnits().containsKey(cu))
- primAddDeletedCompilationUnit(cu);
- getOriginalNewCompilationUnits().remove(cu);
- }
-
- protected void addNewCompilationUnit(ICompilationUnit cu, ICompilationUnit workingCopy) {
- getNewCompilationUnits().add(cu);
- getNeedsSavingCompilationUnits().add(workingCopy);
- if (!getDeletedCompilationUnits().containsKey(cu))
- getOriginalNewCompilationUnits().add(cu);
- }
-
- /**
- * This will save all of the new CompilationUnits to be saved.
- */
- protected void commitWorkingCopy(ICompilationUnit wc, IProgressMonitor monitor) {
- try {
- try {
- wc.commitWorkingCopy(false, monitor);
- } catch (JavaModelException e) {
- if (isFailedWriteFileFailure(e) && shouldSaveReadOnly(wc))
- wc.commitWorkingCopy(false, monitor);
- else
- throw e;
- }
- } catch (JavaModelException e) {
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e);
- throw new SaveFailedException(e);
- } finally {
- try {
- wc.discardWorkingCopy();
- } catch (JavaModelException e1) {
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e1);
- throw new SaveFailedException(e1);
- }
- }
- }
-
- /**
- * This will delete
- *
- * @cu from the workbench and fix the internal references for this working copy manager.
- */
- public void delete(ICompilationUnit cu, IProgressMonitor monitor) {
- if (cu.isWorkingCopy())
- cu = cu.getPrimary();
- addDeletedCompilationUnit(cu);
- try {
- cu.delete(false, monitor);
- } catch (JavaModelException e) {
- if (e.getStatus().getCode() != org.eclipse.jdt.core.IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST)
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e);
- }
- }
-
- protected void discardOriginalNewCompilationUnits() {
- if (getOriginalNewCompilationUnits().isEmpty())
- return;
- List cus = getOriginalNewCompilationUnits();
- ICompilationUnit cu;
- ICompilationUnit wc = null;
- for (int i = 0; i < cus.size(); i++) {
- cu = (ICompilationUnit) cus.get(i);
- if (cu.isWorkingCopy()) {
- wc = cu;
- cu = wc.getPrimary();
- }
- primDelete(cu);
- if (wc != null)
- try {
- wc.discardWorkingCopy();
- } catch (JavaModelException e) {
- Logger.getLogger().logError(e);
- }
- }
- }
-
- public void dispose() {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor aMonitor) {
- primDispose();
- }
- };
- try {
- if (!WTPCommonPlugin.getWorkspace().isTreeLocked()) {
- WTPCommonPlugin.getWorkspace().run(runnable,null, IWorkspace.AVOID_UPDATE,null);
- } else {
- runnable.run(null);
- }
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- //runOperation(runnable, null, true);
- }
-
- public void revert() {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor aMonitor) {
- primRevert();
- }
- };
- runOperation(runnable, null, true);
- }
-
- public Set getAffectedFiles() {
- return Collections.EMPTY_SET;
- }
-
- /**
- * Insert the method's description here. Creation date: (7/11/2001 6:43:37 PM)
- *
- * @return java.util.HashMap
- */
- protected HashMap getDeletedCompilationUnits() {
- if (deletedCompilationUnits == null)
- deletedCompilationUnits = new HashMap();
- return deletedCompilationUnits;
- }
-
- /**
- * 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 org.eclipse.jdt.core.ICompilationUnit getExistingWorkingCopy(ICompilationUnit cu) throws CoreException {
- ICompilationUnit newCU = getNewCompilationUnitWorkingCopy(cu);
- if (newCU != null)
- return newCU;
- return null;
- }
-
- /**
- * Insert the method's description here. Creation date: (7/19/2001 11:00:19 AM)
- *
- * @return java.util.List
- */
- protected java.util.List getNeedsSavingCompilationUnits() {
- if (needsSavingCompilationUnits == null)
- needsSavingCompilationUnits = new ArrayList();
- return needsSavingCompilationUnits;
- }
-
- /**
- * Insert the method's description here. Creation date: (4/26/2001 3:49:05 PM)
- *
- * @return java.util.List
- */
- protected java.util.List getNewCompilationUnits() {
- if (newCompilationUnits == null)
- newCompilationUnits = new ArrayList();
- return newCompilationUnits;
- }
-
- /**
- * It is possible that we have already created this CompilationUnit and its working copy. If
- * this is the case, return our new working copy and do not create a new one.
- */
- protected ICompilationUnit getNewCompilationUnitWorkingCopy(ICompilationUnit cu) {
- if (hasNewCompilationUnit(cu)) {
- List list = getNeedsSavingCompilationUnits();
- ICompilationUnit copy;
- for (int i = 0; i < list.size(); i++) {
- copy = (ICompilationUnit) list.get(i);
- if (cu.equals(copy.getPrimary()))
- return copy;
- }
- }
- return null;
- }
-
- /**
- * Insert the method's description here. Creation date: (4/26/2001 3:49:05 PM)
- *
- * @return java.util.List
- */
- protected java.util.List getOriginalNewCompilationUnits() {
- if (originalNewCompilationUnits == null)
- originalNewCompilationUnits = new ArrayList();
- return originalNewCompilationUnits;
- }
-
- /**
- * Return the IPackageFragment for the given ICompilationUnit.
- */
- protected IPackageFragment getPackageFragment(ICompilationUnit cu) {
- if (cu == null)
- return null;
- IJavaElement parent = cu;
- int elementType = cu.getElementType();
- while (parent != null && elementType != IJavaElement.PACKAGE_FRAGMENT) {
- parent = parent.getParent();
- if (parent != null)
- elementType = parent.getElementType();
- else
- elementType = -1;
- }
- return (IPackageFragment) parent;
- }
-
- protected ISaveHandler getSaveHandler() {
- return SaveHandlerRegister.getSaveHandler();
- }
-
- /**
- * 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 (cu == null || cu.isWorkingCopy())
- return cu;
- ICompilationUnit newCU = getNewCompilationUnitWorkingCopy(cu);
- if (newCU != null)
- return newCU;
- ICompilationUnit workingCopy = cu.getWorkingCopy(null);
- addNewCompilationUnit(cu, workingCopy);
- return workingCopy;
- }
-
- /**
- * Has a new compilation unit already been created.
- */
- protected boolean hasNewCompilationUnit(ICompilationUnit cu) {
- return getNewCompilationUnits().contains(cu);
- }
-
- protected boolean isFailedWriteFileFailure(Exception ex) {
- return SaveHandlerHeadless.isFailedWriteFileFailure(ex);
- }
-
- protected void primAddDeletedCompilationUnit(ICompilationUnit cu) {
- if (cu == null)
- return;
- Object[] info = new Object[2];
- info[0] = getPackageFragment(cu);
- try {
- info[1] = cu.getSource();
- } catch (JavaModelException e) {
- info[1] = null;
- }
- getDeletedCompilationUnits().put(cu, info);
- }
-
- // This is an internal delete call.
- protected void primDelete(ICompilationUnit cu) {
- try {
- if (cu.exists())
- cu.delete(true, new org.eclipse.core.runtime.NullProgressMonitor());
- } catch (JavaModelException e) {
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e);
- //What to do here?
- }
- }
-
- protected void primDispose() {
- discardOriginalNewCompilationUnits();
- reviveDeletedCompilationUnits();
- newCompilationUnits = null;
- needsSavingCompilationUnits = null;
- originalNewCompilationUnits = null;
- deletedCompilationUnits = null;
- }
-
- protected void primRevert() {
- discardOriginalNewCompilationUnits();
- reviveDeletedCompilationUnits();
- newCompilationUnits = null;
- needsSavingCompilationUnits = null;
- originalNewCompilationUnits = null;
- deletedCompilationUnits = null;
- }
-
- /**
- * Returns the working copy remembered for the compilation unit encoded in the given editor
- * input.
- *
- * @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
- */
- protected ICompilationUnit primGetWorkingCopy(ICompilationUnit cu) throws CoreException {
- return null;
- }
-
- /**
- * This will save all of the referenced CompilationUnits to be saved.
- */
- protected void primSaveCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) {
- saveNewCompilationUnits(monitor);
- getDeletedCompilationUnits().clear();
- }
-
- /**
- * This will save all of the new CompilationUnits to be saved.
- */
- protected void primSaveOnlyNewCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) {
- List cus = getNeedsSavingCompilationUnits();
- ICompilationUnit wc;
- for (int i = 0; i < cus.size(); i++) {
- wc = (ICompilationUnit) cus.get(i);
- commitWorkingCopy(wc, monitor);
- }
- cus.clear();
- }
-
- protected void removeDeletedCompilationUnit(ICompilationUnit cu) {
- if (getDeletedCompilationUnits().remove(cu) != null) {
- if (cu.isWorkingCopy()) {
- ICompilationUnit original, nextCU, testCU;
- original = cu.getPrimary();
- Set cus = getDeletedCompilationUnits().keySet();
- Iterator it = cus.iterator();
- while (it.hasNext()) {
- nextCU = (ICompilationUnit) it.next();
- testCU = nextCU.isWorkingCopy() ? (ICompilationUnit) nextCU.getPrimary() : nextCU;
- if (testCU.equals(original)) {
- cus.remove(nextCU);
- return;
- }
- }
- }
- }
- }
-
- protected void reviveDeletedCompilationUnit(ICompilationUnit cu, Object[] info, IProgressMonitor pm) {
- if (info[0] != null && info[1] != null) {
- String typeName = cu.getElementName();
- IPackageFragment pack = (IPackageFragment) info[0];
- String source = (String) info[1];
- try {
- ICompilationUnit existingCU = pack.getCompilationUnit(typeName);
- if (existingCU.exists() && getNewCompilationUnits().contains(existingCU))
- existingCU.delete(false, pm);
- pack.createCompilationUnit(typeName, source, false, pm);
- } catch (JavaModelException e) {
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e);
- }
- }
- }
-
- protected void reviveDeletedCompilationUnits() {
- if (getDeletedCompilationUnits().isEmpty())
- return;
- IProgressMonitor pm = new org.eclipse.core.runtime.NullProgressMonitor();
- Iterator it = getDeletedCompilationUnits().entrySet().iterator();
- Map.Entry entry;
- ICompilationUnit cu;
- Object[] info;
- while (it.hasNext()) {
- entry = (Map.Entry) it.next();
- cu = (ICompilationUnit) entry.getKey();
- info = (Object[]) entry.getValue();
- reviveDeletedCompilationUnit(cu, info, pm);
- }
-
- }
-
- protected void runOperation(IWorkspaceRunnable aRunnable, IProgressMonitor monitor, boolean validate) {
- primRunOperation(aRunnable, monitor);
-
- // TODO Break the validator depedency
- // if (validate)
- // primRunOperation(aRunnable, monitor);
- // else {
- // IProject proj = getValidationProject();
- //
- // ValidatorManager mgr = ValidatorManager.getManager();
- // boolean disableValidators = proj != null;
- // boolean wasSuspended = false;
- // if (disableValidators) {
- // wasSuspended = mgr.isSuspended(proj);
- // if (!wasSuspended)
- // mgr.suspendValidation(proj, true);
- // }
- // try {
- // primRunOperation(aRunnable, monitor);
- // } finally {
- // if (disableValidators && !wasSuspended)
- // mgr.suspendValidation(proj, false);
- // }
- // }
- }
-
- protected void primRunOperation(IWorkspaceRunnable aRunnable, IProgressMonitor monitor) {
-
- if (aRunnable != null) {
- //if (workspace.isTreeLocked())
- //Logger.getLogger().logTrace(ResourceHandler.getString("Cannot_run_J2EEUIWorkingCo_ERROR_"));
- // //$NON-NLS-1$ = "Cannot run J2EEUIWorkingCopyManager operation because the Workspace
- // tree is locked."
- //else {
- if (!WTPCommonPlugin.getWorkspace().isTreeLocked()) {
- try {
- WTPCommonPlugin.getWorkspace().run(aRunnable, monitor);
- } catch (CoreException e) {
- throw new SaveFailedException(e);
- }
- }
- }
- }
-
- /**
- * This will save all of the referenced CompilationUnits to be saved.
- */
- public void saveCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) {
- getSaveHandler().access();
- try {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor aMonitor) {
- primSaveCompilationUnits(aMonitor);
- }
- };
- runOperation(runnable, monitor, true);
- } catch (SaveFailedException ex) {
- getSaveHandler().handleSaveFailed(ex, monitor);
- } finally {
- getSaveHandler().release();
- }
- }
-
- /**
- * This will save all of the referenced CompilationUnits to be saved.
- */
- protected void saveNewCompilationUnits(IProgressMonitor monitor) {
- primSaveOnlyNewCompilationUnits(monitor);
- getOriginalNewCompilationUnits().clear();
- getNewCompilationUnits().clear();
- }
-
- /**
- * This will save all of the new CompilationUnits to be saved.
- */
- public void saveOnlyNewCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) {
- getSaveHandler().access();
- try {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor aMonitor) {
- primSaveOnlyNewCompilationUnits(aMonitor);
- }
- };
- runOperation(runnable, monitor, false);
- } catch (SaveFailedException ex) {
- getSaveHandler().handleSaveFailed(ex, monitor);
- } finally {
- getSaveHandler().release();
- }
- }
-
- protected boolean shouldSaveReadOnly(ICompilationUnit wc) {
- IResource resource = null;
-
- resource = (IResource) wc.getPrimary().getAdapter(IRESOURCE_CLASS);
-
- if (resource == null || resource.getType() != IResource.FILE || !resource.getResourceAttributes().isReadOnly())
- return false;
-
- return getSaveHandler().shouldContinueAndMakeFileEditable((IFile) resource);
- }
-
- /**
- * @see com.ibm.etools.j2ee.workbench.IJ2EEWorkingCopyManager#hasWorkingCopies()
- */
- public boolean hasWorkingCopies() {
- return (deletedCompilationUnits != null && !deletedCompilationUnits.isEmpty()) || (needsSavingCompilationUnits != null && !needsSavingCompilationUnits.isEmpty()) || (newCompilationUnits != null && !newCompilationUnits.isEmpty());
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManager.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManager.java
deleted file mode 100644
index 35ccc89fb..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManager.java
+++ /dev/null
@@ -1,49 +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.common.jdt.internal.integration;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-
-/**
- * @author Administrator
- *
- *
- */
-public interface WorkingCopyManager extends WorkingCopyProvider {
-
- void dispose();
-
- java.util.Set getAffectedFiles();
-
- /**
- * This will save all of the referenced CompilationUnits to be saved.
- */
- void saveCompilationUnits(IProgressMonitor monitor);
-
- /**
- * This will save all of the new CompilationUnits to be saved.
- */
- void saveOnlyNewCompilationUnits(IProgressMonitor monitor);
-
- /**
- * Method hasWorkingCopies.
- *
- * @return boolean
- */
- boolean hasWorkingCopies();
-
- /**
- * Revert all working copies.
- */
- void revert();
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManagerFactory.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManagerFactory.java
deleted file mode 100644
index 3e98f8a88..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManagerFactory.java
+++ /dev/null
@@ -1,57 +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.common.jdt.internal.integration;
-
-import org.eclipse.jem.util.UIContextDetermination;
-
-
-/**
- * @author mdelder
- *
- *
- */
-public class WorkingCopyManagerFactory {
-
- // protected static Class workingCopyManagerClass;
-
- public static WorkingCopyManager newRegisteredInstance() {
- return (WorkingCopyManager) UIContextDetermination.createInstance("workingCopyManager"); //$NON-NLS-1$
- }
-
- // public static IWorkingCopyManager createWorkingCopyManager() {
- // if (getWorkingCopyManagerClass() != null)
- // try {
- // return (IWorkingCopyManager) getWorkingCopyManagerClass().newInstance();
- // } catch (InstantiationException e1) {
- // } catch (IllegalAccessException e2) {
- // }
- // return null;
- // }
- //
- // /**
- // * Insert the method's description here.
- // * Creation date: (4/26/2001 7:53:15 AM)
- // * @return java.lang.Class
- // */
- // public static java.lang.Class getWorkingCopyManagerClass() {
- // return workingCopyManagerClass;
- // }
- //
- // /**
- // * Insert the method's description here.
- // * Creation date: (4/26/2001 7:53:15 AM)
- // * @param newWorkingCopyManagerClass java.lang.Class
- // */
- // public static void setWorkingCopyManagerClass(java.lang.Class newWorkingCopyManagerClass) {
- // workingCopyManagerClass = newWorkingCopyManagerClass;
- // }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyProvider.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyProvider.java
deleted file mode 100644
index 2696f5c54..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyProvider.java
+++ /dev/null
@@ -1,60 +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.common.jdt.internal.integration;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-
-
-/**
- * The user of the Java code generation framework must supply an implementation of this interface.
- * The framework will obtain compilation working copies from this interface. The supplier of the
- * implementation is responsible for committing the working copies when appropriate for the user's
- * edit model.
- */
-public interface WorkingCopyProvider {
-
- /**
- * This will delete compilation unit from the workbench and fix the internal references for this
- * working copy manager.
- *
- * @param cu
- * the compilation unit to delete
- * @param monitor
- * the progress monitor to use for the delete
- */
- void delete(ICompilationUnit cu, IProgressMonitor monitor);
-
- /**
- * Returns the working copy remembered for the compilation unit. That is, the manager already
- * has a working copy for this unit, it does not create a new working copy. Does not connect the
- * edit model to the working copy.
- *
- * @param input
- * the compilation unit
- * @return the working copy of the compilation unit, or <code>null</code> it there is no
- * remembered working copy for this compilation unit
- */
- ICompilationUnit getExistingWorkingCopy(ICompilationUnit cu) throws CoreException;
-
- /**
- * Returns the working copy remembered for the compilation unit or creates a new working copy
- * for the compilation unit and returns it. If a working copy is passed in, it is returned.
- *
- * @param input
- * the compilation unit
- * @return the working copy of the compilation unit
- * @exception CoreException
- * if the working copy can not be created
- */
- ICompilationUnit getWorkingCopy(ICompilationUnit cu, boolean forNewCU) throws CoreException;
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/IJavaFacetInstallDataModelProperties.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/IJavaFacetInstallDataModelProperties.java
deleted file mode 100644
index 755e31c41..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/IJavaFacetInstallDataModelProperties.java
+++ /dev/null
@@ -1,17 +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.common.project.facet;
-
-public interface IJavaFacetInstallDataModelProperties {
-
- public static final String SOURCE_FOLDER_NAME = "IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME"; //$NON-NLS-1$
- public static final String DEFAULT_OUTPUT_FOLDER_NAME = "IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME"; //$NON-NLS-1$
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetInstallDataModelProvider.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetInstallDataModelProvider.java
deleted file mode 100644
index c404d7db4..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetInstallDataModelProvider.java
+++ /dev/null
@@ -1,60 +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.common.project.facet;
-
-import java.util.Hashtable;
-import java.util.Set;
-
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.project.facet.IProductConstants;
-import org.eclipse.wst.project.facet.ProductManager;
-
-public class JavaFacetInstallDataModelProvider extends FacetInstallDataModelProvider implements IJavaFacetInstallDataModelProperties {
-
- public JavaFacetInstallDataModelProvider() {
- super();
- }
-
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(SOURCE_FOLDER_NAME);
- propertyNames.add(DEFAULT_OUTPUT_FOLDER_NAME);
- return propertyNames;
- }
-
- public Object getDefaultProperty(String propertyName) {
- if (FACET_ID.equals(propertyName)) {
- return IModuleConstants.JST_JAVA;
- } else if (FACET_VERSION.equals(propertyName)) {
- Hashtable javaOptions = JavaCore.getOptions();
- String jdtVersion = (String)javaOptions.get(JavaCore.COMPILER_COMPLIANCE);
- if(jdtVersion == null){
- jdtVersion = (String)JavaCore.getDefaultOptions().get(JavaCore.COMPILER_COMPLIANCE);
- }
- 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;
- }
- return JavaFacetUtils.JAVA_50;
-
- } else if (SOURCE_FOLDER_NAME.equals(propertyName)) {
- return "src"; //$NON-NLS-1$
- } else if (DEFAULT_OUTPUT_FOLDER_NAME.equals(propertyName)) {
- return ProductManager.getProperty(IProductConstants.OUTPUT_FOLDER);
- }
-
- return super.getDefaultProperty(propertyName);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetInstallDelegate.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetInstallDelegate.java
deleted file mode 100644
index e66fa5936..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetInstallDelegate.java
+++ /dev/null
@@ -1,112 +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.common.project.facet;
-
-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.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-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.wst.common.frameworks.datamodel.IDataModel;
-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 JavaFacetInstallDelegate 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;
-
- // Create the source and the output directories.
-
- final IWorkspace ws = ResourcesPlugin.getWorkspace();
-
- final IPath pjpath = project.getFullPath();
- IJavaProject jproject = null;
- if( project.exists()){
- jproject = JavaCore.create(project);
- }
-
- if( !jproject.exists()){
- String srcFolderName = model.getStringProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME);
- final IPath srcdir = pjpath.append(srcFolderName);
-
- if( ! srcdir.equals( pjpath ) )
- {
- ws.getRoot().getFolder(srcdir).getLocation().toFile().mkdirs();
- }
-
- String outputFolderName = model.getStringProperty(IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME);
- final IPath outdir = pjpath.append(outputFolderName);
-
- if( ! outdir.equals( pjpath ) )
- {
- ws.getRoot().getFolder(outdir).getLocation().toFile().mkdirs();
- }
-
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
-
- // Add the java nature. This will automatically add the builder.
-
- final IProjectDescription desc = project.getDescription();
- final String[] current = desc.getNatureIds();
- final String[] replacement = new String[current.length + 1];
- System.arraycopy(current, 0, replacement, 0, current.length);
- replacement[current.length] = JavaCore.NATURE_ID;
- desc.setNatureIds(replacement);
- project.setDescription(desc, null);
-
- // Set up the sourcepath and the output directory.
-
- final IJavaProject jproj = JavaCore.create(project);
- final IClasspathEntry[] cp = {JavaCore.newSourceEntry(srcdir)};
-
- jproj.setRawClasspath(cp, outdir, null);
- jproj.save(null, true);
-
- // Setup the classpath.
-
- JavaFacetUtils.resetClasspath( project, null, fv );
- }
-
- // Set the compiler comliance level for the project. Ignore whether
- // this might already be set so at the workspace level in case
- // workspace settings change later or the project is included in a
- // different workspace.
-
- JavaFacetUtils.setCompilerLevel(project, fv);
-
- if (monitor != null) {
- monitor.worked(1);
- }
- } finally {
- if (monitor != null) {
- monitor.done();
- }
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetRuntimeChangedDelegate.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetRuntimeChangedDelegate.java
deleted file mode 100644
index 216c3a3f1..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetRuntimeChangedDelegate.java
+++ /dev/null
@@ -1,60 +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.common.project.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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 JavaFacetRuntimeChangedDelegate
-
- 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
- {
- JavaFacetUtils.resetClasspath( project, fv, fv );
-
- if( monitor != null )
- {
- monitor.worked( 1 );
- }
- }
- finally
- {
- if( monitor != null )
- {
- monitor.done();
- }
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetUtils.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetUtils.java
deleted file mode 100644
index 2a8be9041..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetUtils.java
+++ /dev/null
@@ -1,324 +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.common.project.facet;
-
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-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.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
-import org.eclipse.osgi.util.NLS;
-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;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public final class JavaFacetUtils
-{
- public static final IProjectFacet JAVA_FACET
- = ProjectFacetsManager.getProjectFacet( IModuleConstants.JST_JAVA );
-
- public static final IProjectFacetVersion JAVA_13
- = JAVA_FACET.getVersion( "1.3" ); //$NON-NLS-1$
-
- public static final IProjectFacetVersion JAVA_14
- = JAVA_FACET.getVersion( "1.4" ); //$NON-NLS-1$
-
- public static final IProjectFacetVersion JAVA_50
- = JAVA_FACET.getVersion( "5.0" ); //$NON-NLS-1$
-
- public static final IProjectFacetVersion JAVA_60
- = JAVA_FACET.getVersion( "6.0" ); //$NON-NLS-1$
-
- public static String getCompilerLevel( final IProject project )
- {
- IScopeContext context = new ProjectScope( project );
- IEclipsePreferences prefs = context.getNode( JavaCore.PLUGIN_ID );
- String level = prefs.get( JavaCore.COMPILER_COMPLIANCE, null );
-
- if( level == null )
- {
- context = new InstanceScope();
- prefs = context.getNode( JavaCore.PLUGIN_ID );
- level = prefs.get( JavaCore.COMPILER_COMPLIANCE, null );
- }
-
- if( level == null )
- {
- final Hashtable defaults = JavaCore.getDefaultOptions();
- level = (String) defaults.get( JavaCore.COMPILER_COMPLIANCE );
- }
-
- return level;
- }
-
- public static void setCompilerLevel( final IProject project,
- final IProjectFacetVersion fv )
-
- throws CoreException
-
- {
- setCompilerLevel( project, facetToCompilerLevel( fv ) );
- }
-
- public static void setCompilerLevel( final IProject project,
- final String level )
-
- throws CoreException
-
- {
- final IScopeContext context = new ProjectScope( project );
-
- final IEclipsePreferences prefs
- = context.getNode( JavaCore.PLUGIN_ID );
-
- if( level.equals( JavaCore.VERSION_1_3 ) )
- {
- prefs.put( JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_3 );
- prefs.put( JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_1 );
- prefs.put( JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3 );
- prefs.put( JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.IGNORE );
- prefs.put( JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.IGNORE );
- }
- else if( level.equals( JavaCore.VERSION_1_4 ) )
- {
- prefs.put( JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4 );
- prefs.put( JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2 );
- prefs.put( JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3 );
- prefs.put( JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.WARNING );
- prefs.put( JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING );
- }
- else if( level.equals( JavaCore.VERSION_1_5 ) )
- {
- prefs.put( JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5 );
- prefs.put( JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5 );
- prefs.put( JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5 );
- prefs.put( JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR );
- prefs.put( JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR );
- }
- else if( level.equals( JavaCore.VERSION_1_6 ) )
- {
- prefs.put( JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_6 );
- prefs.put( JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_6 );
- prefs.put( JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6 );
- prefs.put( JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR );
- prefs.put( JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR );
- }
- else
- {
- throw new IllegalStateException();
- }
-
- try
- {
- prefs.flush();
- }
- catch( BackingStoreException e )
- {
- // TODO: Handle this.
- }
- }
-
- public static void scheduleFullBuild( final IProject project )
- {
- // This code is modeled after the code in
- // org.eclipse.jdt.internal.ui.util.CoreUtility.getBuildJob() method.
-
- final IWorkspace ws = ResourcesPlugin.getWorkspace();
-
- final String msg
- = NLS.bind( Resources.buildingMsg, project.getName() );
-
- final Job buildJob = new Job( msg )
- {
- public IStatus run( final IProgressMonitor monitor )
- {
- monitor.beginTask( msg, 2 );
-
- try
- {
- project.build( IncrementalProjectBuilder.FULL_BUILD,
- new SubProgressMonitor( monitor, 1 ) );
-
- ws.build( IncrementalProjectBuilder.INCREMENTAL_BUILD,
- new SubProgressMonitor( monitor, 1 ) );
-
- }
- catch( CoreException e )
- {
- return e.getStatus();
- }
- finally
- {
- monitor.done();
- }
-
- return Status.OK_STATUS;
- }
-
- public boolean belongsTo( final Object family )
- {
- return family == ResourcesPlugin.FAMILY_MANUAL_BUILD;
- }
- };
-
- buildJob.setRule( ws.getRuleFactory().buildRule() );
- buildJob.schedule();
- }
-
- public static void resetClasspath( final IProject project,
- final IProjectFacetVersion oldver,
- final IProjectFacetVersion newver )
-
- throws CoreException
-
- {
- if( oldver != null )
- {
- ClasspathHelper.removeClasspathEntries( project, oldver );
- }
-
- // If this was a java project before it became a faceted project or
- // the JRE container has been added manually, the above method will not
- // delete the old JRE container. Do it manually.
-
- removeJreContainer( project );
-
- if( ! ClasspathHelper.addClasspathEntries( project, newver ) )
- {
- final IVMInstall vm = JavaRuntime.getDefaultVMInstall();
-
- if( vm != null )
- {
- IPath path = new Path( JavaRuntime.JRE_CONTAINER );
- path = path.append( vm.getVMInstallType().getId() );
- path = path.append( vm.getName() );
-
- final IClasspathEntry cpe
- = JavaCore.newContainerEntry( path );
-
- final List entries = Collections.singletonList( cpe );
-
- ClasspathHelper.addClasspathEntries( project, newver, entries );
- }
- }
- }
-
- private static void removeJreContainer( final IProject proj )
-
- throws CoreException
-
- {
- final IJavaProject jproj = JavaCore.create( proj );
- final IClasspathEntry[] cp = jproj.getRawClasspath();
-
- int pos = -1;
-
- for( int i = 0; i < cp.length; i++ )
- {
- final IClasspathEntry cpe = cp[ i ];
-
- if( cpe.getEntryKind() == IClasspathEntry.CPE_CONTAINER &&
- cpe.getPath().segment( 0 ).equals( JavaRuntime.JRE_CONTAINER ) )
- {
- pos = i;
- break;
- }
- }
-
- if( pos == -1 )
- {
- return;
- }
-
- final IClasspathEntry[] newcp
- = new IClasspathEntry[ cp.length - 1 ];
-
- System.arraycopy( cp, 0, newcp, 0, pos );
- System.arraycopy( cp, pos + 1, newcp, pos, newcp.length - pos );
-
- jproj.setRawClasspath( newcp, null );
- }
-
- public static IProjectFacetVersion compilerLevelToFacet( final String ver )
- {
- if( ver.equals( "1.5" ) ) //$NON-NLS-1$
- {
- return JavaFacetUtils.JAVA_50;
- }
- else if( ver.equals( "1.6" ) ) //$NON-NLS-1$
- {
- return JavaFacetUtils.JAVA_60;
- }
- else
- {
- return JavaFacetUtils.JAVA_FACET.getVersion( ver );
- }
- }
-
- public static String facetToCompilerLevel( final IProjectFacetVersion fv )
- {
- if( fv == JAVA_50 )
- {
- return JavaCore.VERSION_1_5;
- }
- else if( fv == JAVA_60 )
- {
- return JavaCore.VERSION_1_6;
- }
- else
- {
- return fv.getVersionString();
- }
- }
-
- private static final class Resources
-
- extends NLS
-
- {
- public static String buildingMsg;
-
- static
- {
- initializeMessages( JavaFacetUtils.class.getName(),
- Resources.class );
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetUtils.properties b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetUtils.properties
deleted file mode 100644
index 9f14d1c09..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetUtils.properties
+++ /dev/null
@@ -1 +0,0 @@
-buildingMsg = Building Project {0} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetValidator.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetValidator.java
deleted file mode 100644
index b675b77e2..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetValidator.java
+++ /dev/null
@@ -1,71 +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.common.project.facet;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.util.NLS;
-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.IProjectFacetVersion;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public final class JavaFacetValidator
-
- implements IFacetedProjectValidator
-
-{
- public static final String MARKER_ID
- = "org.eclipse.jst.common.frameworks.javaVersionMismatch"; //$NON-NLS-1$
-
- public static final String ATTR_FACET_VERSION = "facetVersion"; //$NON-NLS-1$
- public static final String ATTR_COMPILER_LEVEL = "compilerLevel"; //$NON-NLS-1$
-
- public void validate( final IFacetedProject fproj )
-
- throws CoreException
-
- {
- final String level
- = JavaFacetUtils.getCompilerLevel( fproj.getProject() );
-
- final IProjectFacetVersion fv
- = fproj.getInstalledVersion( JavaFacetUtils.JAVA_FACET );
-
- if( JavaFacetUtils.compilerLevelToFacet( level ) != fv )
- {
- final IMarker marker
- = fproj.createErrorMarker( MARKER_ID, Resources.versionsDontMatch );
-
- marker.setAttribute( ATTR_FACET_VERSION, fv.getVersionString() );
- marker.setAttribute( ATTR_COMPILER_LEVEL, level );
- }
- }
-
- private static final class Resources
-
- extends NLS
-
- {
- public static String versionsDontMatch;
-
- static
- {
- initializeMessages( JavaFacetValidator.class.getName(),
- Resources.class );
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetValidator.properties b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetValidator.properties
deleted file mode 100644
index bcd233c51..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetValidator.properties
+++ /dev/null
@@ -1 +0,0 @@
-versionsDontMatch = Java compiler level does not match the version of the installed Java project facet. \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetVersionChangeDelegate.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetVersionChangeDelegate.java
deleted file mode 100644
index 27fba51b6..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaFacetVersionChangeDelegate.java
+++ /dev/null
@@ -1,80 +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.common.project.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public final class JavaFacetVersionChangeDelegate
-
- 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
- {
- // Find the version that's currently installed.
-
- final IFacetedProject fproj
- = ProjectFacetsManager.create( project );
-
- final IProjectFacetVersion oldver
- = fproj.getInstalledVersion( fv.getProjectFacet() );
-
- // Reset the classpath.
-
- JavaFacetUtils.resetClasspath( project, oldver, fv );
-
- // Reset the compiler level.
-
- JavaFacetUtils.setCompilerLevel( project, fv );
-
- // Schedule a full build of the project.
-
- JavaFacetUtils.scheduleFullBuild( project );
-
- if( monitor != null )
- {
- monitor.worked( 1 );
- }
- }
- finally
- {
- if( monitor != null )
- {
- monitor.done();
- }
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaProjectFacetCreationDataModelProvider.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaProjectFacetCreationDataModelProvider.java
deleted file mode 100644
index 5d24448fa..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/JavaProjectFacetCreationDataModelProvider.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.common.project.facet;
-
-import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class JavaProjectFacetCreationDataModelProvider extends FacetProjectCreationDataModelProvider {
-
- public JavaProjectFacetCreationDataModelProvider() {
- super();
- }
-
- public void init() {
- super.init();
- FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
- IDataModel simpleWebFacet = DataModelFactory.createDataModel(new JavaFacetInstallDataModelProvider());
- map.add(simpleWebFacet);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/WtpUtils.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/WtpUtils.java
deleted file mode 100644
index 0d05c4b26..000000000
--- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/project/facet/WtpUtils.java
+++ /dev/null
@@ -1,70 +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.common.project.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public final class WtpUtils
-{
- private WtpUtils() {}
-
- private static final String WTP_NATURE
- = "org.eclipse.wst.common.modulecore.ModuleCoreNature"; //$NON-NLS-1$
-
- private static final String JEM_NATURE
- = "org.eclipse.jem.workbench.JavaEMFNature"; //$NON-NLS-1$
-
- public static void addNatures( final IProject project )
-
- throws CoreException
-
- {
- final IProjectDescription desc = project.getDescription();
- final String[] current = desc.getNatureIds();
- final String[] replacement = new String[ current.length + 2 ];
- System.arraycopy( current, 0, replacement, 0, current.length );
- replacement[ current.length ] = WTP_NATURE;
- replacement[ current.length + 1 ] = JEM_NATURE;
- desc.setNatureIds( replacement );
- project.setDescription( desc, null );
- }
-
- public static void addNaturestoEAR( final IProject project )
-
- throws CoreException
-
- {
- final IProjectDescription desc = project.getDescription();
- final String[] current = desc.getNatureIds();
- final String[] replacement = new String[ current.length + 1 ];
- System.arraycopy( current, 0, replacement, 0, current.length );
- replacement[ current.length ] = WTP_NATURE;
- desc.setNatureIds( replacement );
- project.setDescription( desc, null );
- }
-
- public static void removeNatures( final IProject project )
-
- throws CoreException
-
- {
- ProjectUtilities.removeNatureFromProject( project, WTP_NATURE );
- ProjectUtilities.removeNatureFromProject( project, JEM_NATURE );
- }
-}

Back to the top