Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How can I set the Caret in a text editor.
How can I set the Caret in a text editor. [message #280101] Fri, 28 January 2005 15:30 Go to next message
Eclipse UserFriend
When the popup menu is displayed I would like to set the
caret where the mouse is. I.e. clicking on the right button
should do the same as the left button dose.


I have implemented following and I don't know what the
simplest solution is to be able to set the caret/cursor
in run....

public class Action implements IObjectActionDelegate, IEditorActionDelegate {


public void run(IAction action) {
Shell shell = new Shell();
...... <- need help
}

}
Re: How can I set the Caret in a text editor. [message #280144 is a reply to message #280101] Mon, 31 January 2005 02:04 Go to previous message
Eclipse UserFriend
See ITextEditor.getSelectionProvider to set the selection / caret on a
text editor.

If you don't have the active editor already, have a look at
IWorkbenchPage.getActiveEditor.

Get the workbench page from the workbench[window] you get from the
AbstractUIPlugin.getWorkbench.

HTH
-tom

SpeedadeYxa wrote:
>
>
> When the popup menu is displayed I would like to set the
> caret where the mouse is. I.e. clicking on the right button
> should do the same as the left button dose.
>
>
> I have implemented following and I don't know what the
> simplest solution is to be able to set the caret/cursor
> in run....
>
> public class Action implements IObjectActionDelegate,
> IEditorActionDelegate {
>
>
> public void run(IAction action) {
> Shell shell = new Shell();
> ...... <- need help
> }
>
> }
Previous Topic:Renamed a resource, setPartName changes title bar but not folder tab
Next Topic:Highlight line in TextEditor
Goto Forum:
  


Current Time: Thu May 08 13:46:40 EDT 2025

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

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

Back to the top