centerSize = topCenter.computeSize(rect.width - 2*marginWidth - 2*highlight, SWT.DEFAULT);
int w = rect.width - 2*marginWidth - 2*highlight; int trim = topCenter.computeSize(w, SWT.DEFAULT).x - w; centerSize = topCenter.computeSize(w - trim, SWT.DEFAULT);
public void layout (boolean changed) {	checkWidget();	Rectangle rect = getClientArea();		Point leftSize = new Point(0, 0);	if (topLeft != null && !topLeft.isDisposed()) {		leftSize = topLeft.computeSize(SWT.DEFAULT, SWT.DEFAULT);	}	Point centerSize = new Point(0, 0);	if (topCenter != null && !topCenter.isDisposed()) {		 centerSize = topCenter.computeSize(SWT.DEFAULT, SWT.DEFAULT);	}	Point rightSize = new Point(0, 0);	if (topRight != null && !topRight.isDisposed()) {		 rightSize = topRight.computeSize(SWT.DEFAULT, SWT.DEFAULT);	}		int minTopWidth = leftSize.x + centerSize.x + rightSize.x + 2*marginWidth + 2*highlight;	int count = -1;	if (leftSize.x > 0) count++;	if (centerSize.x > 0) count++;	if (rightSize.x > 0) count++;	if (count > 0) minTopWidth += count * horizontalSpacing;			int x = rect.x + rect.width - marginWidth - highlight;	int y = rect.y + marginHeight + highlight;		boolean top = false;	if (separateTopCenter || minTopWidth > rect.width) {		int topHeight = Math.max(rightSize.y, leftSize.y);		if (topRight != null && !topRight.isDisposed()) {			top = true;			x -= rightSize.x;			topRight.setBounds(x, y, rightSize.x, topHeight);			x -= horizontalSpacing;		}		if (topLeft != null && !topLeft.isDisposed()) {			top = true;			leftSize = topLeft.computeSize(x - rect.x - marginWidth - highlight, SWT.DEFAULT);			topLeft.setBounds(rect.x + marginWidth + highlight, y, leftSize.x, topHeight);		}		if (top)y += topHeight + verticalSpacing;		if (topCenter != null && !topCenter.isDisposed()) {			top = true;			centerSize = topCenter.computeSize(rect.width - 2*marginWidth - 2*highlight, SWT.DEFAULT);			topCenter.setBounds(rect.x + rect.width - marginWidth - highlight - centerSize.x, y, centerSize.x, centerSize.y);			y += centerSize.y + verticalSpacing;		}			} else {		int topHeight = Math.max(rightSize.y, Math.max(centerSize.y, leftSize.y));		if (topRight != null && !topRight.isDisposed()) {			top = true;			x -= rightSize.x;			topRight.setBounds(x, y, rightSize.x, topHeight);			x -= horizontalSpacing;		}		if (topCenter != null && !topCenter.isDisposed()) {			top = true;			x -= centerSize.x;			topCenter.setBounds(x, y, centerSize.x, topHeight);			x -= horizontalSpacing;		}		if (topLeft != null && !topLeft.isDisposed()) {			top = true;			leftSize = topLeft.computeSize(x - rect.x - marginWidth - highlight, topHeight);			topLeft.setBounds(rect.x + marginWidth + highlight, y, leftSize.x, topHeight);		}		if (top)y += topHeight + verticalSpacing;	}	int oldSeperator = separator;	separator = -1;	if (content != null && !content.isDisposed()) {		if (topLeft != null || topRight!= null || topCenter != null){			separator = y;			y++;		}		 content.setBounds(rect.x + marginWidth + highlight, y, rect.width - 2 * marginWidth - 2*highlight, rect.y + rect.height - y - marginHeight - highlight);	}	if (oldSeperator != -1 && separator != -1) {		int t = Math.min(separator, oldSeperator);		int b = Math.max(separator, oldSeperator);		redraw(borderLeft, t, getSize().x - borderLeft - borderRight, b - t, false);	}}