Bug 391084: [ltk] "Delete project contents on disk" deletes all contents of the project folder and the folder itself
diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/refactoringui.properties b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/refactoringui.properties
index b919b1f..81aad03 100644
--- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/refactoringui.properties
+++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/refactoringui.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2011 IBM Corporation and others.
+# Copyright (c) 2000, 2012 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
@@ -455,7 +455,7 @@
 
 UseSupertypeWizard_10=No updates are possible for the supertypes
 
-DeleteWizard_1=Confirm Delete
+DeleteWizard_1=Delete
 DeleteWizard_2=An unexpected exception occurred. See the error log for more details.
 DeleteWizard_3=Are you sure you want to delete linked {0}?\nOnly the workspace link will be deleted. Link target will remain unchanged.
 DeleteWizard_4=Are you sure you want to delete {0}?
diff --git a/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.java b/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.java
index 543bf44..d733c3b 100644
--- a/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.java
+++ b/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 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
@@ -100,8 +100,12 @@
 
 	public static String DeleteResourcesProcessor_warning_out_of_sync_container;
 
+	public static String DeleteResourcesProcessor_warning_out_of_sync_container_loc;
+
 	public static String DeleteResourcesProcessor_warning_out_of_sync_file;
 
+	public static String DeleteResourcesProcessor_warning_out_of_sync_file_loc;
+
 	public static String DeleteResourcesProcessor_warning_unsaved_file;
 
 	public static String FileDescription_NewFileProgress;
diff --git a/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.properties b/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.properties
index 9a2d0e9..408d8c2 100644
--- a/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.properties
+++ b/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.properties
@@ -121,8 +121,10 @@
 DeleteResourcesProcessor_description_multi=Delete {0} resources
 DeleteResourcesProcessor_description_single=Delete resource ''{0}''
 DeleteResourcesProcessor_processor_name=Delete Resource
-DeleteResourcesProcessor_warning_out_of_sync_container=''{0}'' contains resources that are not in sync. Press continue to force delete.
-DeleteResourcesProcessor_warning_out_of_sync_file=''{0}'' is not in sync. Press continue to force delete.
+DeleteResourcesProcessor_warning_out_of_sync_container=''{0}'' contains resources that are not in sync. Press ''Continue'' to force delete.
+DeleteResourcesProcessor_warning_out_of_sync_container_loc=''{0}'' contains resources that are not in sync with ''{1}''. Press ''Continue'' to force delete.
+DeleteResourcesProcessor_warning_out_of_sync_file=''{0}'' is not in sync. Press ''Continue'' to force delete.
+DeleteResourcesProcessor_warning_out_of_sync_file_loc=''{0}'' is not in sync with ''{1}''. Press ''Continue'' to force delete.
 DeleteResourcesProcessor_warning_unsaved_file=File ''{0}'' has unsaved changes.
 CreateChangeOperation_unknown_Refactoring=Unknown Refactoring
 FolderDescription_NewFolderProgress=Creating new folder...
diff --git a/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/resource/DeleteResourcesProcessor.java b/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/resource/DeleteResourcesProcessor.java
index ff4873b..505856f 100644
--- a/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/resource/DeleteResourcesProcessor.java
+++ b/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/resource/DeleteResourcesProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2012 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,6 +10,7 @@
  *******************************************************************************/
 package org.eclipse.ltk.internal.core.refactoring.resource;
 
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
 
@@ -125,11 +126,34 @@
 			for (int i= 0; i < fResources.length; i++) {
 				IResource resource= fResources[i];
 				if (!resource.isSynchronized(IResource.DEPTH_INFINITE)) {
-					if (resource instanceof IFile) {
-						result.addInfo(Messages.format(RefactoringCoreMessages.DeleteResourcesProcessor_warning_out_of_sync_file, BasicElementLabels.getPathLabel(resource.getFullPath(), false)));
+					String pathLabel= BasicElementLabels.getPathLabel(resource.getFullPath(), false);
+					
+					String locationLabel= null;
+					IPath location= resource.getLocation();
+					if (location != null) {
+						locationLabel= BasicElementLabels.getPathLabel(location, true);
 					} else {
-						result.addInfo(Messages.format(RefactoringCoreMessages.DeleteResourcesProcessor_warning_out_of_sync_container, BasicElementLabels.getPathLabel(resource.getFullPath(), false)));
+						URI uri= resource.getLocationURI();
+						if (uri != null) {
+							locationLabel= BasicElementLabels.getURLPart(uri.toString());
+						}
 					}
+
+					String warning;
+					if (resource instanceof IFile) {
+						if (locationLabel != null) {
+							warning= Messages.format(RefactoringCoreMessages.DeleteResourcesProcessor_warning_out_of_sync_file_loc, new Object[] { pathLabel, locationLabel });
+						} else {
+							warning= Messages.format(RefactoringCoreMessages.DeleteResourcesProcessor_warning_out_of_sync_file, pathLabel);
+						}
+					} else {
+						if (locationLabel != null) {
+							warning= Messages.format(RefactoringCoreMessages.DeleteResourcesProcessor_warning_out_of_sync_container_loc, new Object[] { pathLabel, locationLabel });
+						} else {
+							warning= Messages.format(RefactoringCoreMessages.DeleteResourcesProcessor_warning_out_of_sync_container, pathLabel);
+						}
+					}
+					result.addWarning(warning);
 				}
 			}
 
diff --git a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringStatusDialog.java b/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringStatusDialog.java
index 56b6d8a..488670b 100644
--- a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringStatusDialog.java
+++ b/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringStatusDialog.java
@@ -21,7 +21,9 @@
 import org.eclipse.swt.widgets.Shell;
 
 import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.DialogSettings;
 import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
 
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 
@@ -60,11 +62,20 @@
 		super.configureShell(newShell);
 		newShell.setText(fWindowTitle);
 	}
+	
+	protected int getDialogBoundsStrategy() {
+		return DIALOG_PERSISTSIZE;
+	}
 
+	protected IDialogSettings getDialogBoundsSettings() {
+		IDialogSettings settings= RefactoringUIPlugin.getDefault().getDialogSettings();
+		return DialogSettings.getOrCreateSection(settings, "RefactoringStatusDialog"); //$NON-NLS-1$
+	}
+	
 	protected Control createDialogArea(Composite parent) {
 		Composite result= (Composite) super.createDialogArea(parent);
 		GridData gd= (GridData) result.getLayoutData();
-		gd.widthHint= 600;
+		gd.widthHint= 800;
 		gd.heightHint= 400;
 
 		if (!fLightWeight) {