setting text markers on a resource [message #151612] |
Fri, 19 August 2005 14:10  |
Eclipse User |
|
|
|
Originally posted by: no.yes.maybe
Hi,
I'm posting thsi both on platform and tools.cdt because as far as I
understand it involves both.
I want to highlight a line of C code for a file being shown in a CDT
editor. Given the IFile retrieved from the workspace, I do the following:
IMarker m = file.createMaker(IMarker.TEXT);
m.setAttribute(IMarker.LINE_NUMBER, linenum);
As far as I understand if an editor is opened on file I should see line
linenum highlighted in it. CDT's CEditor seems to be a subclass of
TextEditor, so it should behave accordingly. Instead, I don't see
anything being highlighted in the editor.
Am I missing something?
Thanks,
Roberto
|
|
|
Re: setting text markers on a resource [message #151724 is a reply to message #151612] |
Sun, 21 August 2005 15:35  |
Eclipse User |
|
|
|
roberto wrote:
> Hi,
> I'm posting thsi both on platform and tools.cdt because as far as I
> understand it involves both.
>
> I want to highlight a line of C code for a file being shown in a CDT
> editor. Given the IFile retrieved from the workspace, I do the following:
>
> IMarker m = file.createMaker(IMarker.TEXT);
> m.setAttribute(IMarker.LINE_NUMBER, linenum);
>
> As far as I understand if an editor is opened on file I should see line
> linenum highlighted in it. CDT's CEditor seems to be a subclass of
> TextEditor, so it should behave accordingly. Instead, I don't see
> anything being highlighted in the editor.
>
> Am I missing something?
>
> Thanks,
> Roberto
Yes, you need
IDE.gotoMarker(editor, marker);
(See response to your first post in CDT newsgroup above)
....Beth
|
|
|
Powered by
FUDForum. Page generated in 0.07574 seconds