Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] lazy loading for table

Title: RE: [platform-swt-dev] lazy loading for table

It seems that there is no direct way to know which lines are visible in a Table.

I found a trick, not yet implemented :-(
But you can try it.

It is possible to know which is the first visible line of your table: using getTopIndex()  // I tested it
It is possible to estimate the number of visible line : getSize().x / getItemHeight()   // not tested, try it

It is possible to know when the user scroll the table // getVerticalBar().addSelectionListener (inherited from Scrollable). // tested in WinXP

So.

1) Determine how many line your table has.
2) Create an empty TableItem for each line (Yes, it's a problem when you have a million items, but you can try the standard table lazy loading)

3) When the visible items change (spying event for resize + scrollbar + table made visible + I don't know what).
    Compute which items are visible. Calculate their values (I suppose it's not quick, that's why
    you don't want to do it until really visible). Set the value in the TableItem.

That's it (after two days of coding and testing?).

I would be pleased to know if it works or not.

Emmanuel Castro


 ATTENTION Le message contenu dans cet email ainsi que dans tout fichier attaché est destiné exclusivement aux personnes dont le nom figure ci-dessus. Il peut contenir des informations confidentielles ou protégées par le secret professionnel et dont la divulgation est strictement prohibée. Si vous avez reçu cet email par erreur,détruisez-en le contenu. Vous n'êtes pas autorisé, dans cette hypothèse, à copier, distribuer ou conserver ce message. Merci.

WARNING This information in this mail and in any attachments is intended for the above-mentioned addressees only. It may contain privileged or confidential informationthe review, dissemination or disclosure of which is strictly prohibited. If you have received this email by error, please destroy it. In this case, you are not authorisedto disclose, copy, distribute, or retain this message or any part of it. Thank you.


Back to the top