TableItemのインデックスを変更するにはどうすればよいですか?
質問
SWTテーブルの内部には、多くのTableItemがあります。 そのうちの1つをインデックスXからインデックスYに移動します。 それを行う方法はありますか?方法は?
ありがとう。
解決
これを行う直接的な方法はないと思います。しかし、回避策として、以下の方法を試してください。似たようなものを一度使用しました。
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();
}
所属していません StackOverflow