I have a tableviewer inside a plugin with a view. The tableviewer has 5 columns. I need the data in the rows when I select the row. For example: when I select the row 1, the listener should store in a variable the data for column 1 row 1.
I have used this to get the data in the selected row but it returns the data for the first column only:
table.addListener(SWT.DefaultSelection, new Listener() {
public void handleEvent(Event event) {
TableItem[] selection = table.getSelection();
for (int i = 0; i < selection.length; i++)
{
System.out.println(selection[i].getText());
}
}
});
How to get the data in all the columns of the row?