public abstract class FileAnnotation
extends java.lang.Object
AnnotationProvider
Modifier and Type | Class and Description |
---|---|
static interface |
FileAnnotation.AuthorsMappingProvider |
static interface |
FileAnnotation.CurrentFileRevisionProvider |
static interface |
FileAnnotation.PreviousFileRevisionProvider |
static interface |
FileAnnotation.RevisionChangesProvider |
static interface |
FileAnnotation.RevisionsOrderProvider |
Modifier | Constructor and Description |
---|---|
protected |
FileAnnotation(Project project) |
protected FileAnnotation(Project project)
public Project getProject()
public VcsKey getVcsKey()
public VirtualFile getFile()
If annotations are called on a local file, it can be this file.
If annotations are called on a specific revision, it can be corresponding VcsVirtualFile
.
Note: file content might differ from content in annotated revision getAnnotatedContent()
.
public abstract java.lang.String getAnnotatedContent()
It might differ from getFile()
content. Ex: annotations for a local file, that has non-committed changes.
In this case UpToDateLineNumberProvider
will be used to transfer lines between local and annotated revisions.
public abstract VcsRevisionNumber getCurrentRevision()
This information might be used to close annotations on local file if current revision was changed,
and invocation of AnnotationProvider on this file will produce different results - see isBaseRevisionChanged(com.intellij.openapi.vcs.history.VcsRevisionNumber)
.
public boolean isBaseRevisionChanged(VcsRevisionNumber number)
number
- current revision number DiffProvider.getCurrentRevision(VirtualFile)
public abstract void dispose()
public abstract LineAnnotationAspect [] getAspects()
public abstract int getLineCount()
public abstract java.lang.String getToolTip(int lineNumber)
public java.lang.String getHtmlToolTip(int lineNumber)
public abstract VcsRevisionNumber getLineRevisionNumber(int lineNumber)
public abstract java.util.Date getLineDate(int lineNumber)
getLineRevisionNumber(int)
public abstract java.util.List<VcsFileRevision> getRevisions()
Date
or show file modification number for a revision.public AnnotationSourceSwitcher getAnnotationSourceSwitcher()
Ex: in SVN it's possible to show revision that modified line - "svn blame -g", or the commit that merged that change into current branch - "svn blame".
when "show merge sources" is turned on, getLineRevisionNumber(int)
returns merge source revision,
while originalRevision(int)
returns merge revision.
public VcsRevisionNumber originalRevision(int lineNumber)
getAnnotationSourceSwitcher()
,
getLineRevisionNumber(int)
public boolean isClosed()
public final void close()
public final void reload(FileAnnotation newFileAnnotation)
newFileAnnotation
- annotations to be shown or `null` to load annotations againpublic final void setCloser(java.lang.Runnable closer)
close()
public final void setReloader(Consumer<? super FileAnnotation> reloader)
reload(FileAnnotation)
@Deprecated public boolean revisionsNotEmpty()
public FileAnnotation.CurrentFileRevisionProvider getCurrentFileRevisionProvider()
public FileAnnotation.PreviousFileRevisionProvider getPreviousFileRevisionProvider()
public FileAnnotation.AuthorsMappingProvider getAuthorsMappingProvider()
public FileAnnotation.RevisionsOrderProvider getRevisionsOrderProvider()
public FileAnnotation.RevisionChangesProvider getRevisionsChangesProvider()
public static java.lang.String formatDate(java.util.Date date)