presentation.setEnabled(true);
presentation.setVisible(!datasetEditor.isReadonlyData());
if (datasetEditor.isInserting() || datasetEditor.isLoading() || datasetEditor.isReadonly()) {
presentation.setEnabled(false);
} else {
DatasetEditorTable editorTable = datasetEditor.getEditorTable();
int[] selectedrows =
editorTable == null ? null :
editorTable.getSelectedRows();
presentation.setEnabled(selectedrows != null && selectedrows.length == 1 && selectedrows[0] < editorTable.getModel().getSize());
}
}
}