• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JFace question: how to get caret position in text editor

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

Thanks!
[ October 08, 2007: Message edited by: Phil Rhodes ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic