The right API's would seem to be:
ScrollBar sb = table.getVerticalBar();
and
sb.getVisible();
The code sample below illustrates this but it doesn't work because
getVisible always returns true, NO MATTER WHAT.
Anyone know a solution to this problem? Our next attempt would be to do
something really hideous like trying to use one of the API's to tell us
what column a certain point is in to indirectly determine whether the
scrollbar is there (yeccchh).
TIA, Bill.
=====================================
private void maximizeTableColWidth(Table t, int column, int minWidth) {
// Determine overall width available for use by the table
int availableWidth = t.getSize().x - t.getBorderWidth() * 2;
// Subtract the widths of all columns except the one to be maximized
for (int i = 0; i < t.getColumns().length; i++) {
if (i != column ) {
availableWidth -= t.getColumn(i).getWidth();
}
}
// If vertical scrollbar is present, subtract its width too
if (t.getVerticalBar() != null) {
if (t.getVerticalBar().getVisible()) {
availableWidth -= t.getVerticalBar().getSize().x;
}
}
// Set the column to avail width or its minimum - whichever is larger
t.getColumn(column).setWidth( availableWidth > minWidth ?
availableWidth : minWidth);
}