本文整理汇总了Java中com.intellij.openapi.vcs.annotate.VcsAnnotation类的典型用法代码示例。如果您正苦于以下问题:Java VcsAnnotation类的具体用法?Java VcsAnnotation怎么用?Java VcsAnnotation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VcsAnnotation类属于com.intellij.openapi.vcs.annotate包,在下文中一共展示了VcsAnnotation类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadHistoryInBackgroundToCache
import com.intellij.openapi.vcs.annotate.VcsAnnotation; //导入依赖的package包/类
private void loadHistoryInBackgroundToCache(final VcsRevisionNumber revisionNumber,
final FilePath filePath,
final VcsAnnotation vcsAnnotation) {
ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
@Override
public void run() {
try {
getHistory(revisionNumber, filePath, myVcs.getVcsHistoryProvider(), vcsAnnotation.getFirstRevision());
}
catch (VcsException e) {
LOG.info(e);
}
}
});
}
示例2: VcsHistoryCache
import com.intellij.openapi.vcs.annotate.VcsAnnotation; //导入依赖的package包/类
public VcsHistoryCache() {
myLock = new Object();
myHistoryCache = new SLRUMap<HistoryCacheBaseKey, CachedHistory>(10, 10);
myAnnotationCache = new SLRUMap<HistoryCacheWithRevisionKey, VcsAnnotation>(10, 5);
//myContentCache = new SLRUMap<HistoryCacheWithRevisionKey, String>(20, 20);
}
示例3: put
import com.intellij.openapi.vcs.annotate.VcsAnnotation; //导入依赖的package包/类
public void put(@NotNull final FilePath filePath, @NotNull final VcsKey vcsKey, @NotNull final VcsRevisionNumber number,
@NotNull final VcsAnnotation vcsAnnotation) {
synchronized (myLock) {
myAnnotationCache.put(new HistoryCacheWithRevisionKey(filePath, vcsKey, number), vcsAnnotation);
}
}
示例4: get
import com.intellij.openapi.vcs.annotate.VcsAnnotation; //导入依赖的package包/类
public VcsAnnotation get(@NotNull final FilePath filePath, @NotNull final VcsKey vcsKey, @NotNull final VcsRevisionNumber number) {
synchronized (myLock) {
return myAnnotationCache.get(new HistoryCacheWithRevisionKey(filePath, vcsKey, number));
}
}
示例5: annotate
import com.intellij.openapi.vcs.annotate.VcsAnnotation; //导入依赖的package包/类
/**
* @param currentRevision - just a hint for optimization
*/
private FileAnnotation annotate(VirtualFile file, final VcsRevisionNumber revisionNumber, final boolean currentRevision,
final ThrowableComputable<FileAnnotation, VcsException> delegate) throws VcsException {
final AnnotationProvider annotationProvider = myAnnotationProvider;
final FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(file);
final VcsCacheableAnnotationProvider cacheableAnnotationProvider = (VcsCacheableAnnotationProvider)annotationProvider;
VcsAnnotation vcsAnnotation = null;
if (revisionNumber != null) {
vcsAnnotation = myCache.get(VcsContextFactory.SERVICE.getInstance().createFilePathOn(file), myVcs.getKeyInstanceMethod(), revisionNumber);
}
if (vcsAnnotation != null) {
final VcsHistoryProvider historyProvider = myVcs.getVcsHistoryProvider();
final VcsAbstractHistorySession history = getHistory(revisionNumber, filePath, historyProvider, vcsAnnotation.getFirstRevision());
if (history == null) return null;
// question is whether we need "not moved" path here?
final ContentRevision fileContent = myVcs.getDiffProvider().createFileContent(revisionNumber, file);
final FileAnnotation restored = cacheableAnnotationProvider.
restore(vcsAnnotation, history, fileContent.getContent(), currentRevision,
revisionNumber);
if (restored != null) {
return restored;
}
}
final FileAnnotation fileAnnotation = delegate.compute();
vcsAnnotation = cacheableAnnotationProvider.createCacheable(fileAnnotation);
if (vcsAnnotation == null) return fileAnnotation;
if (revisionNumber != null) {
myCache.put(filePath, myVcs.getKeyInstanceMethod(), revisionNumber, vcsAnnotation);
}
if (myVcs.getVcsHistoryProvider() instanceof VcsCacheableHistorySessionFactory) {
loadHistoryInBackgroundToCache(revisionNumber, filePath, vcsAnnotation);
}
return fileAnnotation;
}
示例6: put
import com.intellij.openapi.vcs.annotate.VcsAnnotation; //导入依赖的package包/类
public void put(@Nonnull final FilePath filePath, @Nonnull final VcsKey vcsKey, @Nonnull final VcsRevisionNumber number,
@Nonnull final VcsAnnotation vcsAnnotation) {
synchronized (myLock) {
myAnnotationCache.put(new HistoryCacheWithRevisionKey(filePath, vcsKey, number), vcsAnnotation);
}
}
示例7: get
import com.intellij.openapi.vcs.annotate.VcsAnnotation; //导入依赖的package包/类
public VcsAnnotation get(@Nonnull final FilePath filePath, @Nonnull final VcsKey vcsKey, @Nonnull final VcsRevisionNumber number) {
synchronized (myLock) {
return myAnnotationCache.get(new HistoryCacheWithRevisionKey(filePath, vcsKey, number));
}
}
示例8: annotate
import com.intellij.openapi.vcs.annotate.VcsAnnotation; //导入依赖的package包/类
/**
* @param currentRevision - just a hint for optimization
*/
private FileAnnotation annotate(VirtualFile file, final VcsRevisionNumber revisionNumber, final boolean currentRevision,
final ThrowableComputable<FileAnnotation, VcsException> delegate) throws VcsException {
final AnnotationProvider annotationProvider = myAnnotationProvider;
final FilePath filePath = VcsUtil.getFilePath(file);
final VcsCacheableAnnotationProvider cacheableAnnotationProvider = (VcsCacheableAnnotationProvider)annotationProvider;
VcsAnnotation vcsAnnotation = null;
if (revisionNumber != null) {
Object cachedData = myCache.get(filePath, myVcs.getKeyInstanceMethod(), revisionNumber);
vcsAnnotation = ObjectUtils.tryCast(cachedData, VcsAnnotation.class);
}
if (vcsAnnotation != null) {
final VcsHistoryProvider historyProvider = myVcs.getVcsHistoryProvider();
final VcsAbstractHistorySession history = getHistory(revisionNumber, filePath, historyProvider, vcsAnnotation.getFirstRevision());
if (history == null) return null;
// question is whether we need "not moved" path here?
final ContentRevision fileContent = myVcs.getDiffProvider().createFileContent(revisionNumber, file);
final FileAnnotation restored = cacheableAnnotationProvider.
restore(vcsAnnotation, history, fileContent.getContent(), currentRevision,
revisionNumber);
if (restored != null) {
return restored;
}
}
final FileAnnotation fileAnnotation = delegate.compute();
vcsAnnotation = cacheableAnnotationProvider.createCacheable(fileAnnotation);
if (vcsAnnotation == null) return fileAnnotation;
if (revisionNumber != null) {
myCache.put(filePath, myVcs.getKeyInstanceMethod(), revisionNumber, vcsAnnotation);
}
if (myVcs.getVcsHistoryProvider() instanceof VcsCacheableHistorySessionFactory) {
loadHistoryInBackgroundToCache(revisionNumber, filePath, vcsAnnotation);
}
return fileAnnotation;
}