Reputation: 8358
A user of my program ran into this issue with SWT's virtual tables: If one presses Ctrl+A and Ctrl+C in the table, not all elements will be copied to the clipboard, only the ones that have already been loaded.
This leads to a nasty surprise if the user relies on the false assumption that all table entries have been copied. Is there any reasonable (and if possible, unobtrusive) workaround to deal with this problem?
Upvotes: 0
Views: 230
Reputation: 20985
The SWT Table does not itself support copying its content, that must be part of the application ocde. Therefore I assume that you collect the text of the items (i.e. item.getText()
) and then copy them to the clipboard.
To copy the entire contents of the table you would have to force all items to be materialized, for example by stepwise calling setTopIndex()
, which will likely cause flicker.
I recommend to solve this on the model level. I.e. rewrite the copy code so that it uses the tables underlying data model to collect the necessary information.
Upvotes: 2