[499865] A warning or confirmation dialog should appear when modules are
removed from a server
diff --git a/features/org.eclipse.wst.server_sdk.feature/feature.xml b/features/org.eclipse.wst.server_sdk.feature/feature.xml
index 41a8c9f..586c693 100644
--- a/features/org.eclipse.wst.server_sdk.feature/feature.xml
+++ b/features/org.eclipse.wst.server_sdk.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature

       id="org.eclipse.wst.server_sdk.feature"

       label="%featureName"

-      version="3.3.600.qualifier"

+      version="3.3.601.qualifier"

       provider-name="%providerName"

       license-feature="org.eclipse.license"

       license-feature-version="1.0.1.qualifier">

diff --git a/features/org.eclipse.wst.server_sdk.feature/pom.xml b/features/org.eclipse.wst.server_sdk.feature/pom.xml
index 954443a..5d8551c 100644
--- a/features/org.eclipse.wst.server_sdk.feature/pom.xml
+++ b/features/org.eclipse.wst.server_sdk.feature/pom.xml
@@ -22,6 +22,6 @@
 

   <groupId>org.eclipse.webtools.servertools</groupId>

   <artifactId>org.eclipse.wst.server_sdk.feature</artifactId>

-  <version>3.3.600-SNAPSHOT</version>

+  <version>3.3.601-SNAPSHOT</version>

   <packaging>eclipse-feature</packaging>

 </project>

diff --git a/features/org.eclipse.wst.server_tests.feature/feature.xml b/features/org.eclipse.wst.server_tests.feature/feature.xml
index 5157a49..1e7f825 100644
--- a/features/org.eclipse.wst.server_tests.feature/feature.xml
+++ b/features/org.eclipse.wst.server_tests.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature

       id="org.eclipse.wst.server_tests.feature"

       label="%featureName"

-      version="3.3.301.qualifier"

+      version="3.3.302.qualifier"

       provider-name="%providerName"

       license-feature="org.eclipse.license"

       license-feature-version="1.0.1.qualifier">

diff --git a/features/org.eclipse.wst.server_tests.feature/pom.xml b/features/org.eclipse.wst.server_tests.feature/pom.xml
index 79e70d6..14ea0ec 100644
--- a/features/org.eclipse.wst.server_tests.feature/pom.xml
+++ b/features/org.eclipse.wst.server_tests.feature/pom.xml
@@ -22,6 +22,6 @@
 

   <groupId>org.eclipse.webtools.servertools</groupId>

   <artifactId>org.eclipse.wst.server_tests.feature</artifactId>

-  <version>3.3.301-SNAPSHOT</version>

+  <version>3.3.302-SNAPSHOT</version>

   <packaging>eclipse-feature</packaging>

 </project>

diff --git a/features/org.eclipse.wst.server_ui.feature/feature.xml b/features/org.eclipse.wst.server_ui.feature/feature.xml
index c8f1275..52d1dab 100644
--- a/features/org.eclipse.wst.server_ui.feature/feature.xml
+++ b/features/org.eclipse.wst.server_ui.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.server_ui.feature"
       label="%featureName"
-      version="3.3.653.qualifier"
+      version="3.3.654.qualifier"
       provider-name="%providerName"
       license-feature="org.eclipse.license"
       license-feature-version="1.0.1.qualifier">
diff --git a/features/org.eclipse.wst.server_ui.feature/pom.xml b/features/org.eclipse.wst.server_ui.feature/pom.xml
index 64a0f45..7852c9a 100644
--- a/features/org.eclipse.wst.server_ui.feature/pom.xml
+++ b/features/org.eclipse.wst.server_ui.feature/pom.xml
@@ -22,7 +22,7 @@
 
   <groupId>org.eclipse.webtools.servertools</groupId>
   <artifactId>org.eclipse.wst.server_ui.feature</artifactId>
-  <version>3.3.653-SNAPSHOT</version>
+  <version>3.3.654-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>
 
   <build>
