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
};
	}
	
	private static IEditorPart findEditor(Object element, IEditorPart[] unsavedEditors){
		for (int i= 0; i < unsavedEditors.length; i++) {
			if (EditorUtility.isEditorInput(element, unsavedEditors[i]))
				return unsavedEditors[i];
		}
		return null;
	}
	private static ListSelectionDialog createUnsavedEditorDialog(List unsavedElements) {
		int labelFlags= JavaElementLabelProvider.SHOW_DEFAULT | JavaElementLabelProvider.SHOW_POST_QUALIFIED;
		Shell parent= JavaPlugin.getActiveWorkbenchShell();
		String msg= ReorgMessages.getString("ReorgAction.checkSaveTargets"); 
		ListSelectionDialog dialog= new ListSelectionDialog(parent, unsavedElements, new ListContentProvider(), 
			new JavaElementLabelProvider(labelFlags), msg);
		dialog.setInitialSelections(unsavedElements.toArray());
		return dialog;
	}
	
	private static void collectUnsavedEditors(List elements, List unsavedEditors, List unsavedElements) {
		IEditorPart[] editors= JavaPlugin.getDirtyEditors();
		for (int i= 0; i < editors.length; i++) {
			for (Iterator iter= elements.iterator(); iter.hasNext(); ){
				Object element= iter.next();
				if (EditorUtility.isEditorInput(element, editors[i])) {
					unsavedEditors.add(editors[i]);
					unsavedElements.add(element);
				}
			}