Annotation Hilighting [message #330496] |
Wed, 30 July 2008 07:49  |
Eclipse User |
|
|
|
I'm trying to have my plugin insert annotations to a file based on data
external to the file/eclipse. The goal is that the line the annotation is
on will be hilighted. The trick in this is that I need to know the
position in the file where the hilighting must begin and end.
I see I can get this line start and end info with
ITextEditor.getDocumentProvider().getDocument(...).getLineIn formation(int
line). How do I get to the correct text editor object for the file, for
instance, when the file is first opened in the editor?
|
|
|
Re: Annotation Hilighting [message #330512 is a reply to message #330496] |
Wed, 30 July 2008 18:46  |
Eclipse User |
|
|
|
OK, I figured this one out. I made an extension point extending
IEditorActionDelegate, registered the desired editors with it in
plugin.xml. Then in the setActiveEditor method, which is passed
targetEditor:IEditorPart I call
targetEditor.getDocumentProvider().getDocument(editor.getEdi torInput()).getLineInformation(line).
|
|
|
Powered by
FUDForum. Page generated in 0.02877 seconds