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


Java ContainerUtil.union方法代码示例

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


在下文中一共展示了ContainerUtil.union方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getAllVisibleRoots

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static Set<VirtualFile> getAllVisibleRoots(@NotNull Collection<VirtualFile> roots,
                                                  @Nullable VcsLogRootFilter rootFilter,
                                                  @Nullable VcsLogStructureFilter structureFilter) {
  if (rootFilter == null && structureFilter == null) return new HashSet<VirtualFile>(roots);

  Collection<VirtualFile> fromRootFilter;
  if (rootFilter != null) {
    fromRootFilter = rootFilter.getRoots();
  }
  else {
    fromRootFilter = roots;
  }

  Collection<VirtualFile> fromStructureFilter;
  if (structureFilter != null) {
    Pair<Set<VirtualFile>, MultiMap<VirtualFile, VirtualFile>> rootsAndFiles =
      collectRoots(structureFilter.getFiles(), new HashSet<VirtualFile>(roots));
    fromStructureFilter = ContainerUtil.union(rootsAndFiles.first, rootsAndFiles.second.keySet());
  }
  else {
    fromStructureFilter = roots;
  }

  return new HashSet<VirtualFile>(ContainerUtil.intersection(fromRootFilter, fromStructureFilter));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:VcsLogUtil.java

示例3: getGreenFragmentForCollapse

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public GreenFragment getGreenFragmentForCollapse(int startNode, int maxWalkSize) {
  if (myRedNodes.value(startNode)) return new GreenFragment(null, null, Collections.<Integer>emptySet());
  Integer upRedNode = getNearRedNode(startNode, maxWalkSize, true);
  Integer downRedNode = getNearRedNode(startNode, maxWalkSize, false);

  Set<Integer> upPart =
    upRedNode != null ? getMiddleNodes(upRedNode, startNode, false) : getWalkNodes(startNode, true, createStopFunction(maxWalkSize));

  Set<Integer> downPart =
    downRedNode != null ? getMiddleNodes(startNode, downRedNode, false) : getWalkNodes(startNode, false, createStopFunction(maxWalkSize));

  Set<Integer> middleNodes = ContainerUtil.union(upPart, downPart);
  if (upRedNode != null) middleNodes.remove(upRedNode);
  if (downRedNode != null) middleNodes.remove(downRedNode);

  return new GreenFragment(upRedNode, downRedNode, middleNodes);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:FragmentGenerator.java

示例4: calculateInvalidated

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private VcsInvalidated calculateInvalidated(@NotNull DirtBuilder dirt) {
  MultiMap<AbstractVcs, FilePath> files = dirt.getFilesForVcs();
  MultiMap<AbstractVcs, FilePath> dirs = dirt.getDirsForVcs();
  if (dirt.isEverythingDirty()) {
    dirs.putAllValues(getEverythingDirtyRoots());
  }
  Set<AbstractVcs> keys = ContainerUtil.union(files.keySet(), dirs.keySet());

  Map<AbstractVcs, VcsDirtyScopeImpl> scopes = ContainerUtil.newHashMap();
  for (AbstractVcs key : keys) {
    VcsDirtyScopeImpl scope = new VcsDirtyScopeImpl(key, myProject);
    scopes.put(key, scope);
    scope.addDirtyData(dirs.get(key), files.get(key));
  }

  return new VcsInvalidated(new ArrayList<VcsDirtyScope>(scopes.values()), dirt.isEverythingDirty());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:VcsDirtyScopeManagerImpl.java

示例5: compute

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
protected FunctionContext compute(final XmlFile xmlFile, Void p) {
  final FunctionContext base = Xslt2FunctionContext.getInstance();
  return new FunctionContext() {
    @Override
    public Map<Pair<QName, Integer>, Function> getFunctions() {
      return ContainerUtil.union(base.getFunctions(), getCustomFunctions(xmlFile));
    }

    @Override
    public boolean allowsExtensions() {
      return base.allowsExtensions();
    }

    @Override
    public Function resolve(QName name, int argCount) {
      final Function f = base.resolve(name, argCount);
      if (f == null) {
        return resolveCustomFunction(xmlFile, name, argCount);
      }
      return f;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:Xslt2ContextProvider.java

示例6: values

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public Collection<VirtualFile> values() {
  return ContainerUtil.union(mySet, myVcsIgnoredSet);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MapIgnoredFilesHolder.java

示例7: createFunctionMap

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
protected Map<Pair<QName, Integer>, Function> createFunctionMap(ContextType contextType) {
  return ContainerUtil.union(XSLT2_FUNCTIONS, super.createFunctionMap(contextType));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:Xslt2FunctionContext.java

示例8: createFunctionMap

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
protected Map<Pair<QName, Integer>, Function> createFunctionMap(ContextType contextType) {
  return ContainerUtil.union(XSLT_FUNCTIONS, super.createFunctionMap(contextType));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:XsltFunctionContext.java


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