width = DEFAULT_WIDTH; } if (singleLine == false) { ((WrappedContent) content).wrapLines(width); count = content.getLineCount();
if (wHint != SWT.DEFAULT) { width = wHint; } else { width = DEFAULT_WIDTH; } if (singleLine == false) { ((WrappedContent) content).wrapLines(width); count = content.getLineCount(); }
public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget();	int count, width, height;	boolean singleLine = (getStyle() & SWT.SINGLE) != 0;		if (singleLine) {		count = 1;	}	else {		count = content.getLineCount();	}	if (wordWrap) {		if (wHint != SWT.DEFAULT) {			width = wHint;		} 		else {			width = DEFAULT_WIDTH;		}		if (singleLine == false) {			((WrappedContent) content).wrapLines(width);			count = content.getLineCount();		}	}	else	if (wHint != SWT.DEFAULT) {		width = wHint;	} 	else {		// Only calculate what can actually be displayed.		// Do this because measuring each text line is a 		// time-consuming process.		int visibleCount = Math.min (count, getDisplay().getBounds().height / lineHeight);		lineCache.calculate(0, visibleCount);		width = lineCache.getWidth() + leftMargin + rightMargin;	}	// If a height or width has been specified (via hHint and wHint),	// use those values.  Otherwise calculate the size based on the	// text that is defined.	if (hHint != SWT.DEFAULT) {		height = hHint;	} 	else {		height = count * lineHeight + topMargin + bottomMargin;	}	// Use default values if no text is defined.	if (width == 0) {		width = DEFAULT_WIDTH;	}	if (height == 0) {		if (singleLine) {			height = lineHeight;		}		else {			height = DEFAULT_HEIGHT;		}	}	Rectangle rect = computeTrim(0, 0, width, height);	return new Point (rect.width, rect.height);}