How to determine current selection in AceEditor

Hello,

This is not a question about vaadin per se but rather about the AceEditor addon. I am sorry if I am asking the question in the wrong forum.

I am trying to determine how to retrieve the current selected text but to no avail. Same thing for the current line.

  • AceEditor.getDoc().getText() returns the whole text. I need to extract the user selected from this.
  • Same thing for current user line.

Thanks!