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


Java ContainerUtil.subtract方法代码示例

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


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

示例1: setVisible

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void setVisible(@NotNull VirtualFile root, boolean visible) {
  Set<VirtualFile> roots = getAllRoots();

  VcsLogFileFilter previousFilter = myFilterModel.getFilter();
  VcsLogRootFilter rootFilter = previousFilter != null ? previousFilter.getRootFilter() : null;

  Collection<VirtualFile> visibleRoots;
  if (rootFilter == null) {
    if (visible) {
      visibleRoots = roots;
    }
    else {
      visibleRoots = ContainerUtil.subtract(roots, Collections.singleton(root));
    }
  }
  else {
    if (visible) {
      visibleRoots = ContainerUtil.union(new HashSet<VirtualFile>(rootFilter.getRoots()), Collections.singleton(root));
    }
    else {
      visibleRoots = ContainerUtil.subtract(rootFilter.getRoots(), Collections.singleton(root));
    }
  }
  myFilterModel.setFilter(new VcsLogFileFilter(null, new VcsLogRootFilterImpl(visibleRoots)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:StructureFilterPopupComponent.java

示例2: convertToNodeIds

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public Set<Integer> convertToNodeIds(@NotNull Collection<CommitId> commitIds, boolean reportNotFound) {
  Set<Integer> result = ContainerUtil.newHashSet();
  Set<CommitId> matchedIds = ContainerUtil.newHashSet();
  for (int i = 0; i < myCommitIdIndexes.size(); i++) {
    CommitId commitId = myCommitIdIndexes.get(i);
    if (commitIds.contains(commitId)) {
      result.add(i);
      matchedIds.add(commitId);
    }
  }
  if (reportNotFound) {
    Collection<CommitId> unmatchedIds = ContainerUtil.subtract(commitIds, matchedIds);
    if (!unmatchedIds.isEmpty()) {
      LOG.error("Unmatched commit ids " + unmatchedIds);
    }
  }
  for (Map.Entry<Integer, CommitId> entry : myNotLoadCommits.entrySet()) {
    if (commitIds.contains(entry.getValue())) result.add(entry.getKey());
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:PermanentCommitsInfoIml.java

示例3: collectLabelsForRefs

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Map<String, Color> collectLabelsForRefs(@NotNull Collection<VcsRef> refs) {
  if (refs.isEmpty()) {
    return Collections.emptyMap();
  }
  VirtualFile root = refs.iterator().next().getRoot(); // all refs are from the same commit => they have the same root
  refs = ContainerUtil.sorted(refs, myDataHolder.getLogProvider(root).getReferenceManager().getLabelsOrderComparator());
  List<VcsRef> branches = getBranches(refs);
  Collection<VcsRef> tags = ContainerUtil.subtract(refs, branches);
  return getLabelsForRefs(branches, tags);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GraphCommitCellRender.java


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