Ensures that the rows identified by beginRow through endRow are
visible.
if(tree != null && beginRow >= 0 && endRow < getRowCount(tree)) {
Rectangle visRect = tree.getVisibleRect();
if(beginRow == endRow) {
Rectangle scrollBounds = getPathBounds(tree, getPathForRow
(tree, beginRow));
if(scrollBounds != null) {
scrollBounds.x = visRect.x;
scrollBounds.width = visRect.width;
tree.scrollRectToVisible(scrollBounds);
}
}
else {
Rectangle beginRect = getPathBounds(tree, getPathForRow
(tree, beginRow));
Rectangle testRect = beginRect;
int beginY = beginRect.y;
int maxY = beginY + visRect.height;
for(int counter = beginRow + 1; counter <= endRow; counter++) {
testRect = getPathBounds(tree,
getPathForRow(tree, counter));
if((testRect.y + testRect.height) > maxY)
counter = endRow;
}
tree.scrollRectToVisible(new Rectangle(visRect.x, beginY, 1,
testRect.y + testRect.height-
beginY));
}
}