Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 237692 Details for
Bug 422481
Add a new preference to consider the target runtime when deciding to check or not 'Add to EAR' by default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed fix to add the preference and react according to the value found there
webtools.javaee.patch (text/plain), 7.79 KB, created by
Julio C. Chavez
on 2013-11-25 10:23:20 EST
(
hide
)
Description:
Proposed fix to add the preference and react according to the value found there
Filename:
MIME Type:
Creator:
Julio C. Chavez
Created:
2013-11-25 10:23:20 EST
Size:
7.79 KB
patch
obsolete
>diff --git a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF >index b483ca7..d4e874c 100644 >--- a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF >+++ b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Bundle-Name.0 > Bundle-SymbolicName: org.eclipse.jst.j2ee; singleton:=true >-Bundle-Version: 1.1.701.qualifier >+Bundle-Version: 1.1.800.qualifier > Bundle-Activator: org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin > Bundle-Vendor: %Bundle-Vendor.0 > Bundle-Localization: plugin >diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/JavaEEBinaryComponentHelper.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/JavaEEBinaryComponentHelper.java >index 9045683..7bd7d01 100644 >--- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/JavaEEBinaryComponentHelper.java >+++ b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/internal/componentcore/JavaEEBinaryComponentHelper.java >@@ -18,7 +18,6 @@ > import java.util.Iterator; > import java.util.LinkedHashMap; > import java.util.Map; >-import java.util.Map.Entry; > import java.util.Set; > import java.util.zip.ZipException; > >diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEModuleFacetInstallDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEModuleFacetInstallDataModelProvider.java >index e16ab5e..fa2fbf7 100644 >--- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEModuleFacetInstallDataModelProvider.java >+++ b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEModuleFacetInstallDataModelProvider.java >@@ -105,7 +105,8 @@ > if (propertyName.equals(PROHIBIT_ADD_TO_EAR)) { > return Boolean.FALSE; > } else if (propertyName.equals(ADD_TO_EAR)) { >- return new Boolean( J2EEPlugin.getDefault().getJ2EEPreferences().getBoolean(J2EEPreferences.Keys.ADD_TO_EAR_BY_DEFAULT) && isEARSupportedByRuntime()); >+ return new Boolean( J2EEPlugin.getDefault().getJ2EEPreferences().getBoolean(J2EEPreferences.Keys.ADD_TO_EAR_BY_DEFAULT) >+ && isEARSupportedByRuntime() && isEARDefaultForRuntime()); > } else if (propertyName.equals(EAR_PROJECT_NAME)) { > DataModelPropertyDescriptor[] descs = getValidPropertyDescriptors(EAR_PROJECT_NAME); > if (model.isPropertySet(LAST_EAR_NAME)) { >@@ -274,7 +275,7 @@ > @Override > public boolean isPropertyEnabled(String propertyName) { > if (ADD_TO_EAR.equals(propertyName)) { >- return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime(); >+ return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime() && isEARDefaultForRuntime(); > } > if (EAR_PROJECT_NAME.equals(propertyName)) { > return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime() && getBooleanProperty(ADD_TO_EAR); >@@ -372,10 +373,31 @@ > private boolean isEARSupportedByRuntime() { > boolean ret = true; > IRuntime rt = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); >- if (rt != null) >+ >+ if (rt != null) { > ret = rt.supports(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET); >+ } >+ > return ret; > } >+ >+ private boolean isEARDefaultForRuntime() { >+ boolean result = true; >+ IRuntime rt = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); >+ >+ >+ if (rt != null && rt.getName() != null) { >+ for(String excluded : >+ J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.ADD_TO_EAR_RUNTIME_EXCLUSIONS).split(",")) { //$NON-NLS-1$ >+ if (rt.getName().equals(excluded)) { >+ result = false; >+ break; >+ } >+ } >+ } >+ >+ return result; >+ } > > @Override > protected int convertFacetVersionToJ2EEVersion( IProjectFacetVersion version ) >diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/JavaEEPreferencesInitializer.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/JavaEEPreferencesInitializer.java >index ccbd44d..b11eea8 100644 >--- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/JavaEEPreferencesInitializer.java >+++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/JavaEEPreferencesInitializer.java >@@ -70,6 +70,11 @@ > * @since 2.0 > */ > static final String ADD_TO_EAR_BY_DEFAULT = IProductConstants.ADD_TO_EAR_BY_DEFAULT; >+ >+ /** >+ * @since 2.0 >+ */ >+ static final String ADD_TO_EAR_RUNTIME_EXCLUSIONS = IProductConstants.ADD_TO_EAR_RUNTIME_EXCLUSIONS; > /** > * @since 2.0 > */ >@@ -237,6 +242,7 @@ > node.put(Keys.EJB_CONTENT_FOLDER, ProductManager.getProperty(IProductConstants.EJB_CONTENT_FOLDER)); > node.put(Keys.JCA_CONTENT_FOLDER, ProductManager.getProperty(IProductConstants.JCA_CONTENT_FOLDER)); > node.put(Keys.ADD_TO_EAR_BY_DEFAULT, ProductManager.getProperty(IProductConstants.ADD_TO_EAR_BY_DEFAULT)); >+ node.put(Keys.ADD_TO_EAR_RUNTIME_EXCLUSIONS, ProductManager.getProperty(IProductConstants.ADD_TO_EAR_RUNTIME_EXCLUSIONS)); > // done in CommonFrameworksPref..Initializer > //node.put(Keys.OUTPUT_FOLDER, ProductManager.getProperty(IProductConstants.OUTPUT_FOLDER)); > >diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/project/facet/IProductConstants.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/project/facet/IProductConstants.java >index 3418475..96c9d2f 100644 >--- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/project/facet/IProductConstants.java >+++ b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/project/facet/IProductConstants.java >@@ -32,6 +32,7 @@ > public static final String JCA_CONTENT_FOLDER = "jcaContent"; //$NON-NLS-1$ > public static final String DEFAULT_SOURCE_FOLDER = "defaultSource"; //$NON-NLS-1$ > public static final String ADD_TO_EAR_BY_DEFAULT = "addToEarByDefault"; //$NON-NLS-1$ >+ public static final String ADD_TO_EAR_RUNTIME_EXCLUSIONS = "addToEARruntimeExclusions"; //$NON-NLS-1$ > public static final String OUTPUT_FOLDER = "outputFolder"; //$NON-NLS-1$ > public static final String USE_SINGLE_ROOT_STRUCTURE = "useSingleRootStructure"; //$NON-NLS-1$ > public static final String ID_PERSPECTIVE_HIERARCHY_VIEW = "idPerspectiveHierarchyView"; //$NON-NLS-1$ >diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/project/facet/ProductManager.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/project/facet/ProductManager.java >index 53583f5..e53ff07 100644 >--- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/project/facet/ProductManager.java >+++ b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/project/facet/ProductManager.java >@@ -34,6 +34,7 @@ > private static final String JCA_CONTENT_FOLDER = "connectorModule"; //$NON-NLS-1$ > private static final String DEFAULT_SOURCE_FOLDER = "src"; //$NON-NLS-1$ > private static final String ADD_TO_EAR_BY_DEFAULT = "false"; //$NON-NLS-1$ >+ private static final String ADD_TO_EAR_RUNTIME_EXCLUSIONS = ""; //$NON-NLS-1$ > private static final String OUTPUT_FOLDER = "build/classes"; //$NON-NLS-1$ > private static final String USE_SINGLE_ROOT_STRUCTURE = "false"; //$NON-NLS-1$ > private static final String VIEWER_SYNC_FOR_WEBSERVICES = "true"; //$NON-NLS-1$ >@@ -81,6 +82,8 @@ > return DEFAULT_SOURCE_FOLDER; > else if (key.equals(IProductConstants.ADD_TO_EAR_BY_DEFAULT)) > return ADD_TO_EAR_BY_DEFAULT; >+ else if (key.equals(IProductConstants.ADD_TO_EAR_RUNTIME_EXCLUSIONS)) >+ return ADD_TO_EAR_RUNTIME_EXCLUSIONS; > else if (key.equals(IProductConstants.USE_SINGLE_ROOT_STRUCTURE)) > return USE_SINGLE_ROOT_STRUCTURE; > else if (key.equals(IProductConstants.VIEWER_SYNC_FOR_WEBSERVICES))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 422481
:
237692
|
237739
|
237820
|
237821
|
237823