@Override public void execute() { draggedResource = project.getResourceList().remove(draggedIndex); int dropIndex; if (row.isEmpty()) { dropIndex = row.getTreeTableView().getRoot().getChildren().size(); } else { dropIndex = row.getIndex(); } project.getResourceList().add(dropIndex, draggedResource); }
@Override public void undo() { project.getResourceList().remove(draggedResource); project.getResourceList().add(draggedIndex, draggedResource); }