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

Bug 411193

Summary: Navigator doesn't refresh after creating initial content in HTML5 file system
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw, simon_kaegi
Version: 3.0Flags: libingw: review+
simon_kaegi: review+
Target Milestone: 3.0 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-06-19 19:35:24 EDT
1. Install HTML5LocalFilePlugin.html
2. Go to Navigator. Expand the left-hand pane if necessary
3. Select the "HTML5 Local File Contents" item
4. Drill into an empty folder (Or, if your HTML5 filesystem is already empty, you can stay at the root). You will see the "Use the [+] to create new files and folders" message
5. Click [+] > New File or New Folder, type a name, click OK

The action works but the nav does not refresh -- you have to manually reload to see that it worked.
Comment 1 Mark Macdonald CLA 2013-06-19 20:01:33 EDT
The File Explorer didn't understand what to do if explorer.changedItem(item) was called when item equal to the root node, so it didn't refresh. When the root changed, you were expected to call explorer.loadResourceList(item) instead. I made this consistent, so a call to changedItem(root) will refresh the root.

This simplified another small piece of code (we no longer need an explicit check to see if loadResourceList() should be called, we can just rely on changedItem() ).

Patch here:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f3b4492
Comment 2 libing wang CLA 2013-06-20 07:42:28 EDT
Tested with patch. The fix is simple and safe. +.
An interesting thing I found for the FileExplorer.prototype.changedItem(parent, forceExpand):
Only the first time when you add file to an empty folder does it pass the parent as root. If you delete the added file(so you've made the folder empty again) and add the file again, it passes the folder as the parent instead of root.
Comment 3 Simon Kaegi CLA 2013-06-20 12:48:22 EDT
pushed