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

Bug 369738

Summary: [General]Support tree model iteration/navigation.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, susan
Version: 0.4   
Target Milestone: 0.4 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 369741, 370485    

Description libing wang CLA 2012-01-25 15:36:39 EST
While I am testing search features today, I found something that might be generic to all of our tree models in *explorer and *renderer.
Let me take search result as example.
In search result page, you can navigate/iterate all the files/matches by previous/next action.
When your "next" action will hit a match that is not expanded, you will have to wait until its parentModel.getChildren() is done.
In the replace preview page, although not implemented yet, you will see the similar thing.

The common thing is that they are all tree model and they have a "cursor" pointing to the "current" node. The prev/next action should just re-point the  cursor in the same way.

I think we need a tree model iterator hooked up to a render that needs such navigation.
In the model iterator we may want to have options like, iterate only leaf nodes(matches) or all nodes(files and matches). We will also allow some callbacks to be passed in, such as "check if a node is valid to be iterated"(stale file).

I will generalize this in a separate js file and use it in result and preview page. We will see how generic it will go.
Comment 1 libing wang CLA 2012-02-01 19:15:38 EST
Fixed with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=db950cccefec9c55a1793ef7ae2c003946fea385.

The search explorer now consumes this iterator.
I think file explorer can also use it for general purpose.