diff --git a/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
index 98302df..6751a1b 100644
--- a/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.server.ui; singleton:=true
-Bundle-Version: 1.5.304.qualifier
+Bundle-Version: 1.5.305.qualifier
 Bundle-Activator: org.eclipse.wst.server.ui.internal.ServerUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.properties b/plugins/org.eclipse.wst.server.ui/plugin.properties
index 35ecb73..78d887f 100644
--- a/plugins/org.eclipse.wst.server.ui/plugin.properties
+++ b/plugins/org.eclipse.wst.server.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2010 IBM Corporation and others.
+# Copyright (c) 2004, 2016 IBM Corporation and others.
 # 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
@@ -21,6 +21,7 @@
 extensionPointAudio=Audio
 extensionPointServerCreationWizardPageExtension=Server Creation Wizard Page Extension
 extensionPointServerEditorOverviewPageExtension=Server Editor Overview Page Modifier
+extensionPointRemoveModuleMessageExtension=Remove Module Message Customization Extension
 
 # --------------- Wizards and Views ---------------
 
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.xml b/plugins/org.eclipse.wst.server.ui/plugin.xml
index 5c4eaf6..ed51722 100644
--- a/plugins/org.eclipse.wst.server.ui/plugin.xml
+++ b/plugins/org.eclipse.wst.server.ui/plugin.xml
@@ -14,6 +14,7 @@
   <extension-point id="serverEditorOverviewPageModifier" name="%extensionPointServerEditorOverviewPageExtension" schema="schema/serverEditorOverviewPageModifier.exsd"/>
   <extension-point id="serverLabelProvider" name="%serverLabelProvider" schema="schema/serverLabelProvider.exsd"/>
   <extension-point id="deleteServerDialogExtension" name="%deleteServerDialogExtension" schema="schema/deleteServerDialogExtension.exsd"/>
+  <extension-point id="removeModuleMessageExtension" name="%extensionPointRemoveModuleMessageExtension" schema="schema/removeModuleMessageExtension.exsd"/>
 
 <extension point="org.eclipse.ui.newWizards">
   <category
diff --git a/plugins/org.eclipse.wst.server.ui/pom.xml b/plugins/org.eclipse.wst.server.ui/pom.xml
index e0ca26d..9ada1a6 100644
--- a/plugins/org.eclipse.wst.server.ui/pom.xml
+++ b/plugins/org.eclipse.wst.server.ui/pom.xml
@@ -22,6 +22,6 @@
 
   <groupId>org.eclipse.webtools.servertools</groupId>
   <artifactId>org.eclipse.wst.server.ui</artifactId>
-  <version>1.5.304-SNAPSHOT</version>
+  <version>1.5.305-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/plugins/org.eclipse.wst.server.ui/schema/removeModuleMessageExtension.exsd b/plugins/org.eclipse.wst.server.ui/schema/removeModuleMessageExtension.exsd
new file mode 100644
index 0000000..74e2b67
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/schema/removeModuleMessageExtension.exsd
@@ -0,0 +1,123 @@
+<?xml version='1.0' encoding='UTF-8'?>

+<!-- Schema file written by PDE -->

+<schema targetNamespace="org.eclipse.wst.server.ui" xmlns="http://www.w3.org/2001/XMLSchema">

+<annotation>

+      <appInfo>

+         <meta.schema plugin="org.eclipse.wst.server.ui" id="removeModuleMessageExtension" name="%extensionPointRemoveModuleMessageExtension"/>

+      </appInfo>

+      <documentation>

+         This extension point provides a way for adopters to customize the message in a confirmation dialog that appears when one or modules are removed from a server.  This dialog appears after the Finish button is pressed from the Add and Remove Wizard Dialog and if at least one module is being removed.  The dialog will also appear when the Remove action is performed on one or more selected modules from the Servers view.  Each server type can have their own set of customized messages.

+      </documentation>

+   </annotation>

+

+   <element name="extension">

+      <annotation>

+         <appInfo>

+            <meta.element />

+         </appInfo>

+      </annotation>

+      <complexType>

+         <sequence>

