mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
[DataSpell] [DS-7097] Add an ability to unselect the cells in data grid
(cherry picked from commit 2edd8c1385e84fbc9b497519802ca519f185c429) GitOrigin-RevId: c3b1f8172869b00399d751fca20cea3a1e4b02f3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
595a7f661b
commit
200d15fa4f
@@ -46,6 +46,8 @@ public interface SelectionModel<Row, Column> {
|
||||
|
||||
void selectWholeColumn();
|
||||
|
||||
void clearSelection();
|
||||
|
||||
@NotNull
|
||||
ModelIndex<Row> getSelectedRow();
|
||||
|
||||
|
||||
@@ -119,6 +119,10 @@ public final class SelectionModelUtil {
|
||||
public void selectWholeColumn() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSelection() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ModelIndex<GridRow> getSelectedRow() {
|
||||
return ModelIndex.forRow(myGrid, -1);
|
||||
|
||||
@@ -201,6 +201,11 @@ class TableSelectionModel implements SelectionModel<GridRow, GridColumn>, Select
|
||||
myGrid.getAutoscrollLocker().runWithLock(() -> setRowSelectionInterval(myTable.getRowCount() - 1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSelection() {
|
||||
myTable.clearSelection();
|
||||
}
|
||||
|
||||
private void setSelection(boolean columns, int[] array) {
|
||||
if (myTable.isTransposed() && columns || !myTable.isTransposed() && !columns) {
|
||||
setSelection(myTable.getSelectionModel(), false, myTable.getRowCount() - 1, array);
|
||||
|
||||
@@ -182,6 +182,11 @@ class TreeTableSelectionModel implements SelectionModel<GridRow, GridColumn>, Se
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSelection() {
|
||||
myView.getComponent().getTree().clearSelection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ModelIndex<GridRow> getSelectedRow() {
|
||||
TreePath path = myView.getComponent().getTree().getSelectionPath();
|
||||
|
||||
@@ -2967,6 +2967,7 @@ action.RestoreProtocolHandler.text=Register Gateway Protocol
|
||||
action.GatewayPluginsAction.text=Manage Providers
|
||||
action.DSOpenConsole.text=Open Python Console
|
||||
action.CopyTableGridAction.text=Copy Data
|
||||
action.ResetTableGridSelectionAction.text=Clear Selection
|
||||
|
||||
action.plugins.autoupdate.repository.view.text=View Plugins Auto-Update Repository
|
||||
action.ToolWindowShowNamesAction.text=Show Tool Window Names
|
||||
|
||||
Reference in New Issue
Block a user