boolean hasLf = false;
public void setText (String string) {	checkWidget();	if (string == null) error (SWT.ERROR_NULL_ARGUMENT);	if ((style & SWT.SEPARATOR) != 0) return;	text = string;		/* Strip out mnemonic marker symbols, and remember the mnemonic. */	char [] unicode = new char [string.length ()];	string.getChars (0, unicode.length, unicode, 0);	int i=0, j=0, mnemonic=0;	while (i < unicode.length) {		if ((unicode [j++] = unicode [i++]) == Mnemonic) {			if (i == unicode.length) {continue;}			if (unicode [i] == Mnemonic) {i++; continue;}			if (mnemonic == 0) mnemonic = unicode [i];			j--;		}	}	while (j < unicode.length) unicode [j++] = 0;		/* Wrap the text if necessary, and convert to mbcs. */	byte [] buffer;	if ((style & SWT.WRAP) != 0) {		int [] argList = {			OS.XmNfontList, 0,     /* 1 */			OS.XmNwidth, 0,        /* 3 */			OS.XmNmarginLeft, 0,   /* 5 */			OS.XmNmarginRight, 0,  /* 7 */			OS.XmNborderWidth, 0,  /* 9 */			OS.XmNmarginWidth, 0,  /* 11 */		};		OS.XtGetValues (handle, argList, argList.length / 2);		int width = argList [3] - argList [5] - argList [7] - argList [9] * 2 - argList [11] * 2;		Display display = getDisplay ();		if (mnemonic != 0) string = new String(unicode);		string = display.wrapText (string, argList [1], width);		buffer = Converter.wcsToMbcs (null, string, true);	} else {		buffer = Converter.wcsToMbcs (null, unicode, true);	}		int [] parseTable = getDisplay ().parseTable;	int xmString = OS.XmStringParseText (		buffer,		0,		OS.XmFONTLIST_DEFAULT_TAG, 		OS.XmCHARSET_TEXT, 		parseTable,		parseTable.length,		0);	if (xmString == 0) error (SWT.ERROR_CANNOT_SET_TEXT);	if (mnemonic == 0) mnemonic = OS.XK_VoidSymbol;	int [] argList = {		OS.XmNlabelType, OS.XmSTRING,		OS.XmNlabelString, xmString,		OS.XmNmnemonic, mnemonic,	};	OS.XtSetValues (handle, argList, argList.length / 2);	if (xmString != 0) OS.XmStringFree (xmString);}