code: public String getSelectedText()
  	{
  		if (!selectingText)
  			return "";
  
  		int start = Math.min(selectionCursor.index, cursor.index);
  		int end = Math.max(selectionCursor.index, cursor.index);
  
  		return this.text.substring(start, end);
  	}
docs: Gets the currently selected text.
  
  @return the text selected.