How to add marker without using resources [message #326218] |
Wed, 12 March 2008 01:53  |
Eclipse User |
|
|
|
Originally posted by: avikram.novell.com
Hi,
I have to add Problem Markers on my XML Source Viewer which is not anyway
attached to a resource. How can I have achieve this?
I have seen the Spell check markers in my source viewer, so I understand
that there should be a way to add other markers as well!
Thanks,
Aditya
|
|
|
|
|
Re: How to add marker without using resources [message #326268 is a reply to message #326233] |
Thu, 13 March 2008 09:00  |
Eclipse User |
|
|
|
Originally posted by: avikram.novell.com
valere fedronic wrote:
> Hi,
>
> What you see in the source viewer is not a marker, it's an annotation.
>
> The object responsible of the creation and update of annotations is the
> IAnnotationModel. In the TextEditor the annotation model watch for
> markers in the edited file and then create an annotation for each marker
> (ResourceMarkerAnnotationModel).
>
> You just need to create your custom annotation (like SpellingAnnotation).
>
> When you detect a problem on the edited file, add a new annotation :
> ISourceViewer#getAnnotationModel()#addAnnotation(new
> CustomAnnotation(),new PositionOffsett());
>
>
> Your annotation can be painted by the AnnotationPainter, you just need
> to define the presentation specification of your annotation using the
> 'org.eclipse.ui.editors.markerAnnotationSpecification' extension point.
>
Thanks Valere, Ed, I'll try working on the annoatations & decorators as you
suggested.
--aditya
|
|
|
Powered by
FUDForum. Page generated in 0.03385 seconds