Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Hauge2012-11-07 18:12:17 -0500
committerNeil Hauge2012-11-07 18:19:05 -0500
commit1e2bfd070a8a180d2e83ab421935d7e17e96db4b (patch)
tree1eeafed6815aab29664662b6809b80595d6eb701
parent92ce02c502941b8471c3dbfdcf75c8d9801cd0a0 (diff)
downloadwebtools.dali-1e2bfd070a8a180d2e83ab421935d7e17e96db4b.tar.gz
webtools.dali-1e2bfd070a8a180d2e83ab421935d7e17e96db4b.tar.xz
webtools.dali-1e2bfd070a8a180d2e83ab421935d7e17e96db4b.zip
387586 - Add product preference for "Discover Annotated Classes" mode.v201211080018
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/facet/JpaFacetInstallDataModelProvider.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/facet/JpaFacetInstallDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/facet/JpaFacetInstallDataModelProvider.java
index 74f6db9a7b..5771999b6e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/facet/JpaFacetInstallDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/facet/JpaFacetInstallDataModelProvider.java
@@ -10,7 +10,10 @@
package org.eclipse.jpt.jpa.core.internal.facet;
import java.util.Set;
+
+import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jpt.jpa.core.platform.JpaPlatformConfig;
import org.eclipse.jpt.jpa.db.ConnectionProfile;
import org.eclipse.jpt.jpa.db.Database;
@@ -22,6 +25,10 @@ public class JpaFacetInstallDataModelProvider
extends JpaFacetDataModelProvider
implements JpaFacetInstallDataModelProperties
{
+
+ /** used for adopter product customization */
+ private static final String DISCOVER_ANNOTATED_CLASSES_DEFAULT = "discoverAnnotatedClassesDefault"; //$NON-NLS-1$
+
/**
* required default constructor
*/
@@ -121,7 +128,12 @@ public class JpaFacetInstallDataModelProvider
@Override
protected Boolean getDefaultDiscoverAnnotatedClasses() {
- return Boolean.valueOf(this.runtimeSupportsEjb30());
+ //Check for product preference first to determine default setting
+ IProduct product = Platform.getProduct();
+ String discoverAnnotatedClassesDefaultPreference = (product == null) ? null : product.getProperty(DISCOVER_ANNOTATED_CLASSES_DEFAULT);
+ //if no product preference is defined check the runtime for support, otherwise check the preference to determine override
+ return (discoverAnnotatedClassesDefaultPreference == null) ?
+ Boolean.valueOf(this.runtimeSupportsEjb30()) : discoverAnnotatedClassesDefaultPreference.equals("true");
}

Back to the top