if (elements.isEmpty()) {
return;
}
final Element scrollElement = elements.get(0);
if (scrollElement != null) {
Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
if (horizontalS != null) {
horizontalS.setWorldMax(scrollElement.getWidth());
horizontalS.setWorldPageSize(horizontalS.getWidth());
updateWorldH();
}
Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
if (verticalS != null) {
verticalS.setWorldMax(scrollElement.getHeight());
verticalS.setWorldPageSize(verticalS.getHeight());
updateWorldV();
}
}
}
}