當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。