Instances of this class implement a selectable user interface
object that displays a list of images and strings and issues
notification when selected.
The item children that may be added to instances of this class
must be of type TableItem.
Style VIRTUAL is used to create a Table whose
TableItems are to be populated by the client on an on-demand basis
instead of up-front. This can provide significant performance improvements for
tables that are very large or for which TableItem population is
expensive (for example, retrieving values from an external source).
Here is an example of using a Table with style VIRTUAL:
final Table table = new Table (parent, SWT.VIRTUAL | SWT.BORDER);
table.setItemCount (1000000);
table.addListener (SWT.SetData, new Listener () {
public void handleEvent (Event event) {
TableItem item = (TableItem) event.item;
int index = table.indexOf (item);
item.setText ("Item " + index);
System.out.println (item.getText ());
}
});
Note that although this class is a subclass of Composite,
it does not make sense to add Control children to it,
or set a layout on it.
Styles:
SINGLE, MULTI, CHECK, FULL_SELECTION, HIDE_SELECTION, VIRTUAL
The item children that may be added to instances of this class must be of type
TableItem.Style
VIRTUALis used to create aTablewhoseTableItems are to be populated by the client on an on-demand basis instead of up-front. This can provide significant performance improvements for tables that are very large or for whichTableItempopulation is expensive (for example, retrieving values from an external source).Here is an example of using a
Tablewith styleVIRTUAL:final Table table = new Table (parent, SWT.VIRTUAL | SWT.BORDER); table.setItemCount (1000000); table.addListener (SWT.SetData, new Listener () { public void handleEvent (Event event) { TableItem item = (TableItem) event.item; int index = table.indexOf (item); item.setText ("Item " + index); System.out.println (item.getText ()); } });Note that although this class is a subclass of
Composite, it does not make sense to addControlchildren to it, or set a layout on it.Note: Only one of the styles SINGLE, and MULTI may be specified.
IMPORTANT: This class is not intended to be subclassed.