Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2010-09-28 20:26:18 +0000
committerpfullbright2010-09-28 20:26:18 +0000
commitd78c7e45fdd1fa8abbe7fb8b310c37c66ffd1543 (patch)
treea62e5404d97ebafa2104360fa5fb5f8313e1fa3f /jpa/plugins/org.eclipse.jpt.core/src/org
parent75e1c5d953f160acf6f8cece28970a39245925c5 (diff)
downloadwebtools.dali-d78c7e45fdd1fa8abbe7fb8b310c37c66ffd1543.tar.gz
webtools.dali-d78c7e45fdd1fa8abbe7fb8b310c37c66ffd1543.tar.xz
webtools.dali-d78c7e45fdd1fa8abbe7fb8b310c37c66ffd1543.zip
jpt changes to accommodate jaxb
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptLibraryProviderInstallOperationConfig.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptOsgiBundlesLibraryProviderInstallOperationConfig.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptUserLibraryProviderInstallOperationConfig.java43
10 files changed, 143 insertions, 27 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java
index f9ede889cd..a6cb7f88e3 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java
@@ -18,6 +18,7 @@ import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
import org.eclipse.jpt.core.context.java.NullDefaultJavaAttributeMappingDefinition;
import org.eclipse.jpt.core.context.java.NullJavaTypeMappingDefinition;
import org.eclipse.jpt.core.context.java.NullSpecifiedJavaAttributeMappingDefinition;
+import org.eclipse.jpt.core.platform.JpaPlatformDescription;
import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
import org.eclipse.jpt.db.ConnectionProfileFactory;
@@ -42,7 +43,7 @@ import org.eclipse.jpt.db.ConnectionProfileFactory;
* @see JpaPlatformFactory
* @see JpaPlatformProvider
*
- * @version 2.3
+ * @version 3.0
* @since 2.0
*/
public interface JpaPlatform
@@ -53,6 +54,11 @@ public interface JpaPlatform
String getId();
/**
+ * Return the description for this platform
+ */
+ JpaPlatformDescription getDescription();
+
+ /**
* Get the version object for this platform.
*/
Version getJpaVersion();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java
index 4de5f202f5..57da85e230 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java
@@ -23,6 +23,7 @@ import org.eclipse.jpt.core.JpaProject;
import org.eclipse.jpt.core.JpaResourceModel;
import org.eclipse.jpt.core.JpaResourceModelProvider;
import org.eclipse.jpt.core.JpaResourceType;
+import org.eclipse.jpt.core.JptCorePlugin;
import org.eclipse.jpt.core.ResourceDefinition;
import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
@@ -30,6 +31,7 @@ import org.eclipse.jpt.core.context.java.JavaPersistentType;
import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
import org.eclipse.jpt.core.internal.utility.PlatformTools;
import org.eclipse.jpt.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
+import org.eclipse.jpt.core.platform.JpaPlatformDescription;
import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
import org.eclipse.jpt.db.ConnectionProfileFactory;
import org.eclipse.jpt.db.JptDbPlugin;
@@ -71,6 +73,10 @@ public class GenericJpaPlatform
return this.id;
}
+ public JpaPlatformDescription getDescription() {
+ return JptCorePlugin.getJpaPlatformManager().getJpaPlatform(getId());
+ }
+
public Version getJpaVersion() {
return this.jpaVersion;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java
index 3daaad7cb8..b91372feaf 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java
@@ -15,6 +15,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.core.platform.JpaPlatformDescription;
import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IDelegate;
@@ -39,14 +40,11 @@ public abstract class JpaFacetActionDelegate
SubMonitor subMonitor = SubMonitor.convert(monitor, 7);
- // NB: WTP Natures (including the JavaEMFNature)
- // should already be added, as this facet should
- // always coexist with a module facet.
-
IDataModel dataModel = (IDataModel) config;
// project settings
- JptCorePlugin.setJpaPlatformId(project, dataModel.getStringProperty(PLATFORM_ID));
+ JpaPlatformDescription platform = (JpaPlatformDescription) dataModel.getProperty(PLATFORM);
+ JptCorePlugin.setJpaPlatformId(project, platform.getId());
subMonitor.worked(1);
// do NOT use IDataModel.getStringProperty(String) - or the connection profile name can
@@ -68,7 +66,7 @@ public abstract class JpaFacetActionDelegate
subMonitor.worked(1);
// defaults settings
- JptCorePlugin.setDefaultJpaPlatformId(fv.getVersionString(), dataModel.getStringProperty(PLATFORM_ID));
+ JptCorePlugin.setDefaultJpaPlatformId(fv.getVersionString(), platform.getId());
subMonitor.worked(1);
//Delegate to LibraryInstallDelegate to configure the project classpath
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java
index 4b3eb38bf5..4c2c6e051e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Oracle.
+ * Copyright (c) 2009, 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
@@ -26,9 +26,9 @@ public interface JpaFacetDataModelProperties
String RUNTIME = PREFIX_ + "RUNTIME";
/**
- * Required, type String, identifies Jpa Platform
+ * Required, type JpaPlatformDescription, identifies Jpa Platform
*/
- String PLATFORM_ID = PREFIX_ + "PLATFORM_ID";
+ String PLATFORM = PREFIX_ + "PLATFORM";
/**
* Required, type LibraryInstallDelegate, the library install delegate used to configure JPA provider library
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java
index 70a12f93f9..c576475364 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java
@@ -12,6 +12,7 @@ package org.eclipse.jpt.core.internal.facet;
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.core.platform.JpaPlatformDescription;
import org.eclipse.jpt.db.ConnectionProfile;
import org.eclipse.jpt.db.Database;
import org.eclipse.jpt.db.SchemaContainer;
@@ -83,8 +84,8 @@ public class JpaFacetInstallDataModelProvider
}
@Override
- protected String getDefaultPlatformId() {
- return JptCorePlugin.getDefaultJpaPlatform(getProjectFacetVersion()).getId();
+ protected JpaPlatformDescription getDefaultPlatform() {
+ return JptCorePlugin.getDefaultJpaPlatform(getProjectFacetVersion());
}
@Override
@@ -159,7 +160,7 @@ public class JpaFacetInstallDataModelProvider
@Override
public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(PLATFORM_ID)) {
+ if (propertyName.equals(PLATFORM)) {
return this.buildValidPlatformDescriptors();
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java
index acdfa2dff5..f4c83701af 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 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.
@@ -27,5 +27,4 @@ public class JpaFacetUninstallDelegate
// it is required by the facet extension point action element, and that
// is required by the facet UI to allow uninstallation of this facet.
}
-
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.java
index 3efb401b89..c00035caf9 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.java
@@ -49,8 +49,8 @@ public class JpaFacetVersionChangeDataModelProvider
// **************** defaults **********************************************
@Override
- protected String getDefaultPlatformId() {
- return getJpaProject().getJpaPlatform().getId();
+ protected JpaPlatformDescription getDefaultPlatform() {
+ return getJpaProject().getJpaPlatform().getDescription();
}
@Override
@@ -87,25 +87,24 @@ public class JpaFacetVersionChangeDataModelProvider
// **************** valid property descriptors ****************************
@Override
- protected Iterable<String> buildValidPlatformIds() {
- // add existing platform id to list of choices
- Iterable<String> validPlatformIds = super.buildValidPlatformIds();
- if (! CollectionTools.contains(validPlatformIds, getDefaultPlatformId())) {
- validPlatformIds = new CompositeIterable(getDefaultPlatformId(), validPlatformIds);
+ protected Iterable<JpaPlatformDescription> buildValidPlatformDescriptions() {
+ // add existing platform to list of choices
+ Iterable<JpaPlatformDescription> validPlatformDescs = super.buildValidPlatformDescriptions();
+ if (! CollectionTools.contains(validPlatformDescs, getDefaultPlatform())) {
+ validPlatformDescs = new CompositeIterable(getDefaultPlatform(), validPlatformDescs);
}
- return validPlatformIds;
+ return validPlatformDescs;
}
// **************** validation ********************************************
@Override
- protected IStatus validatePlatformId() {
- IStatus status = super.validatePlatformId();
+ protected IStatus validatePlatform() {
+ IStatus status = super.validatePlatform();
if (status.isOK()) {
- JpaPlatformDescription platform = JptCorePlugin.getJpaPlatformManager().getJpaPlatform(getPlatformId());
- if (! platform.supportsJpaFacetVersion(getProjectFacetVersion())) {
+ if (! getPlatform().supportsJpaFacetVersion(getProjectFacetVersion())) {
status = PLATFORM_DOES_NOT_SUPPORT_FACET_VERSION_STATUS;
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptLibraryProviderInstallOperationConfig.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptLibraryProviderInstallOperationConfig.java
new file mode 100644
index 0000000000..f1861e8a3a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptLibraryProviderInstallOperationConfig.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * 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.libprov;
+
+import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+
+public interface JptLibraryProviderInstallOperationConfig {
+
+ ILibraryProvider getLibraryProvider();
+
+ IProjectFacetVersion getProjectFacetVersion();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptOsgiBundlesLibraryProviderInstallOperationConfig.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptOsgiBundlesLibraryProviderInstallOperationConfig.java
new file mode 100644
index 0000000000..490334ca91
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptOsgiBundlesLibraryProviderInstallOperationConfig.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.libprov;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.core.libval.LibraryValidator;
+
+
+public abstract class JptOsgiBundlesLibraryProviderInstallOperationConfig
+ extends TempWtpOsgiBundlesLibraryProviderInstallOperationConfig
+ implements JptLibraryProviderInstallOperationConfig {
+
+ protected JptOsgiBundlesLibraryProviderInstallOperationConfig() {
+ super();
+ }
+
+
+ @Override
+ public synchronized IStatus validate() {
+ IStatus status = super.validate();
+ if (! status.isOK()) {
+ return status;
+ }
+
+ for (LibraryValidator libraryValidator : JptCorePlugin.getLibraryValidators(this)) {
+ status = libraryValidator.validate(this);
+ if (! status.isOK()) {
+ return status;
+ }
+ }
+
+ return Status.OK_STATUS;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptUserLibraryProviderInstallOperationConfig.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptUserLibraryProviderInstallOperationConfig.java
new file mode 100644
index 0000000000..d798cf030f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/JptUserLibraryProviderInstallOperationConfig.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.libprov;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.core.libval.LibraryValidator;
+
+
+public abstract class JptUserLibraryProviderInstallOperationConfig
+ extends TempWtpUserLibraryProviderInstallOperationConfig
+ implements JptLibraryProviderInstallOperationConfig {
+
+ protected JptUserLibraryProviderInstallOperationConfig() {
+ super();
+ }
+
+
+ @Override
+ public synchronized IStatus validate() {
+ IStatus status = super.validate();
+ if (! status.isOK()) {
+ return status;
+ }
+
+ for (LibraryValidator libraryValidator : JptCorePlugin.getLibraryValidators(this)) {
+ status = libraryValidator.validate(this);
+ if (! status.isOK()) {
+ return status;
+ }
+ }
+
+ return Status.OK_STATUS;
+ }
+}

Back to the top