Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » setting text markers on a resource
setting text markers on a resource [message #290202] Fri, 19 August 2005 18:10 Go to next message
Eclipse UserFriend
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 #290209 is a reply to message #290202] Fri, 19 August 2005 21:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Markers don't highlight. They show up in the tasks window instead. They are used to say 'There is an error on this line'.

Some other editors may choose to show the markers differently, but that's an implementation feature of those editors and not the marker specifically.
Re: setting text markers on a resource [message #290236 is a reply to message #290202] Sun, 21 August 2005 19:35 Go to previous message
Beth Tibbitts is currently offline Beth TibbittsFriend
Messages: 231
Registered: July 2009
Senior Member
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
Previous Topic:Update Site URL vs. Search for new Features
Next Topic:UndoRetargetAction with multiple CommandStacks
Goto Forum:
  


Current Time: Sat Apr 27 03:35:54 GMT 2024

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

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

Back to the top