Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » programatically moving the cursor input location for TextEditor class
programatically moving the cursor input location for TextEditor class [message #139556] Fri, 03 October 2003 17:46 Go to next message
Eclipse UserFriend
Originally posted by: jmyron.ioconcepts.com

When using the TextEditor class how do you programatically move the input
caret position. I've looked all over the place and see no editor function
(or any other class function) for changing this location. There is a query
function: GetCursorPosition() but no equivalent SetCursorPosition()
Re: programatically moving the cursor input location for TextEditor class [message #141112 is a reply to message #139556] Tue, 07 October 2003 15:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jmyron.ioconcepts.com

To anyone else following this thread: After a suggestion by a colleague I
was able to determin the solution:
Create a new selection and then call the doSetSelection() function. This
updates the cursor input position:

TextSelection sel = new TextSelection( start + szInserted, 0);
doSetSelection(sel);
Re: programatically moving the cursor input location for TextEditor class [message #141290 is a reply to message #139556] Wed, 08 October 2003 04:58 Go to previous message
Eclipse UserFriend
Originally posted by: tom.eicher.gmx.ch.nodomain

Get the selectionProvider from the editor
(ITextEditor.getSelectionProvider()) and set the selection on it:

ISelectionProvider.setSelection(new TextSelection(offset, 0));

-tom

J Myron Smith wrote:

> When using the TextEditor class how do you programatically move the input
> caret position. I've looked all over the place and see no editor function
> (or any other class function) for changing this location. There is a query
> function: GetCursorPosition() but no equivalent SetCursorPosition()
>
>
>
Previous Topic:Mandrake 9.1 and Eclipse gtk
Next Topic:keyboard control sequences
Goto Forum:
  


Current Time: Sun May 11 14:56:05 EDT 2025

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

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

Back to the top