[156254]commited for NA
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/datamodel/ui/DataModelWizard.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/datamodel/ui/DataModelWizard.java
index 6424872..3f15bec 100644
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/datamodel/ui/DataModelWizard.java
+++ b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/datamodel/ui/DataModelWizard.java
@@ -158,6 +158,12 @@
// }
}
+ protected boolean isExecuting() {
+ return executing;
+ }
+
+ private boolean executing = false;
+
/*
* (non-Javadoc)
*
@@ -165,6 +171,7 @@
*/
public final boolean performFinish() {
try {
+ executing = true;
if (prePerformFinish()) {
storeDefaultSettings();
@@ -182,6 +189,8 @@
} catch (Throwable exc) {
WTPUIPlugin.log(exc);
ErrorDialog.openError(getShell(), WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_0, new Object[]{getWindowTitle()}), WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_1, new Object[]{getWindowTitle()}), exc, 0, false);
+ } finally {
+ executing = false;
}
return true;
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/datamodel/ui/DataModelWizardPage.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/datamodel/ui/DataModelWizardPage.java
index d49ae43..288022d 100644
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/datamodel/ui/DataModelWizardPage.java
+++ b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/datamodel/ui/DataModelWizardPage.java
@@ -403,6 +403,20 @@
isFirstTimeToPage = b;
}
+ private boolean gotDataModelWizard = false;
+ private DataModelWizard dataModelWizard = null;
+ protected DataModelWizard getDataModelWizard(){
+ if(!gotDataModelWizard){
+ gotDataModelWizard = true;
+ IWizard wizard = getWizard();
+ if(wizard instanceof DataModelWizard){
+ dataModelWizard = (DataModelWizard)wizard;
+ }
+ }
+ return dataModelWizard;
+ }
+
+
/*
* If a property changes that we want to validate, force validation on this page.
*
@@ -410,12 +424,15 @@
* java.lang.Object, java.lang.Object)
*/
public void propertyChanged(DataModelEvent event) {
- String propertyName = event.getPropertyName();
- if (validationPropertyNames != null && (event.getFlag() == DataModelEvent.VALUE_CHG || (!isPageComplete() && event.getFlag() == DataModelEvent.VALID_VALUES_CHG))) {
- for (int i = 0; i < validationPropertyNames.length; i++) {
- if (validationPropertyNames[i].equals(propertyName)) {
- validatePage(showValidationErrorsOnEnter());
- break;
+ DataModelWizard w = getDataModelWizard();
+ if(w == null || !w.isExecuting()){
+ String propertyName = event.getPropertyName();
+ if (validationPropertyNames != null && (event.getFlag() == DataModelEvent.VALUE_CHG || (!isPageComplete() && event.getFlag() == DataModelEvent.VALID_VALUES_CHG))) {
+ for (int i = 0; i < validationPropertyNames.length; i++) {
+ if (validationPropertyNames[i].equals(propertyName)) {
+ validatePage(showValidationErrorsOnEnter());
+ break;
+ }
}
}
}
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/datamodel/FacetProjectCreationDataModelProvider.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/datamodel/FacetProjectCreationDataModelProvider.java
index 69cb04e..bf7c505 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/datamodel/FacetProjectCreationDataModelProvider.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/datamodel/FacetProjectCreationDataModelProvider.java
@@ -52,7 +52,9 @@
* be exposed to clients. Subclasses should initialize this Collection in
* their init() methods
*/
- protected static final String REQUIRED_FACETS_COLLECTION = "FacetProjectCreationDataModelProvider.REQUIRED_FACETS_COLLECTION";
+ public static final String REQUIRED_FACETS_COLLECTION = "FacetProjectCreationDataModelProvider.REQUIRED_FACETS_COLLECTION";
+
+ public static final String FORCE_VERSION_COMPLIANCE = "FacetProjectCreationDataModelProvider.FORCE_VERSION_COMPLIANCE";
public FacetProjectCreationDataModelProvider() {
super();
@@ -65,6 +67,7 @@
names.add(FACET_ACTION_MAP);
names.add(FACET_RUNTIME);
names.add(REQUIRED_FACETS_COLLECTION);
+ names.add(FORCE_VERSION_COMPLIANCE);
return names;
}
@@ -242,21 +245,23 @@
}
}
if (runtime != null) {
- Map facetDMs = (Map) getProperty(FACET_DM_MAP);
-
- for (Iterator iterator = facetDMs.values().iterator(); iterator.hasNext();) {
- IDataModel facetDataModel = (IDataModel) iterator.next();
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet((String) facetDataModel.getProperty(IFacetDataModelProperties.FACET_ID));
-
- try {
- IDataModel facetModel = ((FacetDataModelMap) facetDMs).getFacetDataModel(facet.getId());
- IProjectFacetVersion oldVersion = (IProjectFacetVersion) facetModel.getProperty(IFacetDataModelProperties.FACET_VERSION);
- IProjectFacetVersion newVersion = facet.getLatestSupportedVersion(runtime);
- if (newVersion != null && (oldVersion == null || oldVersion.getVersionString().compareTo(newVersion.getVersionString()) > 0 || !runtime.supports(oldVersion))) {
- facetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, newVersion);
+ if(getBooleanProperty(FORCE_VERSION_COMPLIANCE)){
+ Map facetDMs = (Map) getProperty(FACET_DM_MAP);
+
+ for (Iterator iterator = facetDMs.values().iterator(); iterator.hasNext();) {
+ IDataModel facetDataModel = (IDataModel) iterator.next();
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet((String) facetDataModel.getProperty(IFacetDataModelProperties.FACET_ID));
+
+ try {
+ IDataModel facetModel = ((FacetDataModelMap) facetDMs).getFacetDataModel(facet.getId());
+ IProjectFacetVersion oldVersion = (IProjectFacetVersion) facetModel.getProperty(IFacetDataModelProperties.FACET_VERSION);
+ IProjectFacetVersion newVersion = facet.getLatestSupportedVersion(runtime);
+ if (newVersion != null && (oldVersion == null || oldVersion.getVersionString().compareTo(newVersion.getVersionString()) > 0 || !runtime.supports(oldVersion))) {
+ facetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, newVersion);
+ }
+ } catch (CoreException e) {
+ Logger.getLogger().logError(e);
}
- } catch (CoreException e) {
- Logger.getLogger().logError(e);
}
}
}
@@ -277,6 +282,8 @@
Collection c = new ArrayList();
setProperty(REQUIRED_FACETS_COLLECTION, c);
return c;
+ } else if(FORCE_VERSION_COMPLIANCE.equals(propertyName)){
+ return Boolean.TRUE;
}
return super.getDefaultProperty(propertyName);
}