Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Setting the cursor position
Setting the cursor position [message #1076252] Wed, 31 July 2013 03:03 Go to next message
Roberto Oliveira is currently offline Roberto OliveiraFriend
Messages: 5
Registered: July 2013
Junior Member
Hi,

I saw in the forum some ways to get the current position of the cursor in a Text Editor...but how can I set the cursor for a specific position that i want?
For example, I want to set the cursor to some line, how can I do that?
Re: Setting the cursor position [message #1076453 is a reply to message #1076252] Wed, 31 July 2013 12:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Roberto,

This isn't a JDT-specific question... I'm not sure, but I think you
generally do this via the editor's selection provider's
getSelection/setSelection methods which should return an ITextSelection
and for which you can create an
org.eclipse.jface.text.TextSelection.TextSelection(int, int) for a call
to setSelection.


On 31/07/2013 1:33 PM, Roberto Oliveira wrote:
> Hi,
>
> I saw in the forum some ways to get the current position of the cursor
> in a Text Editor...but how can I set the cursor for a specific
> position that i want?
> For example, I want to set the cursor to some line, how can I do that?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Setting the cursor position [message #1076469 is a reply to message #1076453] Wed, 31 July 2013 12:50 Go to previous message
Roberto Oliveira is currently offline Roberto OliveiraFriend
Messages: 5
Registered: July 2013
Junior Member
Thank' Ed Merks, I will take a look in what you said.

And sorry for posted it in the wrong place, I am new in the forum
Previous Topic:Project help
Next Topic:Moving OUTLINE panel
Goto Forum:
  


Current Time: Tue Apr 16 22:50:19 GMT 2024

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

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

Back to the top