Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364725

Summary: renaming a file collapse the navigator tree
Product: [ECD] Orion Reporter: Felipe Heidrich <eclipse.felipe>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: usability
Version: 0.3   
Target Milestone: 0.5 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Felipe Heidrich CLA 2011-11-24 10:47:03 EST
as the  title says it

it is pretty annoying when you need to rename several files.
Comment 1 Susan McCourt CLA 2011-11-24 11:18:36 EST
right now we just refresh the tree, but we could use the same expansion storing we do for reload.
Comment 2 Susan McCourt CLA 2012-04-23 17:34:31 EDT
fixed.  I had forgotten how bad this was. If you had something like:
Folder1
  Folder2
    Folder3
      Folder4

Then renaming any of these folders would collapse all the way up to Folder1.  

The original problem was that the tree refreshed the entire root.  It was a lazy work around for the fact that expansions are cached by name, so the remembered expansions don't work, and you can't look up a renamed item in the treetable (since the row id's are based on the item name).  So the fix is to refresh using the item's parent so that the child items (including the renamed items) will be updated and thus findable in the tree.  We also remember the expand state of the renamed item if it is a folder, so that we can expand it once we've refreshed its parent and siblings.

So...now you can rename Folder4, Folder3 and the state will remain.  Note that we don't recurse/remember the expansion state any deeper than one level.  So if you rename Folder 2 you end up with
Folder1
  Folder2
    Folder3

Much improved...possibly some context if there were lots of children expanded could be lost, but never again do you lose the item that you actually renamed.