Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Persisting Selection of CheckBoxTreeViewer between sessions(I want to persist the check state of the CheckBoxTreeViewer between the sessions.)
Persisting Selection of CheckBoxTreeViewer between sessions [message #724862] Tue, 13 September 2011 11:25
Vasav Shah is currently offline Vasav ShahFriend
Messages: 1
Registered: September 2011
Junior Member
I want to persist the check state of my CheckBoxTreeViewer elements. I have override the following method.

public void saveState(IMemento memento) {
super.saveState(memento);
ISelection sel = viewer.getSelection();
IStructuredSelection ss = (IStructuredSelection) sel;
StringBuffer buf = new StringBuffer();
for (Iterator it = ss.iterator(); it.hasNext()Wink {
buf.append(it.next());
buf.append(',');
}
memento.putString(STORE_SELECTION, buf.toString());
}


The problem is the line marked in the bold is returning me EMPTY_SELECTION, even though I have some elements checked in my CheckBoxTreeViewer.

I have also override the init method as follows.

public void init(IViewSite site, IMemento memento)
throws PartInitException {
super.init(site, memento);
this.memento = memento;
}


Can anybody help me in resolving this issue? I am using Eclipse 3.2. Please let me know if I am doing anything wrong.

Let me know in case any more information is required.

Thanks!
Vasav
Previous Topic:Call View
Next Topic:increment version number on file/save
Goto Forum:
  


Current Time: Tue Apr 23 09:58:48 GMT 2024

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

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

Back to the top