+            <element ref="removeModuleMessageExtension" minOccurs="1" maxOccurs="unbounded"/>

+         </sequence>

+         <attribute name="point" type="string" use="required">

+            <annotation>

+               <documentation>

+                  a fully qualified identifier of the target extension point

+               </documentation>

+            </annotation>

+         </attribute>

+         <attribute name="id" type="string">

+            <annotation>

+               <documentation>

+                  an optional identifier of the extension instance

+               </documentation>

+            </annotation>

+         </attribute>

+         <attribute name="name" type="string">

+            <annotation>

+               <documentation>

+                  an optional name of the extension instance

+               </documentation>

+               <appInfo>

+                  <meta.attribute translatable="true"/>

+               </appInfo>

+            </annotation>

+         </attribute>

+      </complexType>

+   </element>

+

+   <element name="removeModuleMessageExtension">

+      <complexType>

+         <attribute name="id" type="string" use="required">

+            <annotation>

+               <documentation>

+                  specifies a unique identifier for this extension point

+               </documentation>

+            </annotation>

+         </attribute>

+         <attribute name="serverTypeId" type="string" use="required">

+            <annotation>

+               <documentation>

+                  Specifies the serverTypeId of the server for which the customized messages will appear.  Use the reg exp .* or a ending * to specify a family of server.  For example, org.eclipse.wst.server.* or org.eclipse.wst.server*

+               </documentation>

+            </annotation>

+         </attribute>

+         <attribute name="class" type="string" use="required">

+            <annotation>

+               <documentation>

+                  specifies the fully qualified name of the Java class that extends &lt;samp&gt;org.eclipse.wst.server.ui.RemoveModuleMessageExtension&lt;/samp&gt;. The class must have a public 0-arg constructor.

+               </documentation>

+               <appInfo>

+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.server.ui.RemoveModuleMessageExtension:"/>

+               </appInfo>

+            </annotation>

+         </attribute>

+      </complexType>

+   </element>

+

+   <annotation>

+      <appInfo>

+         <meta.section type="since"/>

+      </appInfo>

+      <documentation>

+         3.8.1

+      </documentation>

+   </annotation>

+

+   <annotation>

+      <appInfo>

+         <meta.section type="examples"/>

+      </appInfo>

+      <documentation>

+         The following is an example of the remove module confirmation message extension point:

+

+&lt;pre&gt;

+ &lt;extension

+       point=&quot;org.eclipse.wst.server.ui.removeModuleMessageExtension&quot;&gt;

+    &lt;removeModuleMessageExtension

+          id=&quot;com.example.server.removeModuleMessageExtensionId&quot;

+          serverTypeId=&quot;com.example.server&quot;

+          class=&quot;com.example.ExampleRemoveModuleMessageExtension&quot;&gt;

+    &lt;/removeModuleMessageExtension&gt;

+ &lt;/extension&gt;

+&lt;/pre&gt;

+      </documentation>

+   </annotation>

+

+

+

+   <annotation>

+      <appInfo>

+         <meta.section type="copyright"/>

+      </appInfo>

+      <documentation>

+         Copyright (c) 2016 IBM Corporation and others.&lt;br&gt;

+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 

+&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;

+      </documentation>

+   </annotation>

+

+</schema>

diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/RemoveModuleMessageExtension.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/RemoveModuleMessageExtension.java
new file mode 100644
index 0000000..d3d9683
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/RemoveModuleMessageExtension.java
@@ -0,0 +1,55 @@
+/*******************************************************************************

+ * Copyright (c) 2016 IBM Corporation and others.

+ * 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:

+ *     IBM Corporation - Initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.server.ui;

+

+import org.eclipse.wst.server.core.IModule;

+import org.eclipse.wst.server.core.IServerAttributes;

+

+/**

+ * Extension to override the message that is displayed in the confirmation dialog that appears 

+ * when removing a module or removing multiple modules from the server.

+ * Customization is based on the server type id of the server.

+ *

+ */

