[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: Problem inserting an element into a TableViewer with a filter
|
Yes, this is a bug, for which I've filed a PR.
The spec states that the position is relative to the model. As you point
out, however, it can't figure out the correct position in the widget if
items have been filtered out. The only way it could figure it out would be
for the viewer to hang onto the original, pre-filtered list from the model,
but it does not do this: it gets the list from the model, optionally filters
and sorts it, then stuffs the corresponding labels into the underlying table
widget. So about the best it could do currently is to do a full refresh of
the list.
As a workaround for this bug, you could do a refresh() on the table viewer
yourself. Note that this is an O(N) operation, though. So if you're
inserting many items, it would be better to just modify your model, then
issue a single refresh() after all insertions are done.
Nick