Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369738 - [General]Support tree model iteration/navigation.
Summary: [General]Support tree model iteration/navigation.
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.4 RC1   Edit
Assignee: libing wang CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 369741 370485
  Show dependency tree
 
Reported: 2012-01-25 15:36 EST by libing wang CLA
Modified: 2012-02-02 14:40 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 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.