+public abstract class RemoveModuleMessageExtension {

+	

+	private String serverTypeId = "";

+	

+	/**

+	 * Get the server type id for which this custom message extension applies

+	 * Extenders are not expected to override this.

+	 * @return

+	 */

+	public String getServerTypeId() {

+		return serverTypeId;

+	}

+	

+	/**

+	 * Set the server type id for which this custom message extension applies

+	 * Extenders are not expected to override this.

+	 * 

+	 * @param serverTypeId

+	 */

+	public void setServerTypeId(String serverTypeId) {

+		this.serverTypeId = serverTypeId;

+	}

+	

+	/**

+	 * Extenders may provide a custom message when removing one or more modules from the server.  Use the provided

+	 * parameters to include the server name and the names of the modules in the message, if desired.  Return a null value

+	 * to use the default string provided by the framework.

+	 * 

+	 * @param server

+	 * @param modules

+	 * @return the custom message when removing one or modules from the server.  Return null to use the default string provided by the framework.

+	 */

+	public abstract String getConfirmationMessage(IServerAttributes server, IModule [] modules);

+}

diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
index b472f6f..af2abb8 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
@@ -141,6 +141,7 @@
 	public static String actionColumns;
 	public static String dialogRemoveModuleConfirm;
 	public static String dialogRemoveModulesConfirm;
+	public static String doNotShowAgain;
 	public static String terminateServerDialogTitle;
 	public static String actionDebugOnServer;
 	public static String actionProfileOnServer;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
index 1f9c9e3..277b4ab 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
@@ -355,6 +355,7 @@
 
 dialogRemoveModuleConfirm=Are you sure you want to remove the resource from the server?
 dialogRemoveModulesConfirm=Are you sure you want to remove the resources from the server?
