I've a problem with this method.
The calls to resizeAndRepaint and doLayout of this method cause a big cascade of method calls.
There is a problem to change the implementation avoiding the calls when all rows are already collapsed (for example with the subsequent strategy)?
I cannot do this overriding the method in a subclass because the setBatchProcessing(boolean) is not visible.
Thanks!
- Code: Select all
@Override
public void collapseAllRows() {
setBatchProcessing(true);
boolean oldFlag = isScrollRowWhenRowHeightChanges();
setScrollRowWhenRowHeightChanges(false);
boolean collapsed = false;
try {
for (int i = 0; i < getRowCount(); i++) {
if(isExpanded(i)){
collapseRow(i);
collapsed = true;
}
}
} finally {
if(collapsed){
resizeAndRepaint();
super.doLayout();
}
setBatchProcessing(false);
setScrollRowWhenRowHeightChanges(oldFlag);
}
}