Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to register a Error Marker for java editor?
How to register a Error Marker for java editor? [message #252921] Wed, 23 April 2008 05:58 Go to next message
Eclipse UserFriend
Originally posted by: reg.zhuce.163.com

Which extension point should I use?
Re: How to register a Error Marker for java editor? [message #252925 is a reply to message #252921] Wed, 23 April 2008 06:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Simply creating IMarker instances on the IFile should be sufficient for
the Java editor to display them.


dazh wrote:
> Which extension point should I use?
>
Re: How to register a Error Marker for java editor? [message #252928 is a reply to message #252925] Wed, 23 April 2008 08:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: reg.zhuce.163.com

I try it like this:
IFileEditorInput ife = (IFileEditorInput) targetEditor.getEditorInput();
IFile file=ife.getFile();
try{
IMarker marker=file.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.CHAR_START, 1);
marker.setAttribute(IMarker.CHAR_END, 4);
marker.setAttribute(IMarker.MESSAGE, "A sample marker message"); }
catch(CoreException e){}

But it does not display a mark.
How to display it? Did I do it correctly?
> Simply creating IMarker instances on the IFile should be sufficient for
> the Java editor to display them.
>
>
> dazh wrote:
>> Which extension point should I use?
>>
Re: How to register a Error Marker for java editor? [message #252932 is a reply to message #252928] Wed, 23 April 2008 10:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: reg.zhuce.163.com

I am sorry,I made a mistake.I have not set a IMarker.SEVERITY.
Thanks a lot,Merks.
dazh 写道:
> I try it like this:
> IFileEditorInput ife = (IFileEditorInput) targetEditor.getEditorInput();
> IFile file=ife.getFile();
> try{
> IMarker marker=file.createMarker(IMarker.PROBLEM);
> marker.setAttribute(IMarker.CHAR_START, 1);
> marker.setAttribute(IMarker.CHAR_END, 4);
> marker.setAttribute(IMarker.MESSAGE, "A sample marker message"); }
> catch(CoreException e){}
>
> But it does not display a mark.
> How to display it? Did I do it correctly?
>> Simply creating IMarker instances on the IFile should be sufficient for
>> the Java editor to display them.
>>
>>
>> dazh wrote:
>>> Which extension point should I use?
>>>
Re: How to register a Error Marker for java editor? [message #252943 is a reply to message #252925] Wed, 23 April 2008 13:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: reg.zhuce.163.com

I have got another question.
I need to customize the mark type.
I set the icon use extension point--org.eclipse.ui.ide.markerImageProviders.
But how to set the text decoration style,for example to show a orange
underline?
Ed Merks 写道:
> Simply creating IMarker instances on the IFile should be sufficient for
> the Java editor to display them.
>
>
> dazh wrote:
>> Which extension point should I use?
>>
Re: How to register a Error Marker for java editor? [message #252985 is a reply to message #252943] Thu, 24 April 2008 12:10 Go to previous message
Eclipse UserFriend
Originally posted by: reg.zhuce.163.com

I have got it by org.eclipse.ui.editors.annotationTypes
and org.eclipse.ui.editors.markerAnnotationSpecification.
dazh 写道:
> I have got another question.
> I need to customize the mark type.
> I set the icon use extension point--org.eclipse.ui.ide.markerImageProviders.
> But how to set the text decoration style,for example to show a orange
> underline?
> Ed Merks 写道:
>> Simply creating IMarker instances on the IFile should be sufficient for
>> the Java editor to display them.
>>
>>
>> dazh wrote:
>>> Which extension point should I use?
>>>
Previous Topic:Fixing imports
Next Topic:JVM terminating when system.loadlibrary is used (Linux)
Goto Forum:
  


Current Time: Fri May 30 05:16:51 EDT 2025

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

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

Back to the top