Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Scroll problem (Scroll problem in nattable)
Scroll problem [message #915996] Tue, 18 September 2012 07:31 Go to next message
dhruba kumar is currently offline dhruba kumar
Messages: 40
Registered: September 2012
Member
I am creating EDITOR.

In this editor, two nattables are in adjacent position.

Now when I click any row/cell of any one of the nattable ,the row other table is got selected. Also if I scroll (Vertical ScrollBar) one table,other table is automatically scrolled ,but we found, sometimes this automatic scroll is not working properly,during scroll the row number showing in one table may differ with the row number with second table.
I ve used this for synchronization of this scroll:

Suppose I have two table leftnatTable and rightnatTable

Suppose I have two table leftnatTable and rightnatTable

leftnatTable.addListener(SWT.Selection, new VerticalScrollBarHandler(leftbuilder.getBodyLayerStack().getViewportLayer(),leftnatTable.getVerticalBar())
{
public void handleEvent(Event event)
{
if(leftnatTable.getVerticalBar().getSelection()!=rightnatTable.getVerticalBar().getSelection())
{
rightnatTable.getVerticalBar().setSelection(leftnatTable.getVerticalBar().getSelection());
rightnatTable.getVerticalBar().notifyListeners(SWT.Selection, new Event());


}
}
});



rightnatTable.addListener(SWT.Selection, new VerticalScrollBarHandler(rightbuilder.getBodyLayerStack().getViewportLayer(),rightnatTable.getVerticalBar())
{
public void handleEvent(Event event)
{
if(leftnatTable.getVerticalBar().getSelection()!=rightnatTable.getVerticalBar().getSelection())
{
leftnatTable.getVerticalBar().setSelection(rightnatTable.getVerticalBar().getSelection());
leftnatTable.getVerticalBar().notifyListeners(SWT.Selection, new Event());

}
}
});

Please help me in Scroll Sync of thiese tables.
Re: Scroll problem [message #916935 is a reply to message #915996] Wed, 19 September 2012 12:58 Go to previous messageGo to next message
dhruba kumar is currently offline dhruba kumar
Messages: 40
Registered: September 2012
Member
Hi in win vista its working fine ,in winxp it may behave in correctly
Re: Scroll problem [message #991265 is a reply to message #916935] Tue, 18 December 2012 04:13 Go to previous message
jim liu is currently offline jim liu
Messages: 37
Registered: February 2011
Location: shanghai
Member
Thanks for your code,it works in win7

java eclipse Search
http://javafind.appspot.com/
Previous Topic:Add checkboxes to the row column?
Next Topic:Column width and column resizing
Goto Forum:
  


Current Time: Wed Aug 20 00:52:16 EDT 2014

Powered by FUDForum. Page generated in 0.05485 seconds