Bug 3926 issue copying file with duplicate name (1GF60YK)
I tried to copy a package.html file from one package to another using the "copy" menu entry in the packages view. The destination package already had a file called package.html so I was presented with a "Duplicate names" dialog. The dialog has two radio buttons, one for "replace element" and one for "rename to". Issues: - The replace button is grayed out - "Rename to" is ambiguous. Am I renaming the thing being copied or the file already at the destination. Since I actually wanted to overwrite the file and the rename renames the file being copied, I could not accomplish the task. Note that the copy action from the navigator works as desired. NOTES: KH (6/12/2001 7:11:31 AM) Moving to JUI for comment.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
dialog.setSize(60, 18);
		dialog.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()));
		dialog.setInitialSelection(computeCommonParent(refactoring.getElementsToReorg()));
		
		if (dialog.open() != dialog.CANCEL)
			return dialog.getFirstResult();
		return null;
	}
		
	ElementTreeSelectionDialog createDestinationSelectionDialog(Shell parent, ILabelProvider labelProvider, JavaElementContentProvider cp, ReorgRefactoring refactoring){
		return new ElementTreeSelectionDialog(parent, labelProvider, cp);
	}
	
	private static Object computeCommonParent(List elements){
		if (elements.isEmpty())
			return null;
		Object parent= elements.get(0);
		for (Iterator iter= elements.iterator(); iter.hasNext(); ){
			parent= computeCommonParent(parent, iter.next());
		}
		IResource parentRes= getResource(parent);
		IJavaElement parentElement= JavaCore.create(parentRes);
		if (parentElement != null)
			return parentElement;
		return getResource(parent);	
	}
	
	private static Object computeCommonParent(Object e1, Object e2){
		IResource r1= getResource(e1);
		IResource r2= getResource(e2);