[396951] Enable facet change version to avoid conflict with delegates
diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/project/facet/J2EEFacetVersionChangeDelegate.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/project/facet/J2EEFacetVersionChangeDelegate.java
new file mode 100644
index 0000000..b3a5672
--- /dev/null
+++ b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/project/facet/J2EEFacetVersionChangeDelegate.java
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * Copyright (c) 2012 IBM.
+ * 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:
+ * Marcos Munoz - Change version facet enablement
+ ******************************************************************************/
+
+package org.eclipse.jst.j2ee.project.facet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * The intention of this class is the enablement of the change facet
+ * version action (Action.Type.VERSION_CHANGE). The real implementation
+ * of the tasks associated with the action should be handled by listeners
+ * linked to IFacetedProjectEvent.Type.PRE_VERSION_CHANGE or
+ * IFacetedProjectEvent.Type.POST_VERSION_CHANGE events.
+ *
+ * Be cautious to filter your actions properly so the code in the listeners
+ * could be executed only when required.
+ *
+ * @author <a href="mailto:jmmunoz@mx1.ibm.com">Marcos Munoz</a>
+ *
+ */
+public class J2EEFacetVersionChangeDelegate implements IDelegate {
+
+ public void execute(IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ //do nothing
+ }
+
+}
diff --git a/plugins/org.eclipse.jst.j2ee/plugin.xml b/plugins/org.eclipse.jst.j2ee/plugin.xml
index 5752b0a..cba8b41 100644
--- a/plugins/org.eclipse.jst.j2ee/plugin.xml
+++ b/plugins/org.eclipse.jst.j2ee/plugin.xml
@@ -575,7 +575,97 @@
<label>%APPCLIENT_FACET_TEMPLATE</label>
<fixed facet="jst.java"/>
<fixed facet="jst.appclient"/>
- </template>
+ </template>
+ <action
+ facet="jst.ear"
+ id="jst.ear.versionchange.legacy"
+ type="VERSION_CHANGE"
+ version="[1.4-6.0]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="1.4"/>
+ </action>
+ <action
+ facet="jst.ear"
+ id="jst.ear.versionchange"
+ type="VERSION_CHANGE"
+ version="[5.0-6.0]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="5.0"/>
+ </action>
+ <action
+ facet="jst.appclient"
+ id="jst.appclient.versionchange.legacy"
+ type="VERSION_CHANGE"
+ version="[1.4-6.0]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="1.4"/>
+ </action>
+ <action
+ facet="jst.appclient"
+ id="jst.appclient.versionchange"
+ type="VERSION_CHANGE"
+ version="[5.0-6.0]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="5.0"/>
+ </action>
+ <action
+ facet="jst.ejb"
+ id="jst.ejb.versionchange.legacy"
+ type="VERSION_CHANGE"
+ version="[2.1-3.1]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="2.1"/>
+ </action>
+ <action
+ facet="jst.ejb"
+ id="jst.ejb.versionchange"
+ type="VERSION_CHANGE"
+ version="[3.0-3.1]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="3.0"/>
+ </action>
+ <action
+ facet="jst.web"
+ id="jst.web.versionchange.legacy"
+ type="VERSION_CHANGE"
+ version="[2.4-3.0]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="2.4"/>
+ </action>
+ <action
+ facet="jst.web"
+ id="jst.web.versionchange"
+ type="VERSION_CHANGE"
+ version="[2.5-3.0]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="2.5"/>
+ </action>
+ <action
+ facet="jst.connector"
+ id="jst.connector.versionchange"
+ type="VERSION_CHANGE"
+ version="[1.5-1.6]">
+ <delegate
+ class="org.eclipse.jst.j2ee.project.facet.J2EEFacetVersionChangeDelegate">
+ </delegate>
+ <property name="from.versions" value="1.5"/>
+ </action>
</extension>