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


Java AbstractVcs.getDiffProvider方法代码示例

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


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

示例1: actionPerformed

import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Override
protected void actionPerformed(@NotNull VcsContext vcsContext) {

  final VirtualFile file = vcsContext.getSelectedFiles()[0];
  final Project project = vcsContext.getProject();
  final AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(file);
  if (vcs == null) {
    return;
  }
  RevisionSelector selector = vcs.getRevisionSelector();
  final DiffProvider diffProvider = vcs.getDiffProvider();

  if (selector != null) {
    final VcsRevisionNumber vcsRevisionNumber = selector.selectNumber(file);

    if (vcsRevisionNumber != null) {
      DiffActionExecutor.showDiff(diffProvider, vcsRevisionNumber, file, project, VcsBackgroundableActions.COMPARE_WITH);
    }
  }

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SelectAndCompareWithSelectedRevisionAction.java

示例2: fileRecentlyChanged

import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Nullable
@Override
public VcsRevisionNumber fileRecentlyChanged(VirtualFile vf) {
  final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
  final AbstractVcs vcs = vcsManager.getVcsFor(vf);
  if (vcs == null) return null;
  if (vcs.getDiffProvider() instanceof DiffMixin) {
    final VcsRevisionDescription description = ((DiffMixin)vcs.getDiffProvider()).getCurrentRevisionDescription(vf);
    final Date date = description.getRevisionDate();
    return isRecent(date) ? description.getRevisionNumber() : null;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:VcsContentAnnotationImpl.java

示例3: isVisible

import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
protected static boolean isVisible(final VcsContext vcsContext) {
  final Project project = vcsContext.getProject();
  if (project == null) return false;
  final AbstractVcs[] vcss = ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
  for (AbstractVcs vcs : vcss) {
    if (vcs.getDiffProvider() != null) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:AbstractShowDiffAction.java

示例4: isEnabled

import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Nullable
protected static AbstractVcs isEnabled(final VcsContext vcsContext, @Nullable final VcsBackgroundableActions actionKey) {
  if (!(isVisible(vcsContext))) return null;

  final Project project = vcsContext.getProject();
  if (project == null) return null;
  final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);

  final VirtualFile[] selectedFilePaths = vcsContext.getSelectedFiles();
  if (selectedFilePaths.length != 1) return null;

  final VirtualFile selectedFile = selectedFilePaths[0];
  if (selectedFile.isDirectory()) return null;

  if (actionKey != null) {
    final BackgroundableActionEnabledHandler handler = ((ProjectLevelVcsManagerImpl)vcsManager).getBackgroundableActionHandler(actionKey);
    if (handler.isInProgress(VcsBackgroundableActions.keyFrom(selectedFile))) return null;
  }

  final AbstractVcs vcs = vcsManager.getVcsFor(selectedFile);
  if (vcs == null) return null;

  final DiffProvider diffProvider = vcs.getDiffProvider();

  if (diffProvider == null) return null;

  if (AbstractVcs.fileInVcsByFileStatus(project, VcsUtil.getFilePath(selectedFile))) {
    return vcs;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:AbstractShowDiffAction.java

示例5: actionPerformed

import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Override
protected void actionPerformed(@NotNull VcsContext vcsContext) {
  final Project project = vcsContext.getProject();
  if (project == null) return;
  if (ChangeListManager.getInstance(project).isFreezedWithNotification("Can not " + vcsContext.getActionName() + " now")) return;
  final VirtualFile selectedFile = vcsContext.getSelectedFiles()[0];

  final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
  final AbstractVcs vcs = vcsManager.getVcsFor(selectedFile);
  final DiffProvider diffProvider = vcs.getDiffProvider();

  final DiffActionExecutor actionExecutor = getExecutor(diffProvider, selectedFile, project);
  actionExecutor.showDiff();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AbstractShowDiffAction.java


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