Currently with help of JAVA SWT (org.eclipse.swt.widgets.Table & org.eclipse.jface.viewers.TableViewer library), I have a table which is getting populated from DB. Idea is to refresh the table data while user is scroll down to check the tables row using scroll-bar and let the scroll bar position restore to same point where it was before refresh event. So that user never feel that some refresh event is working in background while he scroll down the data.
Is there any inbuilt method or library exist in jdk or in above eclipse package to get & set the position of scroll-bar dynamically?
I found a logic to get scroll bar position
ScrollBar vScroll = Table.getVerticalBar();
int valuetemp = vScroll.getSelection();
But after refreshing the table content, when scroll-bar moved to very fist entry after that if I use below code to restore the scroll-bar. Ideally it should work as per API but it didn't move my scroll-bar position to the previous value.
vScroll.setSelection(valuetemp);