(, , 400)
, , ScrolledComposite. , Composite, , , . , Resize :
, , , (getVerticalBar()). , Resize . ...
public void handleEvent(Event event)
{
int newWidth = scrolledComposite.getSize().x;
boolean hasScroll = false;
ScrollBar scrollBar = scrolledComposite.getVerticalBar();
if (scrollBar.isVisible())
{
hasScroll = true;
newWidth -= scrolledComposite.getVerticalBar().getSize().x;
}
newWidth -= 8;
Point size = contentComposite.computeSize(newWidth, SWT.DEFAULT);
contentComposite.setSize(size);
int scroll_multiplier = size.y / 50;
scrollBar.setIncrement(scroll_multiplier);
if (scrollBar.isVisible() && !hasScroll)
{
scrolledComposite.notifyListeners(SWT.Resize, null);
}
}
, !
: wow OP. , - ...