Annotations without markers [message #285744] |
Tue, 24 May 2005 19:29  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03473 seconds