mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Collapse property recursively
This commit is contained in:
@@ -653,11 +653,8 @@ public abstract class PropertyTable extends JBTable {
|
||||
int selectedRow = getSelectedRow();
|
||||
Property property = myProperties.get(rowIndex);
|
||||
|
||||
LOG.assertTrue(myExpandedProperties.remove(property.getPath()));
|
||||
int size = getFilterChildren(property).size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
myProperties.remove(rowIndex + 1);
|
||||
}
|
||||
int size = collapse(property, rowIndex + 1);
|
||||
LOG.assertTrue(size > 0);
|
||||
myModel.fireTableDataChanged();
|
||||
|
||||
if (selectedRow != -1) {
|
||||
@@ -669,6 +666,18 @@ public abstract class PropertyTable extends JBTable {
|
||||
}
|
||||
}
|
||||
|
||||
private int collapse(Property property, int startIndex) {
|
||||
int totalSize = 0;
|
||||
if (myExpandedProperties.remove(property.getPath())) {
|
||||
int size = getFilterChildren(property).size();
|
||||
totalSize += size;
|
||||
for (int i = 0; i < size; i++) {
|
||||
totalSize += collapse(myProperties.remove(startIndex), startIndex);
|
||||
}
|
||||
}
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
private void expand(int rowIndex) {
|
||||
int selectedRow = getSelectedRow();
|
||||
Property property = myProperties.get(rowIndex);
|
||||
|
||||
Reference in New Issue
Block a user