Bug 19372 - Dropping folder into a container with a folder of the same name
Summary: Dropping folder into a container with a folder of the same name
Status: RESOLVED DUPLICATE of bug 29838
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.0 F3   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-05 12:47 EDT by Randy Hudson CLA
Modified: 2003-02-12 13:42 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2002-06-05 12:47:27 EDT
On Windows, File Explorer performs a union when dragging a folder into a 
container with an exising folder of the same name.  Windows will prompt you to 
ask you if you want to replace existing files that have the same name as those 
that you are dragging.  However, it does not replace the existing folder with 
the one being dragged.  The 2 are merged.

Navigator does NOT do this.  It erases the existing folder and uses a prompt 
similar to the one used by Windows.  This is confusing, and can result in 
accidental deletion.  Also, the replace behavior is not as useful as the merge 
behavior.  If I wanted to replace, I could delete the existing folder and then 
drag the new one.  If I want to merge, there is nothing I can currently do.  
Merging is not possible.

Finally, reverting the replace is very cumbersome because Restore from local 
history has no way of performing a select all.
Comment 1 Nick Edgar CLA 2002-06-05 13:47:07 EDT
Which build?  This was supposed to have been fixed.
It's possible it was fixed for Copy/Paste but not for DnD.

Also, Restore from Local should support multi-select.
Comment 2 Randy Hudson CLA 2002-06-05 14:00:26 EDT
F2.  Multi-select does not work in Restore.  Even if it were multi, would SPACE 
toggle the selection of all?
Comment 3 Nick Edgar CLA 2002-06-05 14:08:20 EDT
Please enter a separate PR against Platform-Compare for the multi-select 
problem.
Comment 4 Lynne Kues CLA 2002-06-07 11:19:13 EDT
Copy/Paste and Move from the menu merge.  
Drag Copy creates a copy of the item.
Drag Move does not merge.

[Bug 15894] Move folder overwrites destination - original bug, didn't fix drag 
move.
Comment 5 Nick Edgar CLA 2002-06-07 12:53:09 EDT
DnD should reuse CopyFileAndFoldersOperation and CopyProjectOperation.

Should have the following behaviour for both Copy/Paste and DnD:
- if file copied to same folder (i.e. attempt to overwrite same file), it 
should prompt to give a new name, with the default being "Copy of ..."
- if file copied to a different folder having a file with the same name, should 
prompt whether to overwrite
- when copying or moving folders, merge src and dest, don't overwrite dest

 
Comment 6 Knut Radloff CLA 2002-06-11 10:55:19 EDT
Please post a scenario where moving a folder on top of an existing folder 
overwrites the folder. If I do this a copy of the moved folder is created 
instead of replacing the existing one, as if I had done a drag copy. Opened bug 
19905 for this.
Will fix drag copy to do the same as copy/paste (CopyFilesAndFolderOperation). 
CopyProject does not apply since projects can't be drag copied.
Comment 7 Randy Hudson CLA 2002-06-11 11:22:07 EDT
JDT Package viewer will cause an Overwrite.
Knut, not that you've opened a separate bug for "Copy of" being prepended, 
should we move this to JDT UI?  Package viewer is not consistent with Navigator.
Comment 8 Randy Hudson CLA 2002-06-11 11:23:24 EDT
I guess it was Packages viewer the whole time, and not Navigator.  But at least 
we found a related Navigator bug <g>.
Comment 9 Knut Radloff CLA 2002-06-11 11:50:07 EDT
I think Lynne at some point did reproduce that drag move does replace. We just 
haven't been able to reproduce this again.
Also, I need to make drag copy consistent with copy/paste.
Please open a separate JDT PR for making the package viewer consistent with the 
new Navigator copy/paste and copy/move behavior and assume that drag copy and 
drag move will at some point behave like the clipboard based operations.
Comment 10 Knut Radloff CLA 2002-06-11 12:59:05 EDT
Based on the code in NavigatorDropAdapter it is impossible to overwrite the 
destination during a drag move operation if it already exists. The could will 
always fall back to create a "Copy of" the moved resource.
Comment 11 Knut Radloff CLA 2002-06-11 15:38:04 EDT
Drag copy now works like clipboard based copy.
Note however that clipboard copy/paste does not preset the rename dialog 
to "Copy of xyz" but just "xyz". Please open a separate PR if the preset should 
be changed for both operations.
Comment 12 Knut Radloff CLA 2002-06-11 16:29:18 EDT
Changes to NavigatorDropAdapter reviewed by Lynne.
Released changes.
Comment 13 Randy Hudson CLA 2003-02-12 12:23:51 EST
Not working in M5.  If I drag a regular folder into a src folder in the 
packages view, it replaces the entire contents instead of performing a merge.

Test case:
+org.eclipse.jdt.ui
 +src-jdt
  +org
   +eclipse
     ....
 +patch
  +org
   +eclipse
    ...

I dragged the "org" folder from the patch directory into the src-jdt folder.  
All of JDT's files were replaces with the one .java file in my patch folder.
Comment 14 Dirk Baeumer CLA 2003-02-12 13:42:59 EST

*** This bug has been marked as a duplicate of 29838 ***