Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Persist selection on tree viewer on restart of application using memento( Persist selection on tree viewer on restart of application using memento )
Persist selection on tree viewer on restart of application using memento [message #1275666] Sun, 23 March 2014 08:08 Go to next message
Eclipse UserFriend
am using memento for persisting views.
I am not able to persist selection on tree viewer I have the following code in save state


IStructuredSelection selection = (IStructuredSelection) viewer.getSelection()
Then I am storing this as selection.toString in memento



While restoring
IMemento storedSelection = memento.getChild("StoredSelection");
viewer.setSelection(new structured selection (selection) );

When setting selection on tree viewer I am getting proper value
but in selection change event it is telling empty selection due to which no selection is retained on tree


I am right now trying for single selection of tree
I would like to do tdo for multiple selections also

Please provide working sample code
Re: Persist selection on tree viewer on restart of application using memento [message #1313377 is a reply to message #1275666] Thu, 24 April 2014 17:29 Go to previous message
Eclipse UserFriend
You have to also save and restore the collapsed state of your tree. Furthermore, the saved selection is no longer the object that is in the new tree.
Previous Topic:Add button to Console toolbar
Next Topic:e4 Luna and 3.x RCP Migrations
Goto Forum:
  


Current Time: Sat Jul 05 05:56:24 EDT 2025

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

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

Back to the top