Bug 323951 - Git Repo view should remember its state (expanded nodes)
Summary: Git Repo view should remember its state (expanded nodes)
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 0.9.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2010-08-30 06:55 EDT by Benjamin Muskalla CLA
Modified: 2013-09-27 11:43 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Muskalla CLA 2010-08-30 06:55:48 EDT
Currently the git repo view starts in a fresh state after the workbench start. I find myself opening up several tree items after each start/restart (eg. local branches). We should remember the state of the view to restore it after the workbench start.
Comment 1 Mathias Kinzler CLA 2010-10-13 04:47:06 EDT
I would agree that this would be nice to have, but am not sure if this is compliant with the Eclipse look and feel... For example, the project explorer tree also does not keep track of it's expansion state, and I don't know other trees that do.

Remy, I would appreciate your opinion here.

Aside from that, while the init/saveState method pair allows to store the expansion state, I don't know a clever way to serialize/deserialize the expansion state of a tree. Am I missing something here?
Comment 2 Remy Suen CLA 2010-10-13 06:24:29 EDT
(In reply to comment #1)
> For example, the project explorer
> tree also does not keep track of it's expansion state, and I don't know other
> trees that do.

Yes, this is most definitely not a common feature seen in the Eclipse SDK as far as I know. Mylyn does this of course but they're a different can of worms entirely. I am not implying that there is no value in this request though.

> Aside from that, while the init/saveState method pair allows to store the
> expansion state, I don't know a clever way to serialize/deserialize the
> expansion state of a tree. Am I missing something here?

No, I don't personally know of any APIs in the platform that would allow you to preserve the state easily. Perhaps this might be part of the reason why nobody actually does this. The other reason might be that drilling down trees is a potentially expensive operation since you are actively querying and creating "all" the tree items instead of letting JFace generate them as the user clicks on them.