Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to 'remember' current position in the treeviewer
How to 'remember' current position in the treeviewer [message #141757] Thu, 09 October 2003 10:03 Go to next message
Eclipse UserFriend
Originally posted by: lfu.site.uottawa.ca

Hi,

I have a treeviewer to display a long list of tree objects. When the
platform starts again, I would like to the treeviewer to scroll to the last
position(or page) the user has worked, so that giving the user the feeling
that the system has exactly load last state. Is there a way to do that?

Thanks

Eric
Re: How to 'remember' current position in the treeviewer [message #141856 is a reply to message #141757] Thu, 09 October 2003 12:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO--SPAM.us.ibm.com

When your workbench is shutdown, each view is called with the
saveState(IMemento). You should implement this (ViewPart, which should
be a super type in your hierarchy, implements this as a do nothing).

In there you save your state in the memento, then when the workbench is
restarted with init(IViewSite, IMemento) with the memento that you
saved. There you restore your state.

This is only called on workbench shutdown, it is NOT called if the view
was explicitly closed but workbench is still running.

Rich
Re: How to 'remember' current position in the treeviewer [message #141908 is a reply to message #141856] Thu, 09 October 2003 15:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lfu.site.uottawa.ca

Thank you, Richard. It's a good thing to save it in IMemento, but my tree is
too big to be saved. Furthermore, if the platform is not shut down and the
tree is refreshed(some nodes added or removed), do I have any way to
remember current position and scroll back.

Eric

"Richard L. Kulp" <richkulp@NO--SPAM.us.ibm.com> wrote in message
news:bm41tt$nsn$1@eclipse.org...
> When your workbench is shutdown, each view is called with the
> saveState(IMemento). You should implement this (ViewPart, which should
> be a super type in your hierarchy, implements this as a do nothing).
>
> In there you save your state in the memento, then when the workbench is
> restarted with init(IViewSite, IMemento) with the memento that you
> saved. There you restore your state.
>
> This is only called on workbench shutdown, it is NOT called if the view
> was explicitly closed but workbench is still running.
>
> Rich
>
Re: How to 'remember' current position in the treeviewer [message #141924 is a reply to message #141908] Thu, 09 October 2003 16:22 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO--SPAM.us.ibm.com

First you don't need to save the entire tree. Just what was last selected.

AS for the second, no, the memento is only on shutdown, not for crash.

Rich
Previous Topic:confused about ja packager
Next Topic:how can i find the system measurement setting?
Goto Forum:
  


Current Time: Fri May 09 16:53:55 EDT 2025

Powered by FUDForum. Page generated in 0.03331 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top