Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2008-04-30 15:47:17 +0000
committerpfullbright2008-04-30 15:47:17 +0000
commit2d028523678ce2cc252a64808a5be0d4b66a75e0 (patch)
tree3f8bc513728e7a993b68a6ce586dbccfa8d04770
parent95107c415db5c15c848a241cf61394f1b0e552f4 (diff)
downloadwebtools.dali-2d028523678ce2cc252a64808a5be0d4b66a75e0.tar.gz
webtools.dali-2d028523678ce2cc252a64808a5be0d4b66a75e0.tar.xz
webtools.dali-2d028523678ce2cc252a64808a5be0d4b66a75e0.zip
[Bug 228764] - JPA facet wizard page: no default platform specified if previous default platform is no longer available
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java7
2 files changed, 17 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
index 34fec11218..e957c69312 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
@@ -26,6 +26,7 @@ import org.eclipse.jpt.core.internal.JpaModelManager;
import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants;
+import org.eclipse.jpt.core.internal.prefs.JpaPreferenceInitializer;
import org.eclipse.jst.j2ee.internal.J2EEConstants;
import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
@@ -272,9 +273,17 @@ public class JptCorePlugin extends Plugin {
* Return the default JPA platform ID for creating new JPA projects
*/
public static String getDefaultJpaPlatformId() {
- return Platform.getPreferencesService().get(
+ String platformId =
+ Platform.getPreferencesService().get(
JpaPreferenceConstants.PREF_DEFAULT_JPA_PLATFORM, GenericJpaPlatform.ID,
new Preferences[] {getWorkspacePreferences(), getDefaultPreferences()});
+ if (! JpaPlatformRegistry.instance().containsPlatform(platformId)) {
+ platformId =
+ Platform.getPreferencesService().get(
+ JpaPreferenceConstants.PREF_DEFAULT_JPA_PLATFORM, GenericJpaPlatform.ID,
+ new Preferences[] {getDefaultPreferences()});
+ }
+ return platformId;
}
/**
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java
index e59661ab10..44adcfcb0a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java
@@ -141,6 +141,13 @@ public class JpaPlatformRegistry {
}
/**
+ * Return whether the platform id is registered
+ */
+ public boolean containsPlatform(String platformId) {
+ return this.jpaPlatformConfigurationElements.containsKey(platformId);
+ }
+
+ /**
* Return the label for the JPA platform with the specified ID.
* This does not activate the JPA platform's plug-in.
*/

Back to the top