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, trimToSize
addAll, hashCode, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public AnnotationHolderImpl(AnnotationSession session)
Annotator.annotate(PsiElement, AnnotationHolder)
insteadpublic AnnotationHolderImpl(AnnotationSession session, boolean batchMode)
Annotator.annotate(PsiElement, AnnotationHolder)
insteadpublic boolean isBatchMode()
isBatchMode
in interface AnnotationHolder
public Annotation createErrorAnnotation(PsiElement elt, java.lang.String message)
AnnotationHolder
createErrorAnnotation
in interface AnnotationHolder
elt
- the element over which the annotation is created.message
- the error message.public Annotation createErrorAnnotation(ASTNode node, java.lang.String message)
AnnotationHolder
createErrorAnnotation
in interface AnnotationHolder
node
- the node over which the annotation is created.message
- the error message.public Annotation createErrorAnnotation(TextRange range, java.lang.String message)
AnnotationHolder
createErrorAnnotation
in interface AnnotationHolder
range
- the text range over which the annotation is created.message
- the error message.public Annotation createWarningAnnotation(PsiElement elt, java.lang.String message)
AnnotationHolder
createWarningAnnotation
in interface AnnotationHolder
elt
- the element over which the annotation is created.message
- the warning message.public Annotation createWarningAnnotation(ASTNode node, java.lang.String message)
AnnotationHolder
createWarningAnnotation
in interface AnnotationHolder
node
- the node over which the annotation is created.message
- the warning message.public Annotation createWarningAnnotation(TextRange range, java.lang.String message)
AnnotationHolder
createWarningAnnotation
in interface AnnotationHolder
range
- the text range over which the annotation is created.message
- the warning message.public Annotation createWeakWarningAnnotation(PsiElement elt, java.lang.String message)
AnnotationHolder
HighlightSeverity.WEAK_WARNING
('weak warning') with the specified
message over the specified PSI element.createWeakWarningAnnotation
in interface AnnotationHolder
elt
- the element over which the annotation is created.message
- the info message.public Annotation createWeakWarningAnnotation(ASTNode node, java.lang.String message)
AnnotationHolder
HighlightSeverity.WEAK_WARNING
('weak warning') with the specified
message over the specified AST node.createWeakWarningAnnotation
in interface AnnotationHolder
node
- the node over which the annotation is created.message
- the info message.public Annotation createWeakWarningAnnotation(TextRange range, java.lang.String message)
AnnotationHolder
HighlightSeverity.WEAK_WARNING
('weak warning') with the specified
message over the specified text range.createWeakWarningAnnotation
in interface AnnotationHolder
range
- the text range over which the annotation is created.message
- the info message.public Annotation createInfoAnnotation(PsiElement elt, java.lang.String message)
AnnotationHolder
createInfoAnnotation
in interface AnnotationHolder
elt
- the element over which the annotation is created.message
- the information message.public Annotation createInfoAnnotation(ASTNode node, java.lang.String message)
AnnotationHolder
createInfoAnnotation
in interface AnnotationHolder
node
- the node over which the annotation is created.message
- the information message.public Annotation createInfoAnnotation(TextRange range, java.lang.String message)
AnnotationHolder
createInfoAnnotation
in interface AnnotationHolder
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)
AnnotationHolder
createAnnotation
in interface AnnotationHolder
severity
- 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)
AnnotationHolder
createAnnotation
in interface AnnotationHolder
severity
- 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 AnnotationHolder
public AnnotationBuilder newAnnotation(HighlightSeverity severity, java.lang.String message)
AnnotationHolder
AnnotationBuilder.create()
must be called.
For example: holder.newAnnotation(HighlightSeverity.WARNING, "My warning message").create();
newAnnotation
in interface AnnotationHolder
severity
- The severity of the annotation.message
- The message this annotation will show in the status bar and the tooltip.public AnnotationBuilder newSilentAnnotation(HighlightSeverity severity)
AnnotationHolder
AnnotationBuilder.create()
must be called.
For example: holder.newSilentAnnotation(HighlightSeverity.WARNING).textAttributes(MY_ATTRIBUTES_KEY).create();
newSilentAnnotation
in interface AnnotationHolder
severity
- 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()