Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2010-09-28 16:25:56 -0400
committerpfullbright2010-09-28 16:25:56 -0400
commit75e1c5d953f160acf6f8cece28970a39245925c5 (patch)
treee7be3363fb6c2298eeef793d3f87c79e42ddb871
parent93d1a2dd781c87ac229d4bc53e0d7939f0ad20b5 (diff)
downloadwebtools.dali-75e1c5d953f160acf6f8cece28970a39245925c5.tar.gz
webtools.dali-75e1c5d953f160acf6f8cece28970a39245925c5.tar.xz
webtools.dali-75e1c5d953f160acf6f8cece28970a39245925c5.zip
reworked jpa project wizard
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/plugin.properties14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/plugin.xml394
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/FacetTools.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaProjectCreationDataModelProperties.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaProjectCreationDataModelProvider.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaSEProjectCreationDataModelProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF5
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/plugin.properties7
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/plugin.xml93
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/MigrateJavaProjectAction.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/ConvertJavaProjectToJpaCommandHandler.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaEEProjectWizard.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaSEProjectWizard.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/AddToEarComposite.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/JpaProjectWizard.java (renamed from jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaProjectWizard.java)25
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/JpaProjectWizardFirstPage.java (renamed from jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaProjectWizardFirstPage.java)46
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProperties.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProvider.java (renamed from jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaEEProjectCreationDataModelProvider.java)228
20 files changed, 776 insertions, 657 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.core/plugin.properties
index 9f9e846f07..0ed9645f29 100644
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.properties
+++ b/jpa/plugins/org.eclipse.jpt.core/plugin.properties
@@ -22,8 +22,10 @@
pluginName = Dali Java Persistence Tools - Core
providerName = Eclipse Web Tools Platform
-JPA_PLATFORM=JPA Platform
+JPA_PLATFORM=JPA Platforms
+LIBRARY_VALIDATORS=Library Validators
RESOURCE_LOCATORS=Resource Locators
+
JPA_RESOURCE_MODEL_PROVIDERS=JPA Resource Model Providers
JPA_PROBLEM_MARKER=JPA Problem Marker
JPA_FILE_CONTENT=JPA File Content
@@ -40,17 +42,11 @@ GENERIC_2_0_PLATFORM_LABEL=Generic 2.0
NO_OP_LIBRARY_PROVIDER_WARNING = Library configuration is disabled. The user may need to configure further classpath changes later.
NO_OP_LIBRARY_PROVIDER_MESSAGE = The JPA facet requires a JPA implementation library to be present on the project classpath. By disabling library configuration, the user takes on the responsibility of ensuring that the classpath is configured appropriately via alternate means.
-JPA_WTP_LIBRARY_PROVIDER_LABEL=User Library for EE Project
+DEPRECATED_USER_LIBRARY_PROVIDER_LABEL=User Library (deprecated)
-JPA_PREREQ_GROUP_LABEL="JPA prerequisite facets"
JPA_FACET_LABEL=JPA
JPA_FACET_DESCRIPTION=Adds support for writing persistent meta-data using the Java Persistence API (JPA).
-JPA_SE_TEMPLATE_LABEL=JPA SE Project
-JPA_EE_TEMPLATE_LABEL=JPA EE Project
-JPA_1.0_SE_PRESET_LABEL=Minimal JPA 1.0 Configuration
-JPA_1.0_EE_PRESET_LABEL=Minimal JPA 1.0 EE Configuration
-JPA_2.0_SE_PRESET_LABEL=Minimal JPA 2.0 Configuration
-JPA_2.0_EE_PRESET_LABEL=Minimal JPA 2.0 EE Configuration
+JPA_TEMPLATE_LABEL=JPA Project
JPA_VALIDATOR=JPA Validator
JPA_PROBLEM=JPA Problem
diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.core/plugin.xml
index 642672550e..dc19038038 100644
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.core/plugin.xml
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
+ Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0, which accompanies this distribution
+ and is available at http://www.eclipse.org/legal/epl-v10.html.
+
+ Contributors:
+ Oracle - initial API and implementation
-->
<plugin>
@@ -21,6 +21,12 @@
<extension-point
+ id="libraryValidators"
+ name="%LIBRARY_VALIDATORS"
+ schema="schema/libraryValidators.exsd"/>
+
+
+ <extension-point
id="resourceLocators"
name="%RESOURCE_LOCATORS"
schema="schema/resourceLocators.exsd"/>
@@ -112,6 +118,20 @@
class="org.eclipse.jpt.core.internal.JpaPlatformTester"/>
<propertyTester
+ id="org.eclipse.jpt.core.propertyTester.jpaPlatformDescription"
+ type="org.eclipse.jpt.core.platform.JpaPlatformDescription"
+ namespace="org.eclipse.jpt.core"
+ properties="jpaPlatform, jpaPlatformGroup"
+ class="org.eclipse.jpt.core.internal.JpaPlatformTester"/>
+
+ <propertyTester
+ id="org.eclipse.jpt.core.propertyTester.jpaLibraryProviderConfig"
+ type="org.eclipse.jpt.core.internal.libprov.JpaLibraryProviderInstallOperationConfig"
+ namespace="org.eclipse.jpt.core"
+ properties="jpaPlatform, jpaPlatformGroup"
+ class="org.eclipse.jpt.core.internal.JpaPlatformTester"/>
+
+ <propertyTester
id="org.eclipse.jpt.core.propertyTester.xmlResource"
type="org.eclipse.jpt.core.resource.xml.JpaXmlResource"
namespace="org.eclipse.jpt.core"
@@ -126,11 +146,11 @@
class="org.eclipse.jpt.core.internal.resource.xml.JpaXmlResourcePropertyTester"/>
<propertyTester
- id="org.eclipse.jpt.core.propertyTester.facet"
- type="org.eclipse.wst.common.project.facet.core.IProjectFacetVersion"
+ id="org.eclipse.jpt.core.propertyTester.libraryProvider"
+ type="org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider"
namespace="org.eclipse.jpt.core"
- properties="group"
- class="org.eclipse.jpt.core.internal.FacetVersionPropertyTester"/>
+ properties="id, extendsId"
+ class="org.eclipse.jpt.core.internal.libprov.LibraryProviderPropertyTester"/>
</extension>
@@ -203,10 +223,36 @@
<extension
+ point="org.eclipse.jpt.core.libraryValidators">
+
+ <libraryValidator
+ id="genericUserLibraryValidator"
+ class="org.eclipse.jpt.core.internal.libval.GenericJpaUserLibraryValidator">
+ <enablement>
+ <with variable="libraryProvider">
+ <test property="org.eclipse.jpt.core.extendsId" value="jpa-user-library-provider"/>
+ </with>
+ </enablement>
+ </libraryValidator>
+
+ <libraryValidator
+ id="genericEclipselinkBundlesLibraryValidator"
+ class="org.eclipse.jpt.core.internal.libval.GenericEclipseLinkBundlesLibraryValidator">
+ <enablement>
+ <with variable="libraryProvider">
+ <test property="org.eclipse.jpt.core.extendsId" value="eclipselink-bundles-library-provider"/>
+ </with>
+ </enablement>
+ </libraryValidator>
+
+ </extension>
+
+
+ <extension
point="org.eclipse.jpt.core.resourceLocators">
<resourceLocator
- id="org.eclipse.jpt.core.simpleJavaResourceLocator"
+ id="simpleJavaResourceLocator"
class="org.eclipse.jpt.core.internal.resource.SimpleJavaResourceLocator"
priority="lowest">
<enablement>
@@ -220,7 +266,7 @@
</resourceLocator>
<resourceLocator
- id="org.eclipse.jpt.core.moduleResourceLocator"
+ id="moduleResourceLocator"
class="org.eclipse.jpt.core.internal.resource.ModuleResourceLocator"
priority="lower">
<enablement>
@@ -234,7 +280,7 @@
</resourceLocator>
<resourceLocator
- id="org.eclipse.jpt.core.webModuleResourceLocator"
+ id="webModuleResourceLocator"
class="org.eclipse.jpt.core.internal.resource.WebModuleResourceLocator"
priority="low">
<enablement>
@@ -248,7 +294,7 @@
</resourceLocator>
<resourceLocator
- id="org.eclipse.jpt.core.pluginResourceLocator"
+ id="pluginResourceLocator"
class="org.eclipse.jpt.core.internal.resource.PluginResourceLocator"
priority="normal">
<enablement>
@@ -274,7 +320,7 @@
point="org.eclipse.jst.common.project.facet.core.legacyLibraryProviderDetectors">
<detector
- class="org.eclipse.jpt.core.internal.facet.LegacyJpaLibraryProviderDetector"/>
+ class="org.eclipse.jpt.core.internal.libprov.LegacyJpaLibraryProviderDetector"/>
</extension>
@@ -283,20 +329,26 @@
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
<provider
+ id="jpt-no-op-library-provider"
+ extends="no-op-library-provider"
+ abstract="true">
+ <param name="message" value="%NO_OP_LIBRARY_PROVIDER_MESSAGE"/>
+ <param name="warning" value="%NO_OP_LIBRARY_PROVIDER_WARNING"/>
+ </provider>
+
+ <provider
id="jpa-legacy-library-provider"
extends="legacy-library-provider"
hidden="true">
<action type="UNINSTALL">
<operation
- class="org.eclipse.jpt.core.internal.facet.LegacyJpaLibraryProviderInstallOperation"/>
+ class="org.eclipse.jpt.core.internal.libprov.LegacyJpaLibraryProviderUninstallOperation"/>
</action>
</provider>
- <provider
- id="jpa-no-op-library-provider"
- extends="no-op-library-provider">
- <param name="message" value="%NO_OP_LIBRARY_PROVIDER_MESSAGE"/>
- <param name="warning" value="%NO_OP_LIBRARY_PROVIDER_WARNING"/>
+ <provider
+ id="jpa-no-op-library-provider"
+ extends="jpt-no-op-library-provider">
<enablement>
<with variable="requestingProjectFacet">
<test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
@@ -304,156 +356,91 @@
</enablement>
</provider>
- <provider
- id="jpa-user-library-provider"
+ <provider
+ id="temp-wtp-user-library-provider"
extends="user-library-provider"
- abstract="true">
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="projectFacets">
- <iterate>
- <not>
- <test property="org.eclipse.jpt.core.group" value="modules" forcePluginActivation="true"/>
- </not>
- </iterate>
- </with>
- </and>
- </enablement>
+ abstract="true" >
+ <action type="INSTALL">
+ <config class="org.eclipse.jpt.core.internal.libprov.TempWtpUserLibraryProviderInstallOperationConfig"/>
+ <operation class="org.eclipse.jpt.core.internal.libprov.TempWtpUserLibraryProviderInstallOperation"/>
+ </action>
</provider>
<provider
- id="jpa-wtp-user-library-provider"
- extends="wtp-user-library-provider"
- abstract="true">
- <label>%JPA_WTP_LIBRARY_PROVIDER_LABEL</label>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <not>
- <with variable="projectFacets">
- <iterate>
- <not>
- <test property="org.eclipse.jpt.core.group" value="modules" forcePluginActivation="true"/>
- </not>
- </iterate>
- </with>
- </not>
- </and>
- </enablement>
- </provider>
-
- <provider
- id="jpa-osgi-bundles-library-provider"
- extends="osgi-bundles-library-provider"
- abstract="true">
+ id="jpa-user-library-provider"
+ extends="temp-wtp-user-library-provider">
<enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="projectFacets">
- <iterate>
- <not>
- <test property="org.eclipse.jpt.core.group" value="modules" forcePluginActivation="true"/>
- </not>
- </iterate>
- </with>
- </and>
+ <with variable="requestingProjectFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="jpt.jpa" forcePluginActivation="true"/>
+ </with>
</enablement>
+ <action type="INSTALL">
+ <config class="org.eclipse.jpt.core.internal.libprov.JpaUserLibraryProviderInstallOperationConfig"/>
+ <operation class="org.eclipse.jpt.core.internal.libprov.TempWtpUserLibraryProviderInstallOperation"/>
+ </action>
</provider>
- <provider
- id="jpa-wtp-osgi-bundles-library-provider"
- extends="wtp-osgi-bundles-library-provider"
+ <provider
+ id="jpa-deprecated-user-library-provider"
+ extends="user-library-provider"
abstract="true">
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <not>
- <with variable="projectFacets">
- <iterate>
- <not>
- <test property="org.eclipse.jpt.core.group" value="modules" forcePluginActivation="true"/>
- </not>
- </iterate>
- </with>
- </not>
- </and>
- </enablement>
+ <label>%DEPRECATED_USER_LIBRARY_PROVIDER_LABEL</label>
+ <action type="INSTALL">
+ <config class="org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig"/>
+ <operation class="org.eclipse.jst.common.project.facet.core.libprov.NoOpLibraryProviderOperation"/>
+ </action>
</provider>
<provider
id="jpa-generic1_0-user-library-provider"
- extends="jpa-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.core.internal.utility.KeyClassesValidator"/>
- <param name="validator.param.0" value="javax.persistence.Entity"/>
- <enablement>
- <with variable="jpaPlatform">
- <equals value="generic"/>
- </with>
- </enablement>
+ extends="jpa-deprecated-user-library-provider"
+ hidden="true">
</provider>
<provider
- id="jpa-generic1_0-wtp-user-library-provider"
- extends="jpa-wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.core.internal.utility.KeyClassesValidator"/>
- <param name="validator.param.0" value="javax.persistence.Entity"/>
- <enablement>
- <with variable="jpaPlatform">
- <equals value="generic"/>
- </with>
- </enablement>
+ id="jpa-generic2_0-user-library-provider"
+ extends="jpa-deprecated-user-library-provider"
+ hidden="true">
</provider>
<provider
- id="jpa-generic2_0-user-library-provider"
- extends="jpa-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.core.internal.utility.KeyClassesValidator"/>
- <param name="validator.param.0" value="javax.persistence.Entity"/>
- <param name="validator.param.1" value="javax.persistence.ElementCollection"/>
- <enablement>
- <with variable="jpaPlatform">
- <equals value="generic2_0"/>
- </with>
- </enablement>
+ id="temp-wtp-osgi-bundles-library-provider"
+ extends="osgi-bundles-library-provider"
+ abstract="true">
+ <action type="INSTALL">
+ <config class="org.eclipse.jpt.core.internal.libprov.TempWtpOsgiBundlesLibraryProviderInstallOperationConfig"/>
+ <operation class="org.eclipse.jst.j2ee.internal.common.classpath.WtpOsgiBundlesLibraryProviderInstallOperation"/>
+ </action>
</provider>
<provider
- id="jpa-generic2_0-wtp-user-library-provider"
- extends="jpa-wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.core.internal.utility.KeyClassesValidator"/>
- <param name="validator.param.0" value="javax.persistence.Entity"/>
- <param name="validator.param.1" value="javax.persistence.ElementCollection"/>
+ id="jpa-osgi-bundles-library-provider"
+ extends="temp-wtp-osgi-bundles-library-provider"
+ abstract="true">
<enablement>
- <with variable="jpaPlatform">
- <equals value="generic2_0"/>
+ <with variable="requestingProjectFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
</with>
</enablement>
+ <action type="INSTALL">
+ <config class="org.eclipse.jpt.core.internal.libprov.JpaOsgiBundlesLibraryProviderInstallOperationConfig"/>
+ <operation class="org.eclipse.jst.j2ee.internal.common.classpath.WtpOsgiBundlesLibraryProviderInstallOperation"/>
+ </action>
</provider>
- <provider
- id="eclipselink-102-osgi-bundles-library-provider"
- extends="jpa-osgi-bundles-library-provider">
- <label>EclipseLink 1.0.x</label>
- <param name="container.label" value="EclipseLink 1.0.x"/>
- <param name="bundle.0" value="javax.persistence:[1.0.0, 2.0.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[1.0.0, 1.1.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[1.0.0, 1.1.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[1.0.0, 1.1.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[1.0.0, 1.1.0)"/>
- </provider>
+ <!--
+ All osgi library providers that point to eclipselink bundles extend this.
+ It exists purely as an identifier for library validation.
+ -->
+ <provider
+ id="eclipselink-bundles-library-provider"
+ extends="jpa-osgi-bundles-library-provider"
+ abstract="true"/>
<provider
- id="eclipselink-102-wtp-osgi-bundles-library-provider"
- extends="jpa-wtp-osgi-bundles-library-provider">
+ id="eclipselink-102-osgi-bundles-library-provider"
+ extends="eclipselink-bundles-library-provider">
<label>EclipseLink 1.0.x</label>
<param name="container.label" value="EclipseLink 1.0.x"/>
<param name="bundle.0" value="javax.persistence:[1.0.0, 2.0.0)"/>
@@ -461,23 +448,16 @@
<param name="bundle.2" value="org.eclipse.persistence.jpa:[1.0.0, 1.1.0)"/>
<param name="bundle.3" value="org.eclipse.persistence.asm:[1.0.0, 1.1.0)"/>
<param name="bundle.4" value="org.eclipse.persistence.antlr:[1.0.0, 1.1.0)"/>
+ <enablement>
+ <with variable="requestingProjectFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa:1.0"/>
+ </with>
+ </enablement>
</provider>
<provider
id="eclipselink-110-osgi-bundles-library-provider"
- extends="jpa-osgi-bundles-library-provider">
- <label>EclipseLink 1.1.x</label>
- <param name="container.label" value="EclipseLink 1.1.x"/>
- <param name="bundle.0" value="javax.persistence:[1.99.0, 2.1.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[1.1.0, 1.2.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[1.1.0, 1.2.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[1.1.0, 1.2.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[1.1.0, 1.2.0)"/>
- </provider>
-
- <provider
- id="eclipselink-110-wtp-osgi-bundles-library-provider"
- extends="jpa-wtp-osgi-bundles-library-provider">
+ extends="eclipselink-bundles-library-provider">
<label>EclipseLink 1.1.x</label>
<param name="container.label" value="EclipseLink 1.1.x"/>
<param name="bundle.0" value="javax.persistence:[1.99.0, 2.1.0)"/>
@@ -485,23 +465,16 @@
<param name="bundle.2" value="org.eclipse.persistence.jpa:[1.1.0, 1.2.0)"/>
<param name="bundle.3" value="org.eclipse.persistence.asm:[1.1.0, 1.2.0)"/>
<param name="bundle.4" value="org.eclipse.persistence.antlr:[1.1.0, 1.2.0)"/>
+ <enablement>
+ <with variable="requestingProjectFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa:1.0"/>
+ </with>
+ </enablement>
</provider>
<provider
id="eclipselink-120-osgi-bundles-library-provider"
- extends="jpa-osgi-bundles-library-provider">
- <label>EclipseLink 1.2.x</label>
- <param name="container.label" value="EclipseLink 1.2.x"/>
- <param name="bundle.0" value="javax.persistence:[1.99.0, 2.1.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[1.2.0, 1.3.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[1.2.0, 1.3.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[1.2.0, 1.3.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[1.2.0, 1.3.0)"/>
- </provider>
-
- <provider
- id="eclipselink-120-wtp-osgi-bundles-library-provider"
- extends="jpa-wtp-osgi-bundles-library-provider">
+ extends="eclipselink-bundles-library-provider">
<label>EclipseLink 1.2.x</label>
<param name="container.label" value="EclipseLink 1.2.x"/>
<param name="bundle.0" value="javax.persistence:[1.99.0, 2.1.0)"/>
@@ -509,23 +482,16 @@
<param name="bundle.2" value="org.eclipse.persistence.jpa:[1.2.0, 1.3.0)"/>
<param name="bundle.3" value="org.eclipse.persistence.asm:[1.2.0, 1.3.0)"/>
<param name="bundle.4" value="org.eclipse.persistence.antlr:[1.2.0, 1.3.0)"/>
+ <enablement>
+ <with variable="requestingProjectFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa:1.0"/>
+ </with>
+ </enablement>
</provider>
<provider
id="eclipselink-200-osgi-bundles-library-provider"
- extends="jpa-osgi-bundles-library-provider">
- <label>EclipseLink 2.0.x</label>
- <param name="container.label" value="EclipseLink 2.0.x"/>
- <param name="bundle.0" value="javax.persistence:[2.0.0, 2.1.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[2.0.0, 2.1.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[2.0.0, 2.1.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[2.0.0, 2.1.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[2.0.0, 2.1.0)"/>
- </provider>
-
- <provider
- id="eclipselink-200-wtp-osgi-bundles-library-provider"
- extends="jpa-wtp-osgi-bundles-library-provider">
+ extends="eclipselink-bundles-library-provider">
<label>EclipseLink 2.0.x</label>
<param name="container.label" value="EclipseLink 2.0.x"/>
<param name="bundle.0" value="javax.persistence:[2.0.0, 2.1.0)"/>
@@ -537,19 +503,7 @@
<provider
id="eclipselink-210-osgi-bundles-library-provider"
- extends="jpa-osgi-bundles-library-provider">
- <label>EclipseLink 2.1.x</label>
- <param name="container.label" value="EclipseLink 2.1.x"/>
- <param name="bundle.0" value="javax.persistence:[2.0.0, 2.1.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[2.1.0, 2.2.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[2.1.0, 2.2.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[2.1.0, 2.2.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[2.1.0, 2.2.0)"/>
- </provider>
-
- <provider
- id="eclipselink-210-wtp-osgi-bundles-library-provider"
- extends="jpa-wtp-osgi-bundles-library-provider">
+ extends="eclipselink-bundles-library-provider">
<label>EclipseLink 2.1.x</label>
<param name="container.label" value="EclipseLink 2.1.x"/>
<param name="bundle.0" value="javax.persistence:[2.0.0, 2.1.0)"/>
@@ -606,20 +560,10 @@
</constraint>
</project-facet-version>
- <template id="jpt.jpa.se.template">
- <label>%JPA_SE_TEMPLATE_LABEL</label>
- <fixed facet="jpt.jpa"/>
- <fixed facet="java"/>
- <!--
- <preset id="jpt.jpa.2_0.preset"/>
- -->
- </template>
-
- <template id="jpt.jpa.ee.template">
- <label>%JPA_EE_TEMPLATE_LABEL</label>
+ <template id="jpt.jpa.template">
+ <label>%JPA_TEMPLATE_LABEL</label>
<fixed facet="jpt.jpa"/>
<fixed facet="java"/>
- <fixed facet="jst.utility"/>
<!--
<preset id="jpt.jpa.2_0.preset"/>
-->
@@ -659,46 +603,12 @@
</extension>
- <!--
- <extension
- point="org.eclipse.wst.common.project.facet.core.presets">
-
- <static-preset id="jpt.jpa.1_0.se.preset">
- <label>%JPA_1.0_SE_PRESET_LABEL</label>
- <facet id="java" version="5.0"/>
- <facet id="jpt.jpa" version="1.0"/>
- </static-preset>
-
- <static-preset id="jpt.jpa.1_0.ee.preset">
- <label>%JPA_1.0_EE_PRESET_LABEL</label>
- <facet id="java" version="5.0"/>
- <facet id="jst.utility" version="1.0"/>
- <facet id="jpt.jpa" version="1.0"/>
- </static-preset>
-
- <static-preset id="jpt.jpa.2_0.se.preset">
- <label>%JPA_2.0_SE_PRESET_LABEL</label>
- <facet id="java" version="6.0"/>
- <facet id="jpt.jpa" version="2.0"/>
- </static-preset>
-
- <static-preset id="jpt.jpa.2_0.ee.preset">
- <label>%JPA_2.0_EE_PRESET_LABEL</label>
- <facet id="java" version="6.0"/>
- <facet id="jst.utility" version="1.0"/>
- <facet id="jpt.jpa" version="2.0"/>
- </static-preset>
-
- </extension>
- -->
-
-
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
<supported>
- <runtime-component any="true"/>
<facet id="jpt.jpa"/>
+ <runtime-component any="true"/>
</supported>
</extension>
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/FacetTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/FacetTools.java
new file mode 100644
index 0000000000..14ed26c222
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/FacetTools.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.facet;
+
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
+import org.eclipse.wst.common.project.facet.core.IGroup;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+
+public class FacetTools {
+
+ public static IGroup MODULES_GROUP = ProjectFacetsManager.getGroup("modules"); //$NON-NLS-1$
+
+
+ public static boolean hasModuleFacet(IFacetedProjectBase fproj) {
+ for (IProjectFacetVersion fv : fproj.getProjectFacets()) {
+ if (MODULES_GROUP.getMembers().contains(fv)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static IProjectFacetVersion getModuleFacet(IFacetedProjectBase fproj) {
+ for (IProjectFacetVersion fv : fproj.getProjectFacets()) {
+ if (MODULES_GROUP.getMembers().contains(fv)) {
+ return fv;
+ }
+ }
+ return null;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaProjectCreationDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaProjectCreationDataModelProperties.java
deleted file mode 100644
index 4b287e8fe1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaProjectCreationDataModelProperties.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.facet;
-
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetProjectCreationDataModelProperties;
-
-public interface JpaProjectCreationDataModelProperties
- extends IJ2EEFacetProjectCreationDataModelProperties {
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaProjectCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaProjectCreationDataModelProvider.java
deleted file mode 100644
index cd97f1fc6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaProjectCreationDataModelProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.facet;
-
-import java.util.Set;
-import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
-
-public abstract class JpaProjectCreationDataModelProvider
- extends FacetProjectCreationDataModelProvider
- implements JpaProjectCreationDataModelProperties {
-
-
- protected JpaProjectCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public Set getPropertyNames() {
- Set names = super.getPropertyNames();
- names.add(EAR_PROJECT_NAME);
- names.add(ADD_TO_EAR);
- return names;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaSEProjectCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaSEProjectCreationDataModelProvider.java
deleted file mode 100644
index b6562c6cc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaSEProjectCreationDataModelProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.facet;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.jpt.core.JpaFacet;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class JpaSEProjectCreationDataModelProvider
- extends JpaProjectCreationDataModelProvider {
-
- public JpaSEProjectCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public void init() {
- super.init();
-
- Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>();
- requiredFacets.add(ProjectFacetsManager.getProjectFacet(JavaFacet.ID));
- requiredFacets.add(ProjectFacetsManager.getProjectFacet(JpaFacet.ID));
- setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
- }
-
- @Override
- public boolean isPropertyEnabled(String propertyName) {
- if (ADD_TO_EAR.equals(propertyName) || EAR_PROJECT_NAME.equals(propertyName)) {
- return false;
- }
- return super.isPropertyEnabled(propertyName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
index 5ea58351ec..7cf4611ae3 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
@@ -75,8 +75,7 @@ Export-Package: org.eclipse.jpt.ui,
org.eclipse.jpt.ui.internal.selection;x-internal:=true,
org.eclipse.jpt.ui.internal.structure;x-internal:=true,
org.eclipse.jpt.ui.internal.swt;x-internal:=true,
- org.eclipse.jpt.ui.internal.util;
- x-friends:="org.eclipse.jpt.jaxb.ui",
+ org.eclipse.jpt.ui.internal.util;x-friends:="org.eclipse.jpt.jaxb.ui",
org.eclipse.jpt.ui.internal.utility;x-internal:=true,
org.eclipse.jpt.ui.internal.utility.swt;x-internal:=true,
org.eclipse.jpt.ui.internal.views;x-internal:=true,
@@ -88,6 +87,8 @@ Export-Package: org.eclipse.jpt.ui,
org.eclipse.jpt.ui.internal.wizards.entity.data.operation;x-internal:=true,
org.eclipse.jpt.ui.internal.wizards.gen;x-internal:=true,
org.eclipse.jpt.ui.internal.wizards.orm;x-internal:=true,
+ org.eclipse.jpt.ui.internal.wizards.proj,
+ org.eclipse.jpt.ui.internal.wizards.proj.model,
org.eclipse.jpt.ui.jface,
org.eclipse.jpt.ui.jpa2.details.java,
org.eclipse.jpt.ui.jpa2.details.orm,
diff --git a/jpa/plugins/org.eclipse.jpt.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.ui/plugin.properties
index edceb205be..800439e8f1 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/plugin.properties
+++ b/jpa/plugins/org.eclipse.jpt.ui/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
+# Copyright (c) 2006, 2010 Oracle. All rights reserved.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0, which accompanies this distribution
# and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -29,8 +29,6 @@ jpaNavigatorContent=JPA Content
jpaWizardCategoryName = JPA
newJpaProjectWizardName = JPA Project
newJpaProjectWizardDesc = Create a JPA project
-newJpaEEProjectWizardName = JPA EE Project
-newJpaEEProjectWizardDesc = Create a JPA EE project
newJpaEntityWizardName = JPA Entity
newJpaEntityWizardDesc = Create a JPA Entity
newJpaMappingFileWizardName = JPA ORM Mapping File
@@ -47,13 +45,14 @@ addPersistentAttributeToXmlAndMap = Add Attribute to XML and Map ...
removePersistentAttributeFromXml = Remove Attribute from XML
mapAs=Map As
mapAsMnemonic=M
+mapAsParameterName=mapping key
mapAsSpecifiedMappingParameterName=specified mapping key
mapAsDefaultMappingParameterName=default mapping key
+convertJavaProjectToJpaCommandName=Convert to JPA Project ...
jpaMenuName = JPA Tools
generateEntities = Generate Entities from Tables...
generateDDL = Generate Tables from Entities...
-convertToJPAProject = Convert to JPA Project ...
synchronizeClasses = Synchronize Class List
persistenceEditor=Persistence XML Editor
diff --git a/jpa/plugins/org.eclipse.jpt.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.ui/plugin.xml
index b94530ec35..cad9ef928a 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.ui/plugin.xml
@@ -95,6 +95,19 @@
factoryClass="org.eclipse.jpt.ui.internal.jpa2.platform.generic.Generic2_0JpaPlatformUiFactory"/>
</extension>
+
+
+ <extension point="org.eclipse.jst.common.project.facet.ui.libraryProviderActionPanels">
+
+ <panel
+ provider="temp-wtp-user-library-provider"
+ class="org.eclipse.jpt.ui.internal.libprov.TempWtpUserLibraryProviderInstallPanel"/>
+
+ <panel
+ provider="temp-wtp-osgi-bundles-library-provider"
+ class="org.eclipse.jpt.ui.internal.libprov.TempWtpOsgiBundlesLibraryProviderInstallPanel"/>
+
+ </extension>
<extension
@@ -122,6 +135,12 @@
point="org.eclipse.ui.commands">
<command
+ id="org.eclipse.jpt.ui.convertJavaProjectToJpa"
+ name="%convertJavaProjectToJpaCommandName"
+ categoryId="org.eclipse.ui.category.file"
+ defaultHandler="org.eclipse.jpt.ui.internal.commands.ConvertJavaProjectToJpaCommandHandler"/>
+
+ <command
id="org.eclipse.jpt.ui.xmlFileUpgradeToLatestVersion"
name="%upgradeToLatestVersion"/>
@@ -430,6 +449,31 @@
</command>
</menuContribution>
+ <!-- contributions to the project configure menu -->
+ <menuContribution locationURI="popup:org.eclipse.ui.projectConfigure?after=additions">
+ <command commandId="org.eclipse.jpt.ui.convertJavaProjectToJpa" style="push">
+ <visibleWhen checkEnabled="false">
+ <and>
+ <count value="1"/>
+ <iterate ifEmpty="false" operator="and">
+ <adapt type="org.eclipse.core.resources.IProject">
+ <and>
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.jdt.core.javanature"/>
+ <not>
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.wst.common.project.facet.core.nature"/>
+ </not>
+ </and>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+
<!-- contributions to objects in the JPA structure view -->
<menuContribution
locationURI="popup:org.eclipse.jpt.ui.jpaStructureView">
@@ -696,26 +740,12 @@
project="true"
finalPerspective="org.eclipse.jpt.ui.jpaPerspective">
<description>%newJpaProjectWizardDesc</description>
- <class class="org.eclipse.jpt.ui.internal.wizards.JpaSEProjectWizard">
+ <class class="org.eclipse.jpt.ui.internal.wizards.proj.JpaProjectWizard">
<parameter name="menuIndex" value="35"/>
</class>
</wizard>
<wizard
- id="org.eclipse.jpt.ui.wizard.newJpaEEProject"
- name="%newJpaEEProjectWizardName"
- icon="icons/full/etool16/new_jpaproject_wiz.gif"
- category="org.eclipse.jpt"
- project="true"
- finalPerspective="org.eclipse.jpt.ui.jpaPerspective">
- <description>%newJpaEEProjectWizardDesc</description>
- <class class="org.eclipse.jpt.ui.internal.wizards.JpaEEProjectWizard">
- <parameter name="javaeeproject" value="true"/>
- <parameter name="menuIndex" value="36"/>
- </class>
- </wizard>
-
- <wizard
id="org.eclipse.jpt.ui.wizard.newEntity"
name="%newJpaEntityWizardName"
icon="icons/full/etool16/new_entity_wiz.gif"
@@ -778,7 +808,6 @@
targetID="org.eclipse.jpt.ui.jpaPerspective">
<newWizardShortcut id="org.eclipse.jpt.ui.wizard.newJpaProject"/>
- <newWizardShortcut id="org.eclipse.jpt.ui.wizard.newJpaEEProject"/>
<newWizardShortcut id="org.eclipse.jpt.ui.wizard.newEntity"/>
<newWizardShortcut id="org.eclipse.jpt.ui.wizard.newMappingFile"/>
<newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"/>
@@ -819,7 +848,7 @@
<perspectiveExtension
targetID="org.eclipse.jst.j2ee.J2EEPerspective">
- <newWizardShortcut id="org.eclipse.jpt.ui.wizard.newJpaEEProject"/>
+ <newWizardShortcut id="org.eclipse.jpt.ui.wizard.newJpaProject"/>
<perspectiveShortcut id="org.eclipse.jpt.ui.jpaPerspective"/>
</perspectiveExtension>
@@ -833,11 +862,11 @@
id="org.eclipse.jpt.ui.project.JPATools"
objectClass="org.eclipse.core.resources.IProject"
adaptable="true">
-
+
<enablement>
<test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa"/>
</enablement>
-
+
<action
id="org.eclipse.jpt.ui.generateEntities"
label="%generateEntities"
@@ -855,32 +884,6 @@
</objectContribution>
<objectContribution
- id="org.eclipse.jpt.ui.project.configure"
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true">
- <visibility>
- <and>
- <objectState
- name="projectNature"
- value="org.eclipse.jdt.core.javanature"/>
- <not>
- <objectState
- name="projectNature"
- value="org.eclipse.wst.common.project.facet.core.nature"/>
- </not>
- </and>
- </visibility>
-
- <action
- id="org.eclipse.jpt.ui.convertToJpaProject"
- label="%convertToJPAProject"
- class="org.eclipse.jpt.ui.internal.actions.MigrateJavaProjectAction"
- enablesFor="1"
- menubarPath="org.eclipse.ui.projectConfigure/additions"/>
-
- </objectContribution>
-
- <objectContribution
id="org.eclipse.jpt.ui.persistenceXmlFileActions"
objectClass="org.eclipse.core.resources.IFile"
nameFilter="persistence.xml">
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties
index e8c4a091eb..71ab6d288b 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties
@@ -14,6 +14,11 @@ AccessTypeComposite_access=Access:
AccessTypeComposite_field=Field
AccessTypeComposite_property=Property
+AddToEarComposite_earMemberShip=EAR membership
+AddToEarComposite_addToEarLabel=&Add project to an EAR
+AddToEarComposite_earProjectLabel=EAR pr&oject name:
+AddToEarComposite_newButtonLabel=New &Project ...
+
AddPersistentAttributeDialog_title=Add Attribute
AddPersistentAttributeDialog_attributeLabel=Attribute:
AddPersistentAttributeDialog_mappingLabel=Map as:
@@ -35,6 +40,9 @@ AddRemovePane_RemoveButtonText=Remove
ClassChooserPane_dialogMessage=&Enter type name prefix or pattern (*, ?, or camel case):
ClassChooserPane_dialogTitle=Class Selection
+convertToJpa_convertingProject="Converting project to faceted form ..."
+convertToJpa_detectingTechnologies="Detecting existing technologies ..."
+
DatabaseSchemaWizardPage_title=Database Schema
DatabaseSchemaWizardPage_desc=Select a database schema
DatabaseSchemaWizardPage_schemaSettings=Schema settings
@@ -105,6 +113,8 @@ JpaFacetWizardPage_metamodelLabel=Canonical metamodel (JPA 2.0)
JpaFacetWizardPage_metamodelSourceFolderLink=<a>Source fol&der:</a>
JpaFacetWizardPage_none=<None>
+JpaLibraryProviderInstallPanel_includeLibraries=&Include libraries with this application
+
JpaPreferencesPage_Description=Expand the tree to edit preferences for a specific feature.
JpaProblemSeveritiesPage_Description=Select the severity level for the following optional Java Persistence validation problems:
@@ -128,8 +138,7 @@ MappingFileWizardPage_incorrectSourceFolderError=Selection must be a valid sourc
MappingFileWizardPage_accessLabel_sourceFolderDialogTitle=Source Folder Selection
MappingFileWizardPage_accessLabel_sourceFolderDialogDesc=Choose a source folder:
-JpaSEProjectWizard_title=New JPA Project
-JpaEEProjectWizard_title=New JPA EE Project
+JpaProjectWizard_title=New JPA Project
NewJpaProjectWizard_firstPage_title=JPA Project
NewJpaProjectWizard_firstPage_description=Configure JPA project settings.
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java
index 5d9c61ea75..9d0f818bff 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java
@@ -23,6 +23,10 @@ public class JptUiMessages {
public static String AccessTypeComposite_access;
public static String AccessTypeComposite_field;
public static String AccessTypeComposite_property;
+ public static String AddToEarComposite_earMemberShip;
+ public static String AddToEarComposite_addToEarLabel;
+ public static String AddToEarComposite_earProjectLabel;
+ public static String AddToEarComposite_newButtonLabel;
public static String AddPersistentAttributeDialog_attributeLabel;
public static String AddPersistentAttributeDialog_mappingLabel;
public static String AddPersistentAttributeDialog_noMappingKeyError;
@@ -40,6 +44,8 @@ public class JptUiMessages {
public static String AddRemovePane_RemoveButtonText;
public static String ClassChooserPane_dialogMessage;
public static String ClassChooserPane_dialogTitle;
+ public static String convertToJpa_convertingProject;
+ public static String convertToJpa_detectingTechnologies;
public static String DatabaseSchemaWizardPage_title;
public static String DatabaseSchemaWizardPage_desc;
public static String DatabaseSchemaWizardPage_schemaSettings;
@@ -92,6 +98,7 @@ public class JptUiMessages {
public static String JpaFacetWizardPage_title;
public static String JpaFacetWizardPage_userLibsLink;
public static String JpaFacetWizardPage_userServerLibLabel;
+ public static String JpaLibraryProviderInstallPanel_includeLibraries;
public static String JpaStructureView_linkWithEditorDesc;
public static String JpaStructureView_linkWithEditorText;
public static String JpaStructureView_linkWithEditorTooltip;
@@ -111,8 +118,7 @@ public class JptUiMessages {
public static String MappingFileWizardPage_incorrectSourceFolderError;
public static String MappingFileWizardPage_accessLabel_sourceFolderDialogTitle;
public static String MappingFileWizardPage_accessLabel_sourceFolderDialogDesc;
- public static String JpaSEProjectWizard_title;
- public static String JpaEEProjectWizard_title;
+ public static String JpaProjectWizard_title;
public static String NewJpaProjectWizard_firstPage_description;
public static String NewJpaProjectWizard_firstPage_title;
public static String OrmItemLabelProviderFactory_entityMappingsLabel;
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/MigrateJavaProjectAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/MigrateJavaProjectAction.java
deleted file mode 100644
index ecd0362c3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/MigrateJavaProjectAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.core.JpaFacet;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationOperation;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
-
-public class MigrateJavaProjectAction implements IObjectActionDelegate
-{
- private ISelection currentSelection;
-
-
- public MigrateJavaProjectAction() {
- super();
- }
-
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- this.currentSelection = selection;
- }
-
- public void run(IAction action) {
- // This action is currently enabled only for a singly selected, java,
- // non-faceted IProject
- IProject project = (IProject) ((IStructuredSelection) currentSelection).getFirstElement();
- execute(project);
- }
-
- private void execute(IProject project) {
- // add facets nature, java facet, and utility facet to project
- JavaProjectMigrationOperation operation =
- J2EEProjectUtilities.createFlexJavaProjectForProjectOperation(project, false);
- operation.execute(null, null);
-
- IFacetedProject facetedProject;
- try {
- // get the faceted project
- facetedProject = ProjectFacetsManager.create(project);
- }
- catch (CoreException ce) {
- JptUiPlugin.log(ce);
- return;
- }
-
- // launch the UI with JPA facet preselected
- final ModifyFacetedProjectWizard wizard = new ModifyFacetedProjectWizard(facetedProject);
- IFacetedProjectWorkingCopy facetedProjectWorkingCopy = wizard.getFacetedProjectWorkingCopy();
- IProjectFacetVersion fv = JpaFacet.FACET.getDefaultVersion();
- facetedProjectWorkingCopy.addProjectFacet(fv);
-
- final WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- dialog.open();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/ConvertJavaProjectToJpaCommandHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/ConvertJavaProjectToJpaCommandHandler.java
new file mode 100644
index 0000000000..cb462f2ade
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/ConvertJavaProjectToJpaCommandHandler.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import static org.eclipse.wst.common.project.facet.core.util.internal.FileUtil.*;
+import java.lang.reflect.InvocationTargetException;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jpt.core.JpaFacet;
+import org.eclipse.jpt.ui.JptUiPlugin;
+import org.eclipse.jpt.ui.internal.JptUiMessages;
+import org.eclipse.jpt.utility.internal.ArrayTools;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.internal.FacetedProjectNature;
+import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
+
+public class ConvertJavaProjectToJpaCommandHandler
+ extends AbstractHandler {
+
+ public Object execute(ExecutionEvent event)
+ throws ExecutionException {
+
+ IProject project = null;
+ ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
+
+ if (currentSelection instanceof IStructuredSelection) {
+ Object element = ((IStructuredSelection) currentSelection).getFirstElement();
+ project = (IProject) Platform.getAdapterManager().getAdapter(element, IProject.class);
+ }
+
+ if (project == null) {
+ return null;
+ }
+
+ IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
+
+ if (activeWorkbenchWindow != null) {
+ Shell shell = activeWorkbenchWindow.getShell();
+
+ ConvertJavaProjectToJpaRunnable.runInProgressDialog(shell, project);
+ }
+
+ return null;
+ }
+
+
+ private static class ConvertJavaProjectToJpaRunnable
+ implements IRunnableWithProgress {
+
+ private final IProject project;
+ private IFacetedProjectWorkingCopy fprojwc;
+
+ public static void runInProgressDialog(Shell shell, IProject project) {
+ final ConvertJavaProjectToJpaRunnable runnable
+ = new ConvertJavaProjectToJpaRunnable(project);
+
+ try {
+ new ProgressMonitorDialog(shell).run(true, true, runnable);
+
+ ModifyFacetedProjectWizard wizard
+ = new ModifyFacetedProjectWizard(runnable.getFacetedProjectWorkingCopy());
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+
+ if (dialog.open() == Dialog.CANCEL) {
+ throw new InterruptedException();
+ }
+ }
+ catch (InvocationTargetException e) {
+ JptUiPlugin.log(e);
+ }
+ catch(InterruptedException e) {
+ removeFacetNature(project);
+ }
+ }
+
+
+ public static void removeFacetNature(IProject project) {
+ try {
+ IProjectDescription description = project.getDescription();
+ String[] prevNatures = description.getNatureIds();
+ String[] newNatures = ArrayTools.remove(prevNatures, FacetedProjectNature.NATURE_ID);
+ description.setNatureIds( newNatures );
+
+ validateEdit( project.getFile( FILE_DOT_PROJECT ) );
+
+ project.setDescription(description, null);
+ }
+ catch (CoreException ce) {
+ JptUiPlugin.log(ce);
+ }
+ }
+
+
+ public ConvertJavaProjectToJpaRunnable(IProject project) {
+ this.project = project;
+ }
+
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+
+ monitor.beginTask(JptUiMessages.convertToJpa_convertingProject, 1000);
+
+ try {
+ IProgressMonitor createProgressMonitor = new SubProgressMonitor(monitor, 100);
+ IFacetedProject fproj = ProjectFacetsManager.create(this.project, true, createProgressMonitor);
+
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ monitor.setTaskName(JptUiMessages.convertToJpa_detectingTechnologies);
+
+ IProgressMonitor detectProgressMonitor = new SubProgressMonitor(monitor, 800);
+ this.fprojwc = fproj.createWorkingCopy();
+ this.fprojwc.detect(detectProgressMonitor);
+
+ if (! this.fprojwc.hasProjectFacet(JpaFacet.FACET)) {
+ this.fprojwc.addProjectFacet(JpaFacet.FACET.getDefaultVersion());
+ }
+ }
+ catch(CoreException e) {
+ throw new InvocationTargetException(e);
+ }
+ finally {
+ monitor.done();
+ }
+ }
+
+ protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() {
+ return this.fprojwc;
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaEEProjectWizard.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaEEProjectWizard.java
deleted file mode 100644
index 3c70cef455..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaEEProjectWizard.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.wizards;
-
-import org.eclipse.jpt.core.internal.facet.JpaEEProjectCreationDataModelProvider;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class JpaEEProjectWizard extends JpaProjectWizard {
-
- public JpaEEProjectWizard() {
- super();
- setWindowTitle(JptUiMessages.JpaEEProjectWizard_title);
- }
-
- public JpaEEProjectWizard(IDataModel model) {
- super(model);
- setWindowTitle(JptUiMessages.JpaEEProjectWizard_title);
- }
-
-
- @Override
- protected IDataModel createDataModel() {
- return DataModelFactory.createDataModel(new JpaEEProjectCreationDataModelProvider());
- }
-
-
- @Override
- protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("jpt.jpa.ee.template");
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaSEProjectWizard.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaSEProjectWizard.java
deleted file mode 100644
index 67908b0d78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaSEProjectWizard.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.wizards;
-
-import org.eclipse.jpt.core.internal.facet.JpaSEProjectCreationDataModelProvider;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class JpaSEProjectWizard
- extends JpaProjectWizard {
-
- public JpaSEProjectWizard() {
- super();
- setWindowTitle(JptUiMessages.JpaSEProjectWizard_title);
- }
-
- public JpaSEProjectWizard(IDataModel model) {
- super(model);
- setWindowTitle(JptUiMessages.JpaSEProjectWizard_title);
- }
-
-
- @Override
- protected IDataModel createDataModel() {
- return DataModelFactory.createDataModel(new JpaSEProjectCreationDataModelProvider());
- }
-
-
- @Override
- protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("jpt.jpa.se.template");
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/AddToEarComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/AddToEarComposite.java
new file mode 100644
index 0000000000..3efa1e4d0d
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/AddToEarComposite.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.wizards.proj;
+
+import static org.eclipse.jpt.ui.internal.wizards.proj.model.JpaProjectCreationDataModelProperties.*;
+import static org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties.FACET_RUNTIME;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jpt.ui.internal.JptUiMessages;
+import org.eclipse.jst.j2ee.ui.project.facet.EarProjectWizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+
+public class AddToEarComposite {
+
+ private final Button addToEar;
+ private final Combo combo;
+ private final Button newButton;
+ private final Label label;
+
+ private final IDataModel model;
+ private DataModelSynchHelper synchhelper;
+
+ public AddToEarComposite(IDataModel model, Composite parent) {
+ this.model = model;
+ this.synchhelper = new DataModelSynchHelper(model);
+
+ Group group = new Group(parent, SWT.NONE);
+ group.setLayoutData(gdhfill());
+ group.setLayout(new GridLayout(3, false));
+ group.setText(JptUiMessages.AddToEarComposite_earMemberShip);
+
+ this.addToEar = new Button(group, SWT.CHECK);
+ this.addToEar.setText(JptUiMessages.AddToEarComposite_addToEarLabel);
+ GridDataFactory.defaultsFor(this.addToEar).span(3, 1).applyTo(this.addToEar);
+ this.synchhelper.synchCheckbox(addToEar, ADD_TO_EAR, null);
+
+ this.label = new Label(group, SWT.NULL);
+ this.label.setText(JptUiMessages.AddToEarComposite_earProjectLabel);
+ this.combo = new Combo(group, SWT.NONE);
+ this.combo.setLayoutData(gdhfill());
+
+ this.newButton = new Button(group, SWT.PUSH);
+ this.newButton.setText(JptUiMessages.AddToEarComposite_newButtonLabel);
+ GridDataFactory.defaultsFor(this.newButton).applyTo(this.newButton);
+
+ this.newButton.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ handleAddButton();
+ }
+ });
+
+ this.synchhelper.synchCombo(combo, EAR_PROJECT_NAME, new Control[]{label, newButton});
+ Dialog.applyDialogFont(parent);
+ }
+
+ private void handleAddButton() {
+ EarProjectWizard wizard = new EarProjectWizard();
+
+ WizardDialog dialog = new WizardDialog(newButton.getShell(), wizard);
+
+ IRuntime runtime = (IRuntime) this.model.getProperty(FACET_RUNTIME);
+ wizard.setRuntimeInDataModel(runtime);
+
+ if (dialog.open() != Window.CANCEL) {
+ this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG);
+ String earproj = wizard.getProjectName();
+ this.model.setProperty(EAR_PROJECT_NAME, earproj);
+ }
+ }
+
+ private static GridData gdhfill() {
+ return new GridData(GridData.FILL_HORIZONTAL);
+ }
+
+ public static final GridData gdhspan(GridData gd, int span) {
+ gd.horizontalSpan = span;
+ return gd;
+ }
+
+ public void dispose() {
+ if (this.synchhelper != null){
+ this.synchhelper.dispose();
+ this.synchhelper = null;
+ }
+ }
+
+ public String getComboText(){
+ return this.combo.getText();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaProjectWizard.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/JpaProjectWizard.java
index 50dc2cb396..36e74cc3e3 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaProjectWizard.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/JpaProjectWizard.java
@@ -7,24 +7,31 @@
* Contributors:
* Oracle - initial API and implementation
*******************************************************************************/
-package org.eclipse.jpt.ui.internal.wizards;
+package org.eclipse.jpt.ui.internal.wizards.proj;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jpt.ui.JptUiPlugin;
import org.eclipse.jpt.ui.internal.JptUiIcons;
+import org.eclipse.jpt.ui.internal.JptUiMessages;
+import org.eclipse.jpt.ui.internal.wizards.proj.model.JpaProjectCreationDataModelProvider;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
-public abstract class JpaProjectWizard
+public class JpaProjectWizard
extends NewProjectDataModelFacetWizard {
- protected JpaProjectWizard() {
+ public JpaProjectWizard() {
super();
+ setWindowTitle(JptUiMessages.JpaProjectWizard_title);
}
- protected JpaProjectWizard(IDataModel dataModel) {
+ public JpaProjectWizard(IDataModel dataModel) {
super(dataModel);
+ setWindowTitle(JptUiMessages.JpaProjectWizard_title);
}
@@ -39,6 +46,16 @@ public abstract class JpaProjectWizard
}
@Override
+ protected IDataModel createDataModel() {
+ return DataModelFactory.createDataModel(new JpaProjectCreationDataModelProvider());
+ }
+
+ @Override
+ protected IFacetedProjectTemplate getTemplate() {
+ return ProjectFacetsManager.getTemplate("jpt.jpa.template");
+ }
+
+ @Override
protected String getFinalPerspectiveID() {
return "org.eclipse.jpt.ui.jpaPerspective";
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaProjectWizardFirstPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/JpaProjectWizardFirstPage.java
index 16cbdac49c..51e4ee5e17 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaProjectWizardFirstPage.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/JpaProjectWizardFirstPage.java
@@ -6,29 +6,27 @@
*
* Contributors: Oracle. - initial API and implementation
*******************************************************************************/
-package org.eclipse.jpt.ui.internal.wizards;
+package org.eclipse.jpt.ui.internal.wizards.proj;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.jpt.core.JpaFacet;
-import org.eclipse.jpt.core.internal.facet.JpaProjectCreationDataModelProperties;
+import org.eclipse.jpt.core.internal.facet.FacetTools;
import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
-import org.eclipse.jst.j2ee.ui.project.facet.EarSelectionPanel;
+import org.eclipse.jpt.ui.internal.wizards.proj.model.JpaProjectCreationDataModelProperties;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage;
public class JpaProjectWizardFirstPage
extends DataModelFacetCreationWizardPage {
- protected EarSelectionPanel earComposite;
-
+ private AddToEarComposite addToEarComposite;
public JpaProjectWizardFirstPage(IDataModel dataModel, String pageName) {
super(dataModel, pageName);
@@ -41,25 +39,21 @@ public class JpaProjectWizardFirstPage
@Override
protected Composite createTopLevelComposite(Composite parent) {
final Composite top = super.createTopLevelComposite(parent);
- if (shouldAddEARComposite()) {
- createEarComposite(top);
- createWorkingSetGroupPanel(top, new String[] { RESOURCE_WORKING_SET, JAVA_WORKING_SET });
- }
+ createEarComposite(top);
+ createWorkingSetGroupPanel(top, new String[] { RESOURCE_WORKING_SET, JAVA_WORKING_SET });
return top;
}
private void createEarComposite(Composite top) {
- if (hasUtilityFacet()) {
- final IFacetedProject.Action action
- = getFacetedProjectWorkingCopy().getProjectFacetAction(IJ2EEFacetConstants.UTILITY_FACET);
- this.earComposite = new EarSelectionPanel( (IDataModel) action.getConfig(), top);
- }
+ this.addToEarComposite = new AddToEarComposite(getDataModel(), top);
}
@Override
public boolean internalLaunchNewRuntimeWizard(Shell shell, IDataModel model) {
- if (hasUtilityFacet()) {
- return launchNewRuntimeWizard(shell, model, IJ2EEFacetConstants.UTILITY);
+ IFacetedProjectWorkingCopy fpwc = (IFacetedProjectWorkingCopy) model.getProperty(FACETED_PROJECT_WORKING_COPY);
+ IProjectFacetVersion moduleFacet = FacetTools.getModuleFacet(fpwc);
+ if (moduleFacet != null) {
+ return launchNewRuntimeWizard(shell, model, moduleFacet.getProjectFacet().getId());
}
else {
return launchNewRuntimeWizard(shell, model);
@@ -74,9 +68,7 @@ public class JpaProjectWizardFirstPage
@Override
public void dispose() {
super.dispose();
- if (this.earComposite != null) {
- earComposite.dispose();
- }
+ this.addToEarComposite.dispose();
}
@Override
@@ -126,16 +118,4 @@ public class JpaProjectWizardFirstPage
arrayList.add(JpaProjectCreationDataModelProperties.ADD_TO_EAR );
return arrayList.toArray( new String[0] );
}
-
- protected boolean shouldAddEARComposite() {
- return hasUtilityFacet();
- }
-
- protected boolean hasUtilityFacet() {
- return getFacetedProjectWorkingCopy().hasProjectFacet(IJ2EEFacetConstants.UTILITY_FACET);
- }
-
- protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() {
- return (IFacetedProjectWorkingCopy) this.model.getProperty(FACETED_PROJECT_WORKING_COPY);
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProperties.java
new file mode 100644
index 0000000000..538bbfa405
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProperties.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.wizards.proj.model;
+
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+
+public interface JpaProjectCreationDataModelProperties
+ extends IFacetProjectCreationDataModelProperties {
+
+ public static final String MODULE_FACET_DATA_MODEL
+ = "JpaProjectCreationDataModelProperties.MODULE_FACET_DATA_MODEL"; //$NON-NLS-1$
+
+ public static final String ADDED_UTILITY_FACET
+ = "JpaProjectCreationDataModelProperties.ADDED_UTILITY_FACET"; //$NON-NLS-1$
+
+ public static final String ADD_TO_EAR
+ = "JpaProjectCreationDataModelProperties.ADD_TO_EAR"; //$NON-NLS-1$
+
+ public static final String EAR_PROJECT_NAME
+ = "JpaProjectCreationDataModelProperties.EAR_PROJECT_NAME"; //$NON-NLS-1$
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaEEProjectCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProvider.java
index 4a1c21184b..6f41b504e4 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaEEProjectCreationDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProvider.java
@@ -7,11 +7,12 @@
* Contributors:
* Oracle - initial API and implementation
*******************************************************************************/
-package org.eclipse.jpt.core.internal.facet;
+package org.eclipse.jpt.ui.internal.wizards.proj.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -20,10 +21,12 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
import org.eclipse.jpt.core.JpaFacet;
+import org.eclipse.jpt.core.internal.facet.FacetTools;
import org.eclipse.jst.common.project.facet.core.JavaFacet;
import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
@@ -34,32 +37,21 @@ import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-public class JpaEEProjectCreationDataModelProvider
- extends JpaProjectCreationDataModelProvider {
+public class JpaProjectCreationDataModelProvider
+ extends FacetProjectCreationDataModelProvider
+ implements JpaProjectCreationDataModelProperties {
- public JpaEEProjectCreationDataModelProvider() {
- super();
- }
+ private IDataModelListener moduleFacetDataModelListener;
- @Override
- public void init() {
- super.init();
-
- Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>();
- requiredFacets.add(JavaFacet.FACET);
- requiredFacets.add(JpaFacet.FACET);
- requiredFacets.add(IJ2EEFacetConstants.UTILITY_FACET);
- setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
-
- FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
-
- IDataModel utilFacet = map.getFacetDataModel(IJ2EEFacetConstants.UTILITY_FACET.getId());
- utilFacet.addListener(
- new IDataModelListener() {
+ public JpaProjectCreationDataModelProvider() {
+ super();
+ this.moduleFacetDataModelListener
+ = new IDataModelListener() {
public void propertyChanged(DataModelEvent event) {
if (IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME.equals(event.getPropertyName())) {
if (isPropertySet(EAR_PROJECT_NAME)) {
@@ -73,21 +65,51 @@ public class JpaEEProjectCreationDataModelProvider
setProperty(ADD_TO_EAR, event.getProperty());
}
}
- });
+ };
+ }
+
+
+ @Override
+ public Set getPropertyNames() {
+ Set names = super.getPropertyNames();
+ names.add(MODULE_FACET_DATA_MODEL);
+ names.add(ADDED_UTILITY_FACET);
+ names.add(EAR_PROJECT_NAME);
+ names.add(ADD_TO_EAR);
+ return names;
+ }
+
+ @Override
+ public void init() {
+ super.init();
+
+ Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>();
+ requiredFacets.add(JavaFacet.FACET);
+ requiredFacets.add(JpaFacet.FACET);
+ setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
+
+ getDataModel().addListener(
+ new IDataModelListener() {
+ public void propertyChanged(DataModelEvent event) {
+ if (FACET_ACTION_MAP.equals(event.getPropertyName())) {
+ updateModuleFacetDataModel();
+ }
+ }
+ });
}
@Override
public boolean isPropertyEnabled(String propertyName) {
if (FACET_RUNTIME.equals(propertyName)) {
- if (getBooleanProperty(ADD_TO_EAR)) {
+ if (isAddToEar()) {
IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME));
if (status.isOK()) {
IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME));
if (earProject != null) {
- IFacetedProject facetdEarProject;
+ IFacetedProject facetedEarProject;
try {
- facetdEarProject = ProjectFacetsManager.create(earProject);
- if (facetdEarProject != null) {
+ facetedEarProject = ProjectFacetsManager.create(earProject);
+ if (facetedEarProject != null) {
return false;
}
} catch (CoreException e) {
@@ -98,23 +120,37 @@ public class JpaEEProjectCreationDataModelProvider
}
return true;
}
+ else if (EAR_PROJECT_NAME.equals(propertyName)) {
+ return isAddToEar();
+ }
+
return super.isPropertyEnabled(propertyName);
}
@Override
public Object getDefaultProperty(String propertyName) {
- if (EAR_PROJECT_NAME.equals(propertyName)) {
- IDataModel utilityFacetModel = getUtilityFacetModel();
- if (utilityFacetModel !=null) {
- return utilityFacetModel.getProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
+ if (ADDED_UTILITY_FACET.equals(propertyName)) {
+ return Boolean.FALSE;
+ }
+ else if (ADD_TO_EAR.equals(propertyName)) {
+ IDataModel moduleFacetDataModel = getModuleFacetDataModel();
+ if (moduleFacetDataModel != null) {
+ return moduleFacetDataModel.getDefaultProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR);
+ }
+ }
+ else if (EAR_PROJECT_NAME.equals(propertyName)) {
+ IDataModel moduleFacetDataModel = getModuleFacetDataModel();
+ if (moduleFacetDataModel !=null) {
+ return moduleFacetDataModel.getDefaultProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
}
}
+
return super.getDefaultProperty(propertyName);
}
@Override
public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (FACET_RUNTIME.equals(propertyName) && getBooleanProperty(ADD_TO_EAR)) {
+ if (FACET_RUNTIME.equals(propertyName) && isAddToEar()) {
DataModelPropertyDescriptor[] descriptors = super.getValidPropertyDescriptors(propertyName);
List list = new ArrayList();
for (int i = 0; i < descriptors.length; i++) {
@@ -129,22 +165,35 @@ public class JpaEEProjectCreationDataModelProvider
}
return descriptors;
}
+ else if (EAR_PROJECT_NAME.equals(propertyName)) {
+ IDataModel moduleFacetDataModel = getModuleFacetDataModel();
+ if (moduleFacetDataModel != null) {
+ return moduleFacetDataModel.getValidPropertyDescriptors(
+ IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
+ }
+ else {
+ return new DataModelPropertyDescriptor[0];
+ }
+ }
+
return super.getValidPropertyDescriptors(propertyName);
}
@Override
public boolean propertySet(String propertyName, Object propertyValue) {
if (EAR_PROJECT_NAME.equals(propertyName) || ADD_TO_EAR.equals(propertyName)) {
- IDataModel utilityFacetModel = getUtilityFacetModel();
- if (null != utilityFacetModel){
+ IDataModel moduleFacetDataModel = getModuleFacetDataModel();
+ if (moduleFacetDataModel != null){
if (EAR_PROJECT_NAME.equals(propertyName)) {
- utilityFacetModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME, propertyValue);
+ moduleFacetDataModel.setProperty(
+ IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME, propertyValue);
}
else {
- utilityFacetModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, propertyValue);
+ moduleFacetDataModel.setProperty(
+ IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, propertyValue);
}
}
- if (getBooleanProperty(ADD_TO_EAR)) {
+ if (isAddToEar()) {
IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME));
if (status.isOK()) {
IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME));
@@ -163,32 +212,56 @@ public class JpaEEProjectCreationDataModelProvider
}
}
if (ADD_TO_EAR.equals(propertyName)) {
- model.notifyPropertyChange(FACET_RUNTIME, IDataModel.VALID_VALUES_CHG);
+ this.model.notifyPropertyChange(FACET_RUNTIME, IDataModel.VALID_VALUES_CHG);
+ IProjectFacetVersion moduleFacet = findModuleFacet();
+ if (isAddToEar()) {
+ if (moduleFacet == null) {
+ getFacetedProject().addProjectFacet(IJ2EEFacetConstants.UTILITY_FACET_10);
+ setBooleanProperty(ADDED_UTILITY_FACET, true);
+ }
+ }
+ else {
+ if (moduleFacet != null && isAddedUtilityFacet()) {
+ if (moduleFacet.equals(IJ2EEFacetConstants.UTILITY_FACET_10)) {
+ getFacetedProject().removeProjectFacet(IJ2EEFacetConstants.UTILITY_FACET_10);
+ }
+ setBooleanProperty(ADDED_UTILITY_FACET, false);
+ }
+ }
+ this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.ENABLE_CHG);
+ this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG);
+ this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALUE_CHG);
}
- model.notifyPropertyChange(FACET_RUNTIME, IDataModel.ENABLE_CHG);
+ this.model.notifyPropertyChange(FACET_RUNTIME, IDataModel.ENABLE_CHG);
}
+
return super.propertySet(propertyName, propertyValue);
}
@Override
public IStatus validate(String propertyName) {
IStatus status = super.validate(propertyName);
+
if (status == null) {
status = Status.OK_STATUS;
}
- if (status.isOK()) {
- if (ADD_TO_EAR.equals(propertyName) || EAR_PROJECT_NAME.equals(propertyName) || FACET_PROJECT_NAME.equals(propertyName)) {
- if (model.getBooleanProperty(ADD_TO_EAR)) {
- status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME));
- if (status.isOK()) {
- if (getStringProperty(FACET_PROJECT_NAME).equals(getStringProperty(EAR_PROJECT_NAME))) {
- String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.SAME_MODULE_AND_EAR_NAME, new Object[]{getStringProperty(EAR_PROJECT_NAME)});
- status = WTPCommonPlugin.createErrorStatus(errorMessage);
- }
+
+ if (! status.isOK()) {
+ return status;
+ }
+
+ if (ADD_TO_EAR.equals(propertyName) || EAR_PROJECT_NAME.equals(propertyName) || FACET_PROJECT_NAME.equals(propertyName)) {
+ if (model.getBooleanProperty(ADD_TO_EAR)) {
+ status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME));
+ if (status.isOK()) {
+ if (getStringProperty(FACET_PROJECT_NAME).equals(getStringProperty(EAR_PROJECT_NAME))) {
+ String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.SAME_MODULE_AND_EAR_NAME, new Object[]{getStringProperty(EAR_PROJECT_NAME)});
+ status = WTPCommonPlugin.createErrorStatus(errorMessage);
}
}
}
}
+
return status;
}
@@ -216,16 +289,61 @@ public class JpaEEProjectCreationDataModelProvider
return status;
}
- protected IDataModel getUtilityFacetModel() {
- final IFacetedProjectWorkingCopy fpjwc
- = (IFacetedProjectWorkingCopy) this.model.getProperty(FACETED_PROJECT_WORKING_COPY);
- IProjectFacet utilityFacet = IJ2EEFacetConstants.UTILITY_FACET;
+ protected void updateModuleFacetDataModel() {
+ IDataModel newModuleFacetDataModel = findModuleFacetDataModel();
+ IDataModel oldModuleFacetDataModel = getModuleFacetDataModel();
- if (fpjwc.hasProjectFacet(utilityFacet)) {
- final IFacetedProject.Action action = fpjwc.getProjectFacetAction(utilityFacet);
- return (IDataModel) action.getConfig();
+ if (oldModuleFacetDataModel != newModuleFacetDataModel) {
+ if (oldModuleFacetDataModel != null) {
+ oldModuleFacetDataModel.removeListener(this.moduleFacetDataModelListener);
+ }
+ if (newModuleFacetDataModel != null) {
+ newModuleFacetDataModel.setProperty(
+ IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR,
+ getProperty(ADD_TO_EAR));
+ newModuleFacetDataModel.setProperty(
+ IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME,
+ getProperty(EAR_PROJECT_NAME));
+ newModuleFacetDataModel.addListener(this.moduleFacetDataModelListener);
+ }
+ else {
+ this.model.setBooleanProperty(ADD_TO_EAR, false);
+ this.model.setBooleanProperty(ADDED_UTILITY_FACET, false);
+ }
+ setProperty(MODULE_FACET_DATA_MODEL, newModuleFacetDataModel);
+ this.model.notifyPropertyChange(ADD_TO_EAR, IDataModel.DEFAULT_CHG);
+ this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG);
+ this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG);
+ }
+ }
+
+ protected IFacetedProjectWorkingCopy getFacetedProject() {
+ return (IFacetedProjectWorkingCopy) this.model.getProperty(FACETED_PROJECT_WORKING_COPY);
+ }
+
+ protected IDataModel getModuleFacetDataModel() {
+ return (IDataModel) getProperty(MODULE_FACET_DATA_MODEL);
+ }
+
+ protected boolean isAddedUtilityFacet() {
+ return getBooleanProperty(ADDED_UTILITY_FACET);
+ }
+
+ protected boolean isAddToEar() {
+ return getBooleanProperty(ADD_TO_EAR);
+ }
+
+ protected IDataModel findModuleFacetDataModel() {
+ FacetActionMap map = (FacetActionMap) getProperty(FACET_ACTION_MAP);
+ IProjectFacetVersion moduleFacet = findModuleFacet();
+ if (moduleFacet != null) {
+ IFacetedProject.Action action = map.getAction(moduleFacet.getProjectFacet().getId());
+ return (action == null) ? null : (IDataModel) action.getConfig();
}
-
return null;
}
+
+ protected IProjectFacetVersion findModuleFacet() {
+ return FacetTools.getModuleFacet(getFacetedProject());
+ }
}

Back to the top