Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFace question: how to get caret position in text editor

Phil Rhodes
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I'm working on a simple Eclipse plugin that should insert some text into the active editor in response to a menu command which invokes an InputDialog. Everything works, including inserting the text, but I have run into one stumbling block: I cannot figure out how to insert the text
at the current caret position.

Here is what I have so far:

Any idea how, given that, I can find the correct offset to begin my insert, based on the caret position?

[ October 08, 2007: Message edited by: Phil Rhodes ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic