@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
checkWidget();
int innerWidth = wHint;
if (innerWidth != SWT.DEFAULT) {
innerWidth -= marginWidth * 2;
if (innerWidth < 0)
innerWidth = 0;
}
int innerHeight = hHint;
if (innerHeight != SWT.DEFAULT) {
innerHeight -= marginHeight * 2;
if (innerHeight < 0)
innerHeight = 0;
}
Point textSize = computeTextSize(innerWidth, innerHeight);
int textWidth = textSize.x + 2 * marginWidth;
int textHeight = textSize.y + 2 * marginHeight;
if (wHint != SWT.DEFAULT) {
textWidth = wHint;
}
if (hHint != SWT.DEFAULT) {
textHeight = hHint;
}
Rectangle trim = computeTrim(0, 0, textWidth, textHeight);
return new Point(trim.width, trim.height);
}