Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Annotations without markers
Annotations without markers [message #285744] Tue, 24 May 2005 19:29 Go to next message
Eclipse UserFriend
Originally posted by: pajensen.cs.utah.edu

Hi,

I am developing a plug-in in which I'd like to use annotations, but not
markers. I think I've got most of it figured out, but I'm missing one
critical piece of information.

Given an IFile, an IEditorPart, or a FileEditorInput, how can I get the
corresponding IAnnotationModel so that I can add and remove annotations
directly? Is there a more direct solution to adding annotations without
using markers?

Thanks for your help,

Peter Jensen
Re: Annotations without markers [message #285872 is a reply to message #285744] Fri, 27 May 2005 03:58 Go to previous message
Eclipse UserFriend
Peter Jensen wrote:
> Given an IFile, an IEditorPart, or a FileEditorInput, how can I get the
> corresponding IAnnotationModel so that I can add and remove annotations
> directly?

You typically get the annotation model for a document from an
IDocumentProvider. So, if your IEditorPart is an ITextEditor, you would
do the following:

ITextEditor editor;
IEditorInput input;

editor.getDocumentProvider().getAnnotationModel(input);

> Is there a more direct solution to adding annotations without
> using markers?

None that I'd know of.

hth, tom
Previous Topic:Spell-checking
Next Topic:Auto Complete
Goto Forum:
  


Current Time: Sat Jul 19 17:12:41 EDT 2025

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

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

Back to the top