how to get the annotationholder in run time?

I want to add an annotator when the program is running, according to dynamically updated data, but external annotators imported by the xml configuration file can only be executed when it's being registered at the start time. So how to get the annotationholder in run time?

0
3 comments
Avatar
Permanently deleted user

Here is the display effect I want to get.

0
Avatar
Permanently deleted user

All of the registered annotators are run on a background thread after every edit (See DefaultHighlightVisiter.runAnnotators).  If yours is not getting called, perhaps your registration is incorrect?  The AnnotationHolder is passed to your Annotator.annotate() method.

 

0

Eric is right. You can only supply highlights while analyzer is running, and this normally happens after every edit. You can invoke it manually using DaemonCodeAnalyzer#restart if you detect that new highlights have appeared, then cache them somewhere and return from your annotator.

0

Please sign in to leave a comment.