I'm developing a voice recognition plugin for Eclipse. For example when I am writing code I can simply say "for" and "for(){}" will be printed to the editor. It works great, however, when the scope of the cursor goes out of Eclipse e.g. when I click on a browser search the next thing I say will be printed here instead of the Eclipse editor.
Is there a way to find out where the caret position is on the Eclipse editor when it goes out of scope, because when you click on any part of the Eclipse UI the old caret position pops back up.
I am also using the JavaRobot API to emulate the string to the screen. I don't believe it has the option of setting the caret position, only the courser position.
Update: All that is needed is the text editor caret position x and y co-ordinates, I can use the Java Robot move mouse(caret position x,y) and mouse press to bring the eclipse platform back into scope before any emulation occurs.