| [news.eclipse.platform.swt] Re: TableViewer.setSelection() -> update/redraw/layout table |
Hi!
while experimenting with JFace, i extended the TableViewer class and overrode the remove() method like this (this is only for demonstration purposes):
Good because we clearly state that we won't support subclassing :-)
public void remove(Object[] elements) { super.remove(elements); setSelection(new StructuredSelection(getElementAt(0)),true); }
The problem i found here is that the new selection is not shown immediatly. Instead, i have to click in the table or resize the table-window.
I already tried the following (didn't help, though):
getTable().layout(true, true); getTable().getShell().layout(true, true); refresh(true);
A dirty hack did help: ViewerComparator comp = getComparator(); setComparator(null); setComparator(comp);
But obviously, this is not a nice solution.
What am i doing wrong?
Well we simply need a snippet to reproduce the problem.
Tom
[1] http://wiki.eclipse.org/JFaceSnippets