How to 'remember' current position in the treeviewer [message #141757] |
Thu, 09 October 2003 10:03  |
Eclipse User |
|
|
|
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 #141908 is a reply to message #141856] |
Thu, 09 October 2003 15:49   |
Eclipse User |
|
|
|
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
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03331 seconds