}
public void duplicateRecord(int rowIndex) {
DatasetEditorTable editorTable = getEditorTable();
if (editorTable != null) {
DBDataset dataset = getDataset();
try {
editorTable.stopCellEditing();
int insertIndex = rowIndex + 1;
resultSet.moveToInsertRow();
DatasetEditorModelRow oldRow = getRowAtIndex(rowIndex);
DatasetEditorModelRow newRow = createRow(getRowCount() + 1);
newRow.setInsert(true);
newRow.updateDataFromRow(oldRow);
addRowAtIndex(insertIndex, newRow);
notifyRowsInserted(insertIndex, insertIndex);
editorTable.selectCell(insertIndex, editorTable.getSelectedColumn());
isInserting = true;
if (dataset != null) {
getConnectionHandler().notifyChanges(dataset.getVirtualFile());
}
} catch (SQLException e) {
if (dataset != null) {
MessageUtil.showErrorDialog("Could not duplicate record in " + dataset.getQualifiedNameWithType() + ".", e);
}
}
}
}