[DBE-1038] Allow to edit queries with join in data editor

Merge-request: IJ-MR-162228
Merged-by: Anvar Ramazanov <anvar.ramazanov@jetbrains.com>

GitOrigin-RevId: 5338825fa05ee1e4d02a9c3b3e913ccc37417d26
This commit is contained in:
Anvar Ramazanov
2025-06-06 12:02:07 +00:00
committed by intellij-monorepo-bot
parent 3b27d4eff1
commit 32baa6786f
3 changed files with 3 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ public interface GridDataHookUp<Row, Column> extends MutationSupport<Row, Column
boolean isReadOnly();
default boolean isForSingleSource() { return true; }
void addRequestListener(@NotNull RequestListener<Row, Column> listener, @NotNull Disposable disposable);

View File

@@ -58,6 +58,7 @@ public class AddRowAction extends DumbAwareAction implements GridAction {
boolean canAddRow = grid != null &&
grid.isEditable() &&
grid.isReady() &&
grid.getDataHookup().isForSingleSource() &&
grid.getDataSupport().hasRowMutator() &&
grid.getDataModel(DataAccessType.DATA_WITH_MUTATIONS).getColumnCount() != 0;

View File

@@ -21,7 +21,7 @@ public class DeleteRowsAction extends DeleteActionBase {
@Override
protected boolean isEnabled(@NotNull DataGrid grid) {
GridDataSupport support = grid.getDataSupport();
return !support.isDeletedRows(grid.getSelectionModel().getSelectedRows()) && grid.isEditable();
return !support.isDeletedRows(grid.getSelectionModel().getSelectedRows()) && grid.isEditable() && grid.getDataHookup().isForSingleSource();
}
@Override