Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT table, scrolling
SWT table, scrolling [message #455661] Thu, 19 May 2005 13:44 Go to next message
mr. burns is currently offline mr. burnsFriend
Messages: 402
Registered: July 2009
Senior Member
Hello,

I have a table filled with 100 records from a mySQL database. Now I want if
one scrolls down and nearly comes to the 100th record automatically 100 more
records will be read from the database and be displayed in the table.
I do not know which event I have to choose to check if one is close to the
100th record on scrolling.

Any idea?

Thanks!
Re: SWT table, scrolling [message #455681 is a reply to message #455661] Thu, 19 May 2005 15:46 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
The way many applications do this is to either use a virtual table (see
SWT.VIRTUAL), fill the table from a background thread or implement a paging
strategy, like a web browser. Trying to do this by tracking the scroll bar
will fail for a bunch of reasons. For example, the native table can move
the scroll bar without issuing notificaiton.

"Mr. Burns" <Mr._Burns@web.de> wrote in message
news:d6i58g$sg3$1@news.eclipse.org...
> Hello,
>
> I have a table filled with 100 records from a mySQL database. Now I want
if
> one scrolls down and nearly comes to the 100th record automatically 100
more
> records will be read from the database and be displayed in the table.
> I do not know which event I have to choose to check if one is close to the
> 100th record on scrolling.
>
> Any idea?
>
> Thanks!
>
>
Re: SWT table, scrolling [message #455842 is a reply to message #455681] Fri, 20 May 2005 07:34 Go to previous messageGo to next message
Yves Harms is currently offline Yves HarmsFriend
Messages: 80
Registered: July 2009
Member
The virtual implementation of tableviewer requests newly displayed rows
row for row (-> one db call for ech row). But you could cache the data
in your contentprovider and fetch 100 rows if a cache miss occurs.
Re: SWT table, scrolling [message #455845 is a reply to message #455842] Fri, 20 May 2005 09:21 Go to previous messageGo to next message
mr. burns is currently offline mr. burnsFriend
Messages: 402
Registered: July 2009
Senior Member
Hello Yves,

Thanks for your reply, but I am new to SWT and tables.
Is it possible, that you can explain it for a beginner also?
Or give a code snippet?

Thanks again!
Re: SWT table, scrolling [message #455857 is a reply to message #455845] Fri, 20 May 2005 15:00 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Here are some snippets on Virtual Table:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet144.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet151.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup


"Mr. Burns" <Mr._Burns@web.de> wrote in message
news:d6kan6$5c1$1@news.eclipse.org...
> Hello Yves,
>
> Thanks for your reply, but I am new to SWT and tables.
> Is it possible, that you can explain it for a beginner also?
> Or give a code snippet?
>
> Thanks again!
>
Previous Topic:StyledText and SWT.FULL_SELECTION?
Next Topic:SWT and JDK 1.5
Goto Forum:
  


Current Time: Thu Apr 25 08:00:46 GMT 2024

Powered by FUDForum. Page generated in 0.02970 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top