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


Java VcsLogManager类代码示例

本文整理汇总了Java中com.intellij.vcs.log.impl.VcsLogManager的典型用法代码示例。如果您正苦于以下问题:Java VcsLogManager类的具体用法?Java VcsLogManager怎么用?Java VcsLogManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VcsLogManager类属于com.intellij.vcs.log.impl包,在下文中一共展示了VcsLogManager类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProjectUsages

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
  VcsLogManager logManager = VcsLogContentProvider.findLogManager(project);
  VisiblePack dataPack = getDataPack(logManager);
  if (dataPack != null) {
    PermanentGraph<Integer> permanentGraph = dataPack.getPermanentGraph();
    MultiMap<VcsKey, VirtualFile> groupedRoots = groupRootsByVcs(dataPack.getLogProviders());

    Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
    usages.add(new UsageDescriptor("vcs.log.commit.count", permanentGraph.getAllCommits().size()));
    for (VcsKey vcs : groupedRoots.keySet()) {
      //noinspection StringToUpperCaseOrToLowerCaseWithoutLocale
      usages.add(new UsageDescriptor("vcs.log." + vcs.getName().toLowerCase() + ".root.count", groupedRoots.get(vcs).size()));
    }
    return usages;
  }
  return Collections.emptySet();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:VcsLogRepoSizeCollector.java

示例2: getDataPack

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Nullable
private static VisiblePack getDataPack(@Nullable VcsLogManager logManager) {
  if (logManager != null) {
    final VcsLogUiImpl ui = logManager.getLogUi();
    if (ui != null) {
      final Ref<VisiblePack> dataPack = Ref.create();
      ApplicationManager.getApplication().invokeAndWait(new Runnable() {
        @Override
        public void run() {
          dataPack.set(ui.getDataPack());
        }
      }, ModalityState.defaultModalityState());
      return dataPack.get();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:VcsLogRepoSizeCollector.java

示例3: actionPerformed

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  VcsLogUtil.triggerUsage(e);

  VcsLogManager logManager = e.getRequiredData(VcsLogInternalDataKeys.LOG_MANAGER);

  // diagnostic for possible refresh problems
  VcsLogUi ui = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
  if (ui instanceof VcsLogUiImpl) {
    VcsLogFilterer filterer = ((VcsLogUiImpl)ui).getFilterer();
    if (!filterer.isValid()) {
      String message = "Trying to refresh invalid log tab.";
      if (!logManager.getDataManager().getProgress().isRunning()) {
        LOG.error(message);
      } else {
        LOG.warn(message);
      }
      filterer.setValid(true);
    }
  }

  logManager.getDataManager().refreshSoftly();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:RefreshLogAction.java

示例4: MyCommitsHighlighter

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
public MyCommitsHighlighter(@NotNull VcsLogDataHolder logDataHolder,
                            @NotNull VcsLogUiProperties uiProperties,
                            @NotNull VcsLogFilterUi filterUi) {
  myDataHolder = logDataHolder;
  myUiProperties = uiProperties;
  myFilterUi = filterUi;
  // migration to map storage
  if (!myUiProperties.isHighlightMyCommits()) {
    // by default, my commits highlighter was enabled
    // if it was disabled we need to migrate that
    myUiProperties.enableHighlighter(Factory.ID, false);
    myUiProperties.setHighlightMyCommits(true);
  }

  // this is a tmp solution for performance problems of calculating areTheOnlyUsers every repaint (we simply do not want to do that)
  // todo remove this when history2 branch is merged into master (history2 will allow a proper way to fix the problem)
  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      if (myDataHolder.getProject().isDisposed()) return;
      VcsLogManager logManager = VcsLogContentProvider.findLogManager(myDataHolder.getProject());
      if (logManager != null) {
        VcsLogUiImpl logUi = logManager.getLogUi();
        if (logUi != null) {
          logUi.addLogListener(new VcsLogListener() {
            @Override
            public void onChange(@NotNull VcsLogDataPack dataPack, boolean refreshHappened) {
              myAreTheOnlyUsers = areTheOnlyUsers();
            }
          });
        }
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:MyCommitsHighlighter.java

示例5: findLog

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Nullable
private static VcsLog findLog(@NotNull Project project) {
  VcsLogManager manager = VcsLogContentProvider.findLogManager(project);
  if (manager != null) {
    VcsLogUiImpl ui = manager.getLogUi();
    if (ui != null) {
      return ui.getVcsLog();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SelectRevisionInGitLogAction.java

示例6: update

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  Project project = e.getProject();
  if (project == null || !Registry.is("vcs.log.open.another.log.visible", false)) {
    e.getPresentation().setEnabledAndVisible(false);
    return;
  }
  VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
  VcsLogManager logManager = e.getData(VcsLogInternalDataKeys.LOG_MANAGER);
  e.getPresentation()
          .setEnabledAndVisible(logManager != null && projectLog.getLogManager() == logManager); // only for main log (it is a question, how and where we want to open tabs for external logs)
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:OpenAnotherLogTabAction.java

示例7: actionPerformed

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Override
public void actionPerformed(@NotNull AnActionEvent event) {
  final Project project = event.getRequiredData(CommonDataKeys.PROJECT);
  final VcsRevisionNumber revision = getRevisionNumber(event);
  if (revision == null) {
    return;
  }

  boolean logReady = findLog(project) != null;

  final ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
  ContentManager cm = window.getContentManager();
  Content[] contents = cm.getContents();
  for (Content content : contents) {
    if (VcsLogContentProvider.TAB_NAME.equals(content.getDisplayName())) {
      cm.setSelectedContent(content);
      break;
    }
  }

  final VcsLog log = findLog(project);
  if (log == null) {
    showLogNotReadyMessage(project);
    return;
  }

  Runnable selectAndOpenLog = new Runnable() {
    @Override
    public void run() {
      Runnable selectCommit = new Runnable() {
        @Override
        public void run() {
          jumpToRevisionUnderProgress(project, log, revision);
        }
      };

      if (!window.isVisible()) {
        window.activate(selectCommit, true);
      }
      else {
        selectCommit.run();
      }
    }
  };

  if (logReady) {
    selectAndOpenLog.run();
    return;
  }

  VcsLogManager logManager = VcsLogContentProvider.findLogManager(project);
  if (logManager == null) {
    showLogNotReadyMessage(project);
    return;
  }
  VcsLogUiImpl logUi = logManager.getLogUi();
  if (logUi == null) {
    showLogNotReadyMessage(project);
    return;
  }
  logUi.invokeOnChange(selectAndOpenLog);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:63,代码来源:SelectRevisionInGitLogAction.java

示例8: update

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  VcsLogManager logManager = e.getData(VcsLogInternalDataKeys.LOG_MANAGER);
  e.getPresentation().setEnabledAndVisible(logManager != null && e.getData(VcsLogDataKeys.VCS_LOG_UI) != null);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:RefreshLogAction.java

示例9: VcsLogPanel

import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
public VcsLogPanel(@Nonnull VcsLogManager manager, @Nonnull VcsLogUiImpl logUi) {
  super(new BorderLayout());
  myManager = manager;
  add(logUi.getMainFrame().getMainComponent(), BorderLayout.CENTER);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:VcsLogPanel.java


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