Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Refresh TreeViewer with attached ViewerFilter
Refresh TreeViewer with attached ViewerFilter [message #516859] Thu, 25 February 2010 11:48 Go to next message
Jens Mayer is currently offline Jens MayerFriend
Messages: 19
Registered: September 2009
Location: Hamburg
Junior Member
Hi,

I'm using a TreeViewer with a ViewerFilter. The ViewerFilter holds a Set of Nodes. Only nodes contained in this Set should be displayed by the TreeViewer.

The implementation of select is sort of:

public boolean select(Viewer viewer, Object parentElement, Object element) {
    return setWithNodesToBeDisplayed.contains(element);
}


Works fine until I change the content of the Set and call viewer.refresh(): the ViewerFilter is not called by the TreeViewer to check the domain objects against the filter.

The viewer.update(...)-methods will do this but then I have to pass the underlying domainobjects which are affected by the filter. So I have to traverse the domain-model for myself calling update(actualNode,true).

Am I missing something or is there a more efficient approach to handle the problem ? Why isn't ViewerFilter.select() called by viewer.refresh()?

Thanks in advance,

Jens

I
Re: Refresh TreeViewer with attached ViewerFilter [message #516956 is a reply to message #516859] Thu, 25 February 2010 15:29 Go to previous message
Jens Mayer is currently offline Jens MayerFriend
Messages: 19
Registered: September 2009
Location: Hamburg
Junior Member
Oops - forget it, folks.

There was an issue with the compareTo()-implementation of my invisible rootNode. That leaded to an unsuccessful call of internalFindItem().

Embarrassed

I fixed the bug and now the tree is perfectly filtered...

greets Jens
Previous Topic:[Databinding] Transform Boolean value bound to checkbox control into string and save it as a map val
Next Topic:Contextual Menu visibility
Goto Forum:
  


Current Time: Tue Mar 19 09:34:41 GMT 2024

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

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

Back to the top