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


Java ChangeListManager.getAffectedFiles方法代码示例

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


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

示例1: getAffectedFiles

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@NotNull
private static List<VirtualFile> getAffectedFiles(String changeListName, Project project) {
  final ChangeListManager changeListManager = ChangeListManager.getInstance(project);
  if (changeListName == null) {
    return changeListManager.getAffectedFiles();
  }
  final LocalChangeList changeList = changeListManager.findChangeList(changeListName);
  if (changeList != null) {
    List<VirtualFile> files = new ArrayList<VirtualFile>();
    for (Change change : changeList.getChanges()) {
      final ContentRevision afterRevision = change.getAfterRevision();
      if (afterRevision != null) {
        final VirtualFile file = afterRevision.getFile().getVirtualFile();
        if (file != null) {
          files.add(file);
        }
      }
    }
    return files;
  }

  return Collections.emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:TestDiscoverySearchHelper.java

示例2: getScope

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@NotNull
public AnalysisScope getScope(@NotNull AnalysisUIOptions uiOptions, @NotNull AnalysisScope defaultScope, @NotNull Project project, Module module) {
  AnalysisScope scope;
  if (isProjectScopeSelected()) {
    scope = new AnalysisScope(project);
    uiOptions.SCOPE_TYPE = AnalysisScope.PROJECT;
  }
  else {
    final SearchScope customScope = getCustomScope();
    if (customScope != null) {
      scope = new AnalysisScope(customScope, project);
      uiOptions.SCOPE_TYPE = AnalysisScope.CUSTOM;
      uiOptions.CUSTOM_SCOPE_NAME = customScope.getDisplayName();
    }
    else if (isModuleScopeSelected()) {
      scope = new AnalysisScope(module);
      uiOptions.SCOPE_TYPE = AnalysisScope.MODULE;
    }
    else if (isUncommitedFilesSelected()) {
      final ChangeListManager changeListManager = ChangeListManager.getInstance(project);
      List<VirtualFile> files;
      if (myChangeLists.getSelectedItem() == ALL) {
        files = changeListManager.getAffectedFiles();
      }
      else {
        files = new ArrayList<VirtualFile>();
        for (ChangeList list : changeListManager.getChangeListsCopy()) {
          if (!Comparing.strEqual(list.getName(), (String)myChangeLists.getSelectedItem())) continue;
          final Collection<Change> changes = list.getChanges();
          for (Change change : changes) {
            final ContentRevision afterRevision = change.getAfterRevision();
            if (afterRevision != null) {
              final VirtualFile vFile = afterRevision.getFile().getVirtualFile();
              if (vFile != null) {
                files.add(vFile);
              }
            }
          }
        }
      }
      scope = new AnalysisScope(project, new HashSet<VirtualFile>(files));
      uiOptions.SCOPE_TYPE = AnalysisScope.UNCOMMITTED_FILES;
    }
    else {
      scope = defaultScope;
      uiOptions.SCOPE_TYPE = defaultScope.getScopeType();//just not project scope
    }
  }
  uiOptions.ANALYZE_TEST_SOURCES = isInspectTestSources();
  scope.setIncludeTestSource(isInspectTestSources());
  scope.setScope(getCustomScope());

  FindSettings.getInstance().setDefaultScopeName(scope.getDisplayName());
  return scope;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:56,代码来源:BaseAnalysisActionDialog.java


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