我认为解决方案就像那个答案
Delete rows from Nattable
但我无法编辑doCommand
为需要插入的对象添加一个参数,因为doCommand
是一种覆盖方法
public boolean doCommand(ILayer targetLayer, AddRowCommand command) {
//convert the transported position to the target layer
if (command.convertToTargetLayer(targetLayer)) {
//remove the element
this.bodyData.remove(command.getRowPosition());
//fire the event to refresh
targetLayer.fireLayerEvent(new RowInsertEvent(targetLayer, command.getRowPosition()));
return true;
}
return false;
}
答案 0 :(得分:0)
您不必修改doCommand()。您需要修改AddRowCommand以传输要添加的对象。