Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » How to get the current caret position of a field
How to get the current caret position of a field [message #1699943] Mon, 29 June 2015 12:37 Go to next message
Ondrej Ilcik is currently offline Ondrej IlcikFriend
Messages: 21
Registered: November 2014
Junior Member
I would like to mimic a feature known from some UI parts in Eclipse (especially launch configurations) - inserting a predefined variable. It allows to modify the value of a text field by inserting a special value to the position of the caret.

I'm struggling with how to get the caret position in Sapphire since the model does not propagate such UI-specific info. Is there a way how to implement this which does not involve creating a special field implementation?

Thanks in advance.

[Updated on: Mon, 29 June 2015 12:38]

Report message to a moderator

Re: How to get the current caret position of a field [message #1701511 is a reply to message #1699943] Mon, 13 July 2015 18:50 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Sorry for the delay in responding. Currently, there is no API available to implement what you are describing. We should add a TextSelectionService similar to the existing ListSelectionService.
Re: How to get the current caret position of a field [message #1706690 is a reply to message #1701511] Fri, 28 August 2015 17:51 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
I had a bit of time recently to implement a ListSelectionService. Take a look and let us know how it worked for your usecase. There is a sample that shows you how to manipulate selection/caret and how to insert at current selection/caret.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=474735
Previous Topic:Drag and Drop support for a list of string items
Next Topic:Default values behavior in property editor.
Goto Forum:
  


Current Time: Sun Nov 18 22:59:30 GMT 2018

Powered by FUDForum. Page generated in 0.02108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top