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


Java AbstractVcs.getProject方法代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.AbstractVcs.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractVcs.getProject方法的具体用法?Java AbstractVcs.getProject怎么用?Java AbstractVcs.getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.vcs.AbstractVcs的用法示例。


在下文中一共展示了AbstractVcs.getProject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FileHistorySessionPartner

import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
public FileHistorySessionPartner(final VcsHistoryProvider vcsHistoryProvider,
                                 @NotNull final FilePath path,
                                 final AbstractVcs vcs,
                                 final FileHistoryRefresherI refresherI) {
  myVcsHistoryProvider = vcsHistoryProvider;
  myPath = path;
  myLimitHistoryCheck = new LimitHistoryCheck(vcs.getProject(), path.getPath());
  myVcs = vcs;
  myRefresherI = refresherI;
  Consumer<List<VcsFileRevision>> sessionRefresher = new Consumer<List<VcsFileRevision>>() {
    public void consume(List<VcsFileRevision> vcsFileRevisions) {
      // TODO: Logic should be revised to we could just append some revisions to history panel instead of creating and showing new history
      // TODO: session
      mySession.getRevisionList().addAll(vcsFileRevisions);
      final VcsHistorySession copy = mySession.copyWithCachedRevision();
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        public void run() {
          ensureHistoryPanelCreated().getHistoryPanelRefresh().consume(copy);
        }
      });
    }
  };
  myBuffer = new BufferedListConsumer<VcsFileRevision>(5, sessionRefresher, 1000) {
    @Override
    protected void invokeConsumer(@NotNull Runnable consumerRunnable) {
      // Do not invoke in arbitrary background thread as due to parallel execution this could lead to cases when invokeLater() (from
      // sessionRefresher) is scheduled at first for history session with (as an example) 10 revisions (new buffered list) and then with
      // 5 revisions (previous buffered list). And so incorrect UI is shown to the user.
      consumerRunnable.run();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:FileHistorySessionPartner.java


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