+doNotShowAgain=&Do not show this message again
 
 # --------------- Misc UI ---------------
 
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/PreferenceUtil.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/PreferenceUtil.java
new file mode 100644
index 0000000..185169d
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/PreferenceUtil.java
@@ -0,0 +1,63 @@
+/*******************************************************************************

+ * Copyright (c) 2016 IBM Corporation and others.

+ * 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:

+ *     IBM Corporation - Initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.server.ui.internal;

+

+import java.util.List;

+

+import org.eclipse.jface.dialogs.MessageDialogWithToggle;

+import org.eclipse.jface.window.Window;

+import org.eclipse.swt.widgets.Shell;

+import org.eclipse.wst.server.core.IModule;

+import org.eclipse.wst.server.core.IServerAttributes;

+import org.eclipse.wst.server.ui.RemoveModuleMessageExtension;

+

+public class PreferenceUtil {

+	

+	public static boolean confirmModuleRemoval(IServerAttributes server, Shell shell, List<IModule> moduleList) {

+		// Get preference value to see if the confirmation dialog should appear or not. Default is to show the dialog.

+		boolean doNotShowDialog = ServerUIPlugin.getPreferences().getDoNotShowRemoveModuleWarning();

+		if (!doNotShowDialog) {

+			String message = null;

+

+			String id = server.getServerType().getId();

+			RemoveModuleMessageExtension targetExtension = ServerUIPlugin.getRemoveModuleMessageExtension(id);

+			String customMessage = null;

+			

+			if (moduleList.size() > 0) {

+				if (targetExtension != null) {

+					customMessage = targetExtension.getConfirmationMessage(server, moduleList.toArray(new IModule [0]));

+				}

+				// The extension might still return null or an empty string.  If so, then use the default/original message.

+				if (customMessage == null || customMessage.length() == 0) {

+					if (moduleList.size() == 1) {

+						message = Messages.dialogRemoveModuleConfirm; // Default singular

+					} else {

+						message = Messages.dialogRemoveModulesConfirm; // Default plural

+					}

+				} else {

+					message = customMessage;

+				}

+			}	

+		

+			MessageDialogWithToggle messageWithToggle = MessageDialogWithToggle.openOkCancelConfirm(shell, Messages.defaultDialogTitle, 

+				message, Messages.doNotShowAgain, false, null, null);

+			// If cancel is pressed, do not update the preference even if the checkbox changed.

+			if (messageWithToggle.getReturnCode() == Window.CANCEL) {

+				// Do not remove, return false

+				return false;

+			}

+			// If OK was pressed, then also update the preference

+			ServerUIPlugin.getPreferences().setDoNotShowRemoveModuleWarning(messageWithToggle.getToggleState());

+		}

+		// Proceed with removal

+		return true;

+	}

+}

diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java
index 195bb5d..763e92f 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2014 IBM Corporation and others.
+ * Copyright (c) 2003, 2016 IBM Corporation and others.
  * 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
@@ -33,6 +33,7 @@
 import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate;
 import org.eclipse.wst.server.core.util.PublishAdapter;
 import org.eclipse.wst.server.ui.DeleteServerDialogExtension;
+import org.eclipse.wst.server.ui.RemoveModuleMessageExtension;
 import org.eclipse.wst.server.ui.editor.ServerEditorOverviewPageModifier;
 import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
 import org.eclipse.wst.server.ui.internal.editor.IServerEditorInput;
@@ -90,6 +91,9 @@
 	// Cached copy of all delete dialog UI modifier
 	private static List<DeleteServerDialogExtension> deleteServerDialogExtensions;
 	
+	// Cached copy of all the remove module message customization extensions
+	private static List<RemoveModuleMessageExtension> removeModuleMessageExtensions;
+	
 	// Cached copy of server state label provider
 	private static HashMap<String,AbstractServerLabelProvider> serverLabelProviders;
 	// Create a default server state label provider
@@ -864,6 +868,17 @@
 
 		return deleteServerDialogExtensions;
 	}
+	
+	/**
+	 * Returns the list of remove module message confirmation extensions
+	 * @return the list of remove module message confirmation extensions, or an empty list if none could be found
+	 */
+	public static List<RemoveModuleMessageExtension> getRemoveModuleMessageExtensions() {
+		if (removeModuleMessageExtensions == null) {
+		    loadRemoveModuleMessageExtensions();
+		}
+		return removeModuleMessageExtensions;
+	}
 
 	/**
 	 * Load the Server creation wizard page modifiers.
@@ -981,6 +996,49 @@
 	}
 	
 	/**
+	 * Load the remove module message customization extensions.
+	 */
+	private static synchronized void loadRemoveModuleMessageExtensions() {
+		if (removeModuleMessageExtensions != null)
+			return;
+		
+		if (Trace.CONFIG) {
+			Trace.trace(Trace.STRING_CONFIG, "->- Loading .removeModuleMessageExtensions extension point ->-");
+		}
+		removeModuleMessageExtensions = new ArrayList<RemoveModuleMessageExtension>();
+		IExtensionRegistry registry = Platform.getExtensionRegistry();
+		IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "removeModuleMessageExtension");
+		
+		for (IConfigurationElement curConfigElement: cf) {
+			try {
+				RemoveModuleMessageExtension curExtension = (RemoveModuleMessageExtension)curConfigElement.createExecutableExtension("class");
+				String serverTypeId = curConfigElement.getAttribute("serverTypeId");
+				if (serverTypeId != null) {
+					curExtension.setServerTypeId(serverTypeId);
+				}
+				
+				if (Trace.CONFIG) {
+					Trace.trace(Trace.STRING_CONFIG,
+							"  Loaded .removeModuleMessageExtension: " + curConfigElement.getAttribute("id")
+									+ ", loaded class=" + curExtension);
+				}
+				if (curExtension != null)
+					removeModuleMessageExtensions.add(curExtension);
+
+			} catch (Throwable t) {
+				if (Trace.SEVERE) {
+					Trace.trace(Trace.STRING_SEVERE,
+							"  Could not load .removeModuleMessageExtension: " + curConfigElement.getAttribute("id"), t);
+				}
+			}
+		}
+		
+		if (Trace.CONFIG) {
+			Trace.trace(Trace.STRING_CONFIG, "-<- Done loading .removeModuleMessageExtension extension point -<-");
+		}
+	}
+	
+	/**
 	 * Load the Server Label Providers. If there is two implemented for a ServerType the adopters ServerLabelProviders
 	 * will be ignored an a default will be returned
 	 */
