当前位置: 首页>>代码示例>>Java>>正文


Java VcsAnnotation类代码示例

本文整理汇总了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);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:VcsAnnotationCachedProxy.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:VcsHistoryCache.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:VcsHistoryCache.java

示例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));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:VcsHistoryCache.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:VcsAnnotationCachedProxy.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:VcsHistoryCache.java

示例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));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:VcsHistoryCache.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:45,代码来源:VcsAnnotationCachedProxy.java


注:本文中的com.intellij.openapi.vcs.annotate.VcsAnnotation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。