Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Resource Marker
Resource Marker [message #167875] Tue, 09 December 2003 03:34 Go to next message
Eclipse UserFriend
Originally posted by: p.vats.zensar.com

I am trying to run workbench wanting to show error in my task view which I
am able to do it, but when I click on the error description on my Task
View then it doesn't take me to the line /location in my file / in editor.

For this I am using resource marker. I am expecting some update on this,
if any one can spare some time and provide some input for this, it would
be great help.

thnx,
Re: Resource Marker [message #167936 is a reply to message #167875] Tue, 09 December 2003 05:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thomas_maeder.ch.ibm.com

Prikshit wrote:

> I am trying to run workbench wanting to show error in my task view which I
> am able to do it, but when I click on the error description on my Task
> View then it doesn't take me to the line /location in my file / in editor.
>
> For this I am using resource marker. I am expecting some update on this,
> if any one can spare some time and provide some input for this, it would
> be great help.
>
> thnx,
>

Do you set the proper attributes (I think line number & position,
length) on the marker?
Re: Resource Marker [message #169083 is a reply to message #167936] Thu, 11 December 2003 03:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: v.choudhary.zensar.com

Hi Guys,

Thanks for your reply .
I have set "IMarker.LINE_NUMBER" in my code and now when I double click
the error the focus is correctly set on the line having the error.

But the problem is that the "Red Icon" is not displayed on the line having
the error. If I close the workbench and run it again the "Error icon" is
displayed correctly on the line having the error.

Can you let me know if I am missing some setting which will make the error
icon appear ???

Thanks,
Prikshit


Thomas Mäder wrote:

> Prikshit wrote:

> > I am trying to run workbench wanting to show error in my task view which I
> > am able to do it, but when I click on the error description on my Task
> > View then it doesn't take me to the line /location in my file / in editor.
> >
> > For this I am using resource marker. I am expecting some update on this,
> > if any one can spare some time and provide some input for this, it would
> > be great help.
> >
> > thnx,
> >

> Do you set the proper attributes (I think line number & position,
> length) on the marker?
Re: Resource Marker [message #169114 is a reply to message #169083] Thu, 11 December 2003 03:57 Go to previous messageGo to next message
Eclipse UserFriend
> I have set "IMarker.LINE_NUMBER" in my code and now when I double click
> the error the focus is correctly set on the line having the error.
>
> But the problem is that the "Red Icon" is not displayed on the line having
> the error. If I close the workbench and run it again the "Error icon" is
> displayed correctly on the line having the error.
>
> Can you let me know if I am missing some setting which will make the error
> icon appear ???

This could be a thread issue. Take a look at
org.eclipse.ui.texteditor.MarkerUtilities, especially the createMarker
method - or use it ;)

HTH,

Thorsten
Re: Resource Marker [message #172655 is a reply to message #169083] Fri, 19 December 2003 17:52 Go to previous message
Eclipse UserFriend
Originally posted by: jmyron.ioconcepts.com

Sound familiar. Thats the same problem I ran into when I first started
messing with markers. Don't exactly understand why this is the case but you
need to create a MarkerAnnotation and add it to the annotation model to get
your error to immediately show on the margin ruler. You also have to specify
the file offset and length not just the line number (length doesn't really
matter for the ruler annotation). Here is a snippet of code that does what
I'm talking about:

IMarker parseError =
((IFileEditorInput)getEditorInput()).getFile().createMarker( "org.eclipse.cor
e.resources.problemmarker");
IRegion info =
getDocumentProvider().getDocument(getEditorInput()).getLineI nformation(line-
1);


parseError.setAttribute(IMarker.LINE_NUMBER, line);

parseError.setAttribute(IMarker.MESSAGE, msg);

parseError.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);


MarkerAnnotation markerAnot = new MarkerAnnotation( parseError );


int errorOffset = info.getOffset() + column-1;

int errorLen = info.getLength() - column + 1;

Position pos = new Position( errorOffset, errorLen );

IAnnotationModel am =
getDocumentProvider().getAnnotationModel(getEditorInput());

am.addAnnotation(markerAnot, pos);

Hope this helps.

Myron


"Vinay Choudhary" <v.choudhary@zensar.com> wrote in message
news:br99bb$g1b$1@eclipse.org...
> Hi Guys,
>
> Thanks for your reply .
> I have set "IMarker.LINE_NUMBER" in my code and now when I double click
> the error the focus is correctly set on the line having the error.
>
> But the problem is that the "Red Icon" is not displayed on the line having
> the error. If I close the workbench and run it again the "Error icon" is
> displayed correctly on the line having the error.
>
> Can you let me know if I am missing some setting which will make the error
> icon appear ???
>
> Thanks,
> Prikshit
>
>
> Thomas M
Previous Topic:Who to find out(DEBUG) why setEditable() is not working
Next Topic:org.eclipse.swt.opengl plugin broken in M6
Goto Forum:
  


Current Time: Tue Jul 22 08:36:38 EDT 2025

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

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

Back to the top