我认为解决方案将类似于
从 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;
}