mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
Inspections UI: tree collapse on left arrow pressing when it is needed
This commit is contained in:
@@ -170,14 +170,22 @@ public class TreeTable extends JBTable {
|
||||
final int selColumn = columnModel.getSelectionModel().getAnchorSelectionIndex();
|
||||
boolean treeHasFocus = selColumn == -1 || selColumn >= 0 && isTreeColumn(selColumn);
|
||||
boolean oneRowSelected = getSelectedRowCount() == 1;
|
||||
int rowToSelect = -1;
|
||||
if(treeHasFocus && oneRowSelected && ((keyCode == KeyEvent.VK_LEFT) || (keyCode == KeyEvent.VK_RIGHT))){
|
||||
TreePath selectionPath = myTree.getSelectionPath();
|
||||
myTree._processKeyEvent(e);
|
||||
myTree.setSelectionPath(selectionPath);
|
||||
if (myTree.isExpanded(selectionPath)) {
|
||||
myTree.setSelectionPath(selectionPath);
|
||||
} else if (keyCode == KeyEvent.VK_LEFT) {
|
||||
rowToSelect = myTree.getRowForPath(myTree.getSelectionPath());
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.processKeyEvent(e);
|
||||
}
|
||||
if (rowToSelect > -1) {
|
||||
getSelectionModel().setSelectionInterval(rowToSelect, rowToSelect);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user