Inside an SWT Table I have many TableItems. I want to move one of them from index X to index Y. Is there a way to do that? How?
Thanks.
Inside an SWT Table I have many TableItems. I want to move one of them from index X to index Y. Is there a way to do that? How?
Thanks.
Hi Mario,
I don't think there is a direct method to do this. But as a workaround, try the below method. I have used something similar once.
public void moveTableItem(Table table, int from, int to) {
TableItem item2Move = table.getItem(from);
TableItem newTableItem = new TableItem(table, SWT.NONE, to);
newTableItem.setText(item2Move.getText());
// You may want to clone the entire item here; and not just the text.
// Dispose off, the old item.
item2Move.dispose();
}