Source:
<code>public Point computeSize( int wHint, int hHint, boolean changed ) { checkWidget(); int height = 0, width = 0; if( wHint == SWT.DEFAULT || hHint == SWT.DEFAULT ) { Font font = getFont(); boolean wrap = ( style & SWT.WRAP ) != 0 ; int wrapWidth = 0; if( wrap && wHint != SWT.DEFAULT ) { wrapWidth = wHint; } Point extent; Point messageExtent = TextSizeUtil.stringExtent( font, message ); if( ( getStyle() & SWT.SINGLE ) != 0 ) { extent = TextSizeUtil.stringExtent( font, text ); } else { extent = TextSizeUtil.textExtent( font, text, wrapWidth ); } extent.x = Math.max( extent.x, messageExtent.x ); extent.y = Math.max( extent.y, messageExtent.y ); if( extent.x != 0 ) { width = extent.x; } if( extent.y != 0 ) { height = extent.y; } TextThemeAdapter themeAdapter = getThemeAdapter(); <START> CssImage search = themeAdapter.getSearchIconImage( this ); <END> CssImage cancel = themeAdapter.getCancelIconImage( this ); if( ( style & SWT.SEARCH ) != 0 ) { if( ( style & SWT.ICON_SEARCH ) != 0 ) { width += search.width + themeAdapter.getSearchIconSpacing( this ); height = Math.max( height, search.height ); } if( ( style & SWT.ICON_CANCEL ) != 0 ) { width += cancel.width + themeAdapter.getCancelIconSpacing( this ); height = Math.max( height, cancel.height ); } } } if( width == 0 ) { width = DEFAULT_WIDTH; } if( height == 0 ) { height = DEFAULT_HEIGHT; } if( wHint != SWT.DEFAULT ) { width = wHint; } if( hHint != SWT.DEFAULT ) { height = hHint; } height += 2; width += 1; Rectangle trim = computeTrim( 0, 0, width, height ); return new Point( trim.width, trim.height ); }</code><technical_language>I prefer serachImage cancelImage for clarity</technical_language>

Target:
public Point computeSize( int wHint, int hHint, boolean changed ) { checkWidget(); int height = 0, width = 0; if( wHint == SWT.DEFAULT || hHint == SWT.DEFAULT ) { Font font = getFont(); boolean wrap = ( style & SWT.WRAP ) != 0 ; int wrapWidth = 0; if( wrap && wHint != SWT.DEFAULT ) { wrapWidth = wHint; } Point extent; Point messageExtent = TextSizeUtil.stringExtent( font, message ); if( ( getStyle() & SWT.SINGLE ) != 0 ) { extent = TextSizeUtil.stringExtent( font, text ); } else { extent = TextSizeUtil.textExtent( font, text, wrapWidth ); } extent.x = Math.max( extent.x, messageExtent.x ); extent.y = Math.max( extent.y, messageExtent.y ); if( extent.x != 0 ) { width = extent.x; } if( extent.y != 0 ) { height = extent.y; } TextThemeAdapter themeAdapter = getThemeAdapter(); CssImage searchImage = themeAdapter.getSearchIconImage( this ); CssImage cancelImage = themeAdapter.getCancelIconImage( this ); if( ( style & SWT.SEARCH ) != 0 ) { if( ( style & SWT.ICON_SEARCH ) != 0 ) { width += searchImage.width + themeAdapter.getSearchIconSpacing( this ); height = Math.max( height, searchImage.height ); } if( ( style & SWT.ICON_CANCEL ) != 0 ) { width += cancelImage.width + themeAdapter.getCancelIconSpacing( this ); height = Math.max( height, cancelImage.height ); } } } if( width == 0 ) { width = DEFAULT_WIDTH; } if( height == 0 ) { height = DEFAULT_HEIGHT; } if( wHint != SWT.DEFAULT ) { width = wHint; } if( hHint != SWT.DEFAULT ) { height = hHint; } height += 2; width += 1; Rectangle trim = computeTrim( 0, 0, width, height ); return new Point( trim.width, trim.height ); }