Point selection = getSelection (); return getText ().substring (selection.x, selection.y);
int length = OS.GetWindowTextLength (handle); if (length == 0) return ""; int [] start = new int [1], end = new int [1]; OS.SendMessage (handle, OS.EM_GETSEL, start, end); if (start [0] == end [0]) return ""; TCHAR buffer = new TCHAR (getCodePage (), length + 1); OS.GetWindowText (handle, buffer, length + 1); return buffer.toString (start [0], end [0] - start [0]);
public String getSelectionText () {	checkWidget ();	/*	* NOTE: The current implementation uses substring ()	* which can reference a potentially large character	* array.	*/	Point selection = getSelection ();	return getText ().substring (selection.x, selection.y);}