public class AnnotationHolderImpl extends SmartList<Annotation> implements AnnotationHolder
AnnotationHolder instead. The members of this class can suddenly change or disappear.| Constructor and Description |
|---|
AnnotationHolderImpl(AnnotationSession session)
Do not instantiate the AnnotationHolderImpl directly, please use the one provided to
Annotator.annotate(PsiElement, AnnotationHolder) instead |
AnnotationHolderImpl(AnnotationSession session,
boolean batchMode)
Do not instantiate the AnnotationHolderImpl directly, please use the one provided to
Annotator.annotate(PsiElement, AnnotationHolder) instead |
| Modifier and Type | Method and Description |
|---|---|
<R> void |
applyExternalAnnotatorWithContext(PsiFile file,
ExternalAnnotator<?,R> annotator,
R result) |
void |
assertAllAnnotationsCreated() |
Annotation |
createAnnotation(HighlightSeverity severity,
TextRange range,
java.lang.String message)
Creates an annotation with the given severity (colored highlighting only, with no gutter mark and not participating in
"Next Error/Warning" navigation) with the specified message over the specified text range.
|
Annotation |
createAnnotation(HighlightSeverity severity,
TextRange range,
java.lang.String message,
java.lang.String tooltip)
Creates an annotation with the given severity (colored highlighting only, with no gutter mark and not participating in
"Next Error/Warning" navigation) with the specified message and tooltip markup over the specified text range.
|
Annotation |
createErrorAnnotation(ASTNode node,
java.lang.String message)
Creates an error annotation with the specified message over the specified AST node.
|
Annotation |
createErrorAnnotation(PsiElement elt,
java.lang.String message)
Creates an error annotation with the specified message over the specified PSI element.
|
Annotation |
createErrorAnnotation(TextRange range,
java.lang.String message)
Creates an error annotation with the specified message over the specified text range.
|
Annotation |
createInfoAnnotation(ASTNode node,
java.lang.String message)
Creates an information annotation (colored highlighting only, with no gutter mark and not participating in
"Next Error/Warning" navigation) with the specified message over the specified AST node.
|
Annotation |
createInfoAnnotation(PsiElement elt,
java.lang.String message)
Creates an information annotation (colored highlighting only, with no gutter mark and not participating in
"Next Error/Warning" navigation) with the specified message over the specified PSI element.
|
Annotation |
createInfoAnnotation(TextRange range,
java.lang.String message)
Creates an information annotation (colored highlighting only, with no gutter mark and not participating in
"Next Error/Warning" navigation) with the specified message over the specified text range.
|
Annotation |
createWarningAnnotation(ASTNode node,
java.lang.String message)
Creates a warning annotation with the specified message over the specified AST node.
|
Annotation |
createWarningAnnotation(PsiElement elt,
java.lang.String message)
Creates a warning annotation with the specified message over the specified PSI element.
|
Annotation |
createWarningAnnotation(TextRange range,
java.lang.String message)
Creates a warning annotation with the specified message over the specified text range.
|
Annotation |
createWeakWarningAnnotation(ASTNode node,
java.lang.String message)
Creates an annotation with severity
HighlightSeverity.WEAK_WARNING ('weak warning') with the specified
message over the specified AST node. |
Annotation |
createWeakWarningAnnotation(PsiElement elt,
java.lang.String message)
Creates an annotation with severity
HighlightSeverity.WEAK_WARNING ('weak warning') with the specified
message over the specified PSI element. |
Annotation |
createWeakWarningAnnotation(TextRange range,
java.lang.String message)
Creates an annotation with severity
HighlightSeverity.WEAK_WARNING ('weak warning') with the specified
message over the specified text range. |
AnnotationSession |
getCurrentAnnotationSession() |
boolean |
hasAnnotations() |
boolean |
isBatchMode() |
AnnotationBuilder |
newAnnotation(HighlightSeverity severity,
java.lang.String message)
Begin constructing a new annotation.
|
AnnotationBuilder |
newSilentAnnotation(HighlightSeverity severity)
Begin constructing a new annotation with no message.
|
void |
runAnnotatorWithContext(PsiElement element,
Annotator annotator) |
add, add, clear, contains, equals, forEach, get, getModificationCount, indexOf, iterator, remove, set, size, sort, toArray, trimToSizeaddAll, hashCode, lastIndexOf, listIterator, listIterator, removeRange, subListaddAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic AnnotationHolderImpl(AnnotationSession session)
Annotator.annotate(PsiElement, AnnotationHolder) insteadpublic AnnotationHolderImpl(AnnotationSession session, boolean batchMode)
Annotator.annotate(PsiElement, AnnotationHolder) insteadpublic boolean isBatchMode()
isBatchMode in interface AnnotationHolderpublic Annotation createErrorAnnotation(PsiElement elt, java.lang.String message)
AnnotationHoldercreateErrorAnnotation in interface AnnotationHolderelt - the element over which the annotation is created.message - the error message.public Annotation createErrorAnnotation(ASTNode node, java.lang.String message)
AnnotationHoldercreateErrorAnnotation in interface AnnotationHoldernode - the node over which the annotation is created.message - the error message.public Annotation createErrorAnnotation(TextRange range, java.lang.String message)
AnnotationHoldercreateErrorAnnotation in interface AnnotationHolderrange - the text range over which the annotation is created.message - the error message.public Annotation createWarningAnnotation(PsiElement elt, java.lang.String message)
AnnotationHoldercreateWarningAnnotation in interface AnnotationHolderelt - the element over which the annotation is created.message - the warning message.public Annotation createWarningAnnotation(ASTNode node, java.lang.String message)
AnnotationHoldercreateWarningAnnotation in interface AnnotationHoldernode - the node over which the annotation is created.message - the warning message.public Annotation createWarningAnnotation(TextRange range, java.lang.String message)
AnnotationHoldercreateWarningAnnotation in interface AnnotationHolderrange - the text range over which the annotation is created.message - the warning message.public Annotation createWeakWarningAnnotation(PsiElement elt, java.lang.String message)
AnnotationHolderHighlightSeverity.WEAK_WARNING ('weak warning') with the specified
message over the specified PSI element.createWeakWarningAnnotation in interface AnnotationHolderelt - the element over which the annotation is created.message - the info message.public Annotation createWeakWarningAnnotation(ASTNode node, java.lang.String message)
AnnotationHolderHighlightSeverity.WEAK_WARNING ('weak warning') with the specified
message over the specified AST node.createWeakWarningAnnotation in interface AnnotationHoldernode - the node over which the annotation is created.message - the info message.public Annotation createWeakWarningAnnotation(TextRange range, java.lang.String message)
AnnotationHolderHighlightSeverity.WEAK_WARNING ('weak warning') with the specified
message over the specified text range.createWeakWarningAnnotation in interface AnnotationHolderrange - the text range over which the annotation is created.message - the info message.public Annotation createInfoAnnotation(PsiElement elt, java.lang.String message)
AnnotationHoldercreateInfoAnnotation in interface AnnotationHolderelt - the element over which the annotation is created.message - the information message.public Annotation createInfoAnnotation(ASTNode node, java.lang.String message)
AnnotationHoldercreateInfoAnnotation in interface AnnotationHoldernode - the node over which the annotation is created.message - the information message.public Annotation createInfoAnnotation(TextRange range, java.lang.String message)
AnnotationHoldercreateInfoAnnotation in interface AnnotationHolderrange - the text range over which the annotation is created.message - the information message.public Annotation createAnnotation(HighlightSeverity severity, TextRange range, java.lang.String message)
AnnotationHoldercreateAnnotation in interface AnnotationHolderseverity - the severity.range - the text range over which the annotation is created.message - the information message.public Annotation createAnnotation(HighlightSeverity severity, TextRange range, java.lang.String message, java.lang.String tooltip)
AnnotationHoldercreateAnnotation in interface AnnotationHolderseverity - the severity.range - the text range over which the annotation is created.message - the information message.tooltip - the tooltip to show (usually the message, but escaped as HTML and surrounded by a <html> tagpublic boolean hasAnnotations()
public AnnotationSession getCurrentAnnotationSession()
getCurrentAnnotationSession in interface AnnotationHolderpublic AnnotationBuilder newAnnotation(HighlightSeverity severity, java.lang.String message)
AnnotationHolderAnnotationBuilder.create() must be called.
For example: holder.newAnnotation(HighlightSeverity.WARNING, "My warning message").create();
newAnnotation in interface AnnotationHolderseverity - The severity of the annotation.message - The message this annotation will show in the status bar and the tooltip.public AnnotationBuilder newSilentAnnotation(HighlightSeverity severity)
AnnotationHolderAnnotationBuilder.create() must be called.
For example: holder.newSilentAnnotation(HighlightSeverity.WARNING).textAttributes(MY_ATTRIBUTES_KEY).create();
newSilentAnnotation in interface AnnotationHolderseverity - The severity of the annotation.public void runAnnotatorWithContext(PsiElement element, Annotator annotator)
public <R> void applyExternalAnnotatorWithContext(PsiFile file, ExternalAnnotator<?,R> annotator, R result)
public void assertAllAnnotationsCreated()