|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.intellij.lang.annotation.Annotation
public final class Annotation
Defines an annotation, which is displayed as a gutter bar mark or an extra highlight in the editor.
Annotator,
AnnotationHolder,
RangeHighlighter| Constructor Summary | |
|---|---|
Annotation(int startOffset,
int endOffset,
HighlightSeverity severity,
java.lang.String message,
java.lang.String tooltip)
Creates an instance of the annotation. |
|
| Method Summary | |
|---|---|
int |
getEndOffset()
Returns the end offset of the text range covered by the annotation. |
ProblemHighlightType |
getHighlightType()
If the annotation matches one of commonly encountered problem types, returns the ID of that problem type so that an appropriate color can be used for highlighting the annotation. |
java.lang.String |
getMessage()
Returns the description of the annotation (shown in the status bar or by "View | Error Description" action). |
java.util.List<Pair<IntentionAction,TextRange>> |
getQuickFixes()
Returns the list of quick fixes registered for the annotation. |
HighlightSeverity |
getSeverity()
Returns the severity of the problem indicated by the annotation (highlight, warning or error). |
int |
getStartOffset()
Returns the start offset of the text range covered by the annotation. |
TextAttributesKey |
getTextAttributes()
Returns the text attribute key used for highlighting the annotation. |
java.lang.String |
getTooltip()
Returns the tooltip for the annotation (shown when hovering the mouse in the gutter bar). |
boolean |
isAfterEndOfLine()
Returns the flag indicating whether the annotation is shown after the end of line containing it. |
boolean |
needsUpdateOnTyping()
Gets a flag indicating what happens with the annotation when the user starts typing. |
void |
registerFix(IntentionAction fix)
Registers a quick fix for the annotation. |
void |
registerFix(IntentionAction fix,
TextRange range)
Registers a quick fix for the annotation which is only available on a particular range of text within the annotation. |
void |
setAfterEndOfLine(boolean afterEndOfLine)
Sets the flag indicating whether the annotation is shown after the end of line containing it. |
void |
setHighlightType(ProblemHighlightType highlightType)
If the annotation matches one of commonly encountered problem types, sets the ID of that problem type so that an appropriate color can be used for highlighting the annotation. |
void |
setNeedsUpdateOnTyping(boolean b)
Sets a flag indicating what happens with the annotation when the user starts typing. |
void |
setTextAttributes(TextAttributesKey enforcedAttributes)
Sets the text attributes key used for highlighting the annotation. |
void |
setTooltip(java.lang.String tooltip)
Sets the tooltip for the annotation (shown when hovering the mouse in the gutter bar). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Annotation(int startOffset,
int endOffset,
HighlightSeverity severity,
java.lang.String message,
java.lang.String tooltip)
startOffset - the start offset of the text range covered by the annotation.endOffset - the end offset of the text range covered by the annotation.severity - the severity of the problem indicated by the annotation (highlight, warning or error).message - the description of the annotation (shown in the status bar or by "View | Error Description" action)tooltip - the tooltip for the annotation (shown when hovering the mouse in the gutter bar)AnnotationHolder.createErrorAnnotation(com.intellij.psi.PsiElement, java.lang.String),
AnnotationHolder.createWarningAnnotation(com.intellij.psi.PsiElement, java.lang.String),
AnnotationHolder.createInfoAnnotation(com.intellij.psi.PsiElement, java.lang.String)| Method Detail |
|---|
public void registerFix(IntentionAction fix)
fix - the quick fix implementation.
public void registerFix(IntentionAction fix,
TextRange range)
fix - the quick fix implementation.range - the text range (relative to the document) where the quick fix is available.public void setNeedsUpdateOnTyping(boolean b)
b - whether the annotation needs to be removed on typing.needsUpdateOnTyping()public boolean needsUpdateOnTyping()
setNeedsUpdateOnTyping(boolean)public int getStartOffset()
public int getEndOffset()
public HighlightSeverity getSeverity()
public ProblemHighlightType getHighlightType()
public TextAttributesKey getTextAttributes()
@Nullable public java.util.List<Pair<IntentionAction,TextRange>> getQuickFixes()
public java.lang.String getMessage()
public java.lang.String getTooltip()
public void setTooltip(java.lang.String tooltip)
tooltip - the tooltip text.public void setHighlightType(ProblemHighlightType highlightType)
highlightType - the ID of the problem type.public void setTextAttributes(TextAttributesKey enforcedAttributes)
enforcedAttributes - the text attributes key for highlighting,public boolean isAfterEndOfLine()
public void setAfterEndOfLine(boolean afterEndOfLine)
afterEndOfLine - true if the annotation should be shown after the end of line, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||