@@ -1256,4 +1314,21 @@
 		list.toArray(o);
 		return o;
 	}
+	
+	public static RemoveModuleMessageExtension getRemoveModuleMessageExtension(String targetServerTypeId) {
+		List<RemoveModuleMessageExtension> extensions = getRemoveModuleMessageExtensions();
+		for (RemoveModuleMessageExtension messageExtension : extensions) {
+			String serverTypeId = messageExtension.getServerTypeId();
+			// regex support serverTypeIdValue.* and also support serverTypeIdValue* 
+			if (serverTypeId != null) {
+				int length = serverTypeId.length();
+				if (serverTypeId.equals(targetServerTypeId) || targetServerTypeId.matches(serverTypeId)
+					|| (serverTypeId.endsWith("*") && length > 1 && targetServerTypeId.startsWith(serverTypeId.substring(0, length - 1)))) {
+					// We found the extension for this server type
+					return messageExtension;
+				}
+			}
+		}
+		return null;
+	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java
index 6234e5b..6e854f6 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java
@@ -33,6 +33,7 @@
 	private static final String PREF_EXT_ADAPTER = "external-adapter";
 	private static final String PREF_CACHE_FREQUENCY = "cache-frequency";
 	private static final String PREF_CACHE_LAST_UPDATED_DATE = "cache-lastUpdatedDate";
+	private static final String PREF_DO_NOT_SHOW_REMOVE_MODULE_WARNING = "do-not-show-remove-module-warning";
 
 	public static final byte SAVE_EDITORS_ALWAYS = 2;
 	public static final byte SAVE_EDITORS_NEVER = 0;
@@ -88,6 +89,7 @@
 		preferences.setDefault(PREF_PUBLISH_ON_ADD_REMOVE, true);
 		preferences.setDefault(PREF_EXT_ADAPTER, true);
 		preferences.setDefault(PREF_CACHE_FREQUENCY, 2);
+		preferences.setDefault(PREF_DO_NOT_SHOW_REMOVE_MODULE_WARNING, false);
 	}
 
 	/**
@@ -434,4 +436,24 @@
 		preferences.setValue(PREF_CACHE_FREQUENCY, frequency);
 		ServerUIPlugin.getInstance().savePluginPreferences();
 	}
+	
+	/**
+	 * Returns the option to show the warning dialog if a module or modules are to be removed from the server.
+	 * 
+	 * @return boolean - false: will show the dialog; true: will not show the dialog
+	 */
+	public boolean getDoNotShowRemoveModuleWarning() {
+		return preferences.getBoolean(PREF_DO_NOT_SHOW_REMOVE_MODULE_WARNING);
+	}
+
+	/**
+	 * Sets the preference to show whether the warning dialog will appear or not when a module or modules are to
+	 * be removed from the server
+	 * 
+	 * @param b - false: will show the dialog; true: will not show the dialog
+	 */
+	public void setDoNotShowRemoveModuleWarning(boolean b) {
+		preferences.setValue(PREF_DO_NOT_SHOW_REMOVE_MODULE_WARNING, b);
+		ServerUIPlugin.getInstance().savePluginPreferences();
+	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RemoveModuleAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RemoveModuleAction.java
index c44dbd1..e1250ed 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RemoveModuleAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RemoveModuleAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 IBM Corporation and others.
  * 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
@@ -10,11 +10,12 @@
  *******************************************************************************/
 package org.eclipse.wst.server.ui.internal.view.servers;
 
+import java.util.Arrays;
+
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.widgets.Shell;
@@ -25,6 +26,7 @@
 import org.eclipse.wst.server.core.IServer;
 import org.eclipse.wst.server.core.IServerWorkingCopy;
 import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.PreferenceUtil;
 import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
 import org.eclipse.wst.server.ui.internal.Trace;
 /**
@@ -69,9 +71,8 @@
 	 * Invoked when an action occurs. 
 	 */
 	public void run() {
-		String message = module.length == 1 ? Messages.dialogRemoveModuleConfirm : Messages.dialogRemoveModulesConfirm;
-		if (MessageDialog.openConfirm(shell, Messages.defaultDialogTitle, message)) {
-			removeModules(module);  
+		if (PreferenceUtil.confirmModuleRemoval(server, shell, Arrays.asList(module))) {
+			removeModules(module);
 		}
 	}
 	
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ModifyModulesWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ModifyModulesWizard.java
index 9cdc191..07c438d 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ModifyModulesWizard.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ModifyModulesWizard.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2016 IBM Corporation and others.
  * 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
@@ -17,6 +17,7 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.wst.server.core.*;
 import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.PreferenceUtil;
 import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
 import org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment;
 import org.eclipse.wst.server.ui.wizard.WizardFragment;
@@ -24,9 +25,11 @@
  * A wizard used to add and remove modules.
  */
 public class ModifyModulesWizard extends TaskWizard {
+	static ModifyModulesWizardFragment modifyModulesWizardFragment = new ModifyModulesWizardFragment(true);
+	
 	static class ModifyModulesWizard2 extends WizardFragment {
 		protected void createChildFragments(List<WizardFragment> list) {
-			list.add(new ModifyModulesWizardFragment(true));
+			list.add(modifyModulesWizardFragment);
 			list.add(WizardTaskUtil.SaveServerFragment);
 			
 			list.add(new WizardFragment() {
@@ -63,4 +66,26 @@
 		if (server != null)
 			getTaskModel().putObject(TaskModel.TASK_SERVER, server.createWorkingCopy());
 	}
+	
+	/**
+	 * This is not intended to be used by extenders.  The prompt to remove modules dialog appears there are modules to be removed.
+	 * 
+	 */
+	@Override
+	public boolean performFinish() {
+		// This code should instead be done in the ModifyModulesWizardFragment.  However, we need to do this prompt up-front
+		// prior to any fragments being executed in another thread.  If this prompt is moved to the fragment, then we need a 
+		// a way to get access to the UI shell even though the fragments are run on a non-UI thread.  Secondly, the TaskWizard
+		// needs to support cancel to undo previously run fragments and stop later fragments from running.  This is because the\
+		// prompt dialog allows the user to cancel.   See also RunOnServerWizard.
+		List<IModule> modulesToRemove = modifyModulesWizardFragment.getModulesToRemove();
+		if (modulesToRemove.size() > 0) {
+			IServerAttributes server = (IServerAttributes) getTaskModel().getObject(TaskModel.TASK_SERVER);
+			boolean doRemove = PreferenceUtil.confirmModuleRemoval(server, getContainer().getShell(), modulesToRemove);
+			if (!doRemove) {
+				return false;
+			}
+		}
+		return super.performFinish();
+	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/RunOnServerWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/RunOnServerWizard.java
index c74e13f..383f7a4 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/RunOnServerWizard.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/RunOnServerWizard.java
@@ -11,12 +11,14 @@
 package org.eclipse.wst.server.ui.internal.wizard;
 
 import java.util.HashMap;
+import java.util.List;
 
 import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.wst.server.core.*;
 import org.eclipse.wst.server.core.internal.IClient;
 import org.eclipse.wst.server.core.internal.ILaunchableAdapter;
 import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.PreferenceUtil;
 import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
 import org.eclipse.wst.server.ui.internal.wizard.fragment.RunOnServerWizardFragment;
 /**
@@ -24,6 +26,7 @@
  */
 public class RunOnServerWizard extends TaskWizard {
 	
+	private static RunOnServerWizardFragment fragment;
 	/**
 	 * RunOnServerWizard constructor comment.
 	 * 
@@ -57,13 +60,13 @@
 	}
 
 	private static RunOnServerWizardFragment createRootWizard(IModule module, String launchMode, IModuleArtifact moduleArtifact, HashMap properties){
-		RunOnServerWizardFragment fragment = new RunOnServerWizardFragment(module, launchMode, moduleArtifact);
+		fragment = new RunOnServerWizardFragment(module, launchMode, moduleArtifact);
 		setFragmentProperties(fragment, properties);
 		return fragment;
 	}
 	
 	private static RunOnServerWizardFragment createRootWizard	(IServer server, String launchMode, IModuleArtifact moduleArtifact,HashMap properties) {
-		RunOnServerWizardFragment fragment = new RunOnServerWizardFragment(server, launchMode, moduleArtifact);
+		fragment = new RunOnServerWizardFragment(server, launchMode, moduleArtifact);
 		setFragmentProperties(fragment, properties);		
 		return fragment;
 	}
@@ -196,4 +199,26 @@
 			return false;
 		}
 	}
+	
+	/**
+	 * This is not intended to be used by extenders.  The prompt to remove modules dialog appears there are modules to be removed.
+	 * 
+	 */
+	@Override
+	public boolean performFinish() {
+		// This code should instead be done in the RunOnServerWizardFragment.  However, we need to do this prompt up-front
+		// prior to any fragments being executed in another thread.  If this prompt is moved to the fragment, then we need a 
+		// a way to get access to the UI shell even though the fragments are run on a non-UI thread.  Secondly, the TaskWizard
+		// needs to support cancel to undo previously run fragments and stop later fragments from running.  This is because the
+		// prompt dialog allows the user to cancel.  See also ModifyModulesWizard.
+		List<IModule> modulesToRemove = fragment.getModulesToRemove();
+		if (modulesToRemove.size() > 0) {
+			IServerAttributes server = (IServerAttributes) getTaskModel().getObject(TaskModel.TASK_SERVER);
+			boolean doRemove = PreferenceUtil.confirmModuleRemoval(server, getContainer().getShell(), modulesToRemove);
+			if (!doRemove) {
+				return false;
+			}
+		}
+		return super.performFinish();
+	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
index b497684..cc395bd 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2016 IBM Corporation and others.
  * 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
@@ -127,6 +127,14 @@
 		
 		return true;
 	}
+	
+	/**
+	 * Expose this to wizard.  For internal use.  Extenders are not expected to override or call.
+	 * @return
+	 */
+	public List<IModule> getModulesToRemove() {
+		return comp.getModulesToRemove();
+	}
 
 	public void performFinish(IProgressMonitor monitor) throws CoreException {
 		if (comp != null) {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/RunOnServerWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/RunOnServerWizardFragment.java
index 11ea6c6..f4ea710 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/RunOnServerWizardFragment.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/RunOnServerWizardFragment.java
@@ -10,6 +10,7 @@
  *******************************************************************************/
 package org.eclipse.wst.server.ui.internal.wizard.fragment;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.wst.server.core.IModule;
@@ -29,6 +30,8 @@
 	
 	protected IClient client;
 	protected ILaunchableAdapter launchable;
+	
+	private ModifyModulesWizardFragment modifyModulesWizardFragment;
 
 	/**
 	 * Create the Run on Server wizard with all pages.
@@ -62,8 +65,8 @@
 			
 			list.add(WizardTaskUtil.TempSaveRuntimeFragment);
 			list.add(WizardTaskUtil.TempSaveServerFragment);
-			
-			list.add(new ModifyModulesWizardFragment(module));
+			modifyModulesWizardFragment = new ModifyModulesWizardFragment(module);
+			list.add(modifyModulesWizardFragment);
 		}
 		
 		list.add(new TasksWizardFragment());
@@ -84,4 +87,15 @@
 	public void setLaunchable(ILaunchableAdapter launchable) {
 		this.launchable = launchable;	
 	}
+	
+	/**
+	 * Expose this to wizard.  For internal use.  Extenders are not expected to override or call.
+	 * @return
+	 */
+	public List<IModule> getModulesToRemove() {
+		if (modifyModulesWizardFragment != null) {
+			return modifyModulesWizardFragment.getModulesToRemove();
+		}
+		return new ArrayList<IModule>();
+	}
 }
\ No newline at end of file