[JFace Viewers] Coordinate content provider and viewer filters [message #328289] |
Tue, 20 May 2008 18:23 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
While implementing ITreeContentProvider.hasChildren() I've realized that
there seems to be a gap in the coordination with the ViewerFilters that
have been set on the viewer. In my hasChildren() I can return true if
the model has children, but the filters on the viewer might actually
filter those children out. The result is that the tree gets bogus +
signs next to some nodes because hasChildren() returned true but when
the viewer tries to expand them (in response to the user clicking), they
are empty because the children were all filtered by the ViewerFilter.
Am I missing some framework-supported way to coordinate the two?
Certainly I shouldn't have to embed knowledge of the filters into the
content provider - that would seem to defeat the whole design of
separating the model from the view components.
Any help appreciated,
Eric
|
|
|
Re: [JFace Viewers] Coordinate content provider and viewer filters [message #328290 is a reply to message #328289] |
Tue, 20 May 2008 19:26 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Eric,
I complained about this as well and suggested that when filters are
applied that getChildren be called instead along with filtering to
determine if more than zero children remain. It was suggested that this
would hurt performance, and then someone else suggested it could be made
optional. I can't recall if I opened a bugzilla or not. I don't think
I did...
Eric Rizzo wrote:
> While implementing ITreeContentProvider.hasChildren() I've realized
> that there seems to be a gap in the coordination with the
> ViewerFilters that have been set on the viewer. In my hasChildren() I
> can return true if the model has children, but the filters on the
> viewer might actually filter those children out. The result is that
> the tree gets bogus + signs next to some nodes because hasChildren()
> returned true but when the viewer tries to expand them (in response to
> the user clicking), they are empty because the children were all
> filtered by the ViewerFilter.
>
> Am I missing some framework-supported way to coordinate the two?
> Certainly I shouldn't have to embed knowledge of the filters into the
> content provider - that would seem to defeat the whole design of
> separating the model from the view components.
>
> Any help appreciated,
> Eric
|
|
|
|
Powered by
FUDForum. Page generated in 0.03134 seconds