本文整理汇总了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)));
}
示例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));
}
示例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);
}
示例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());
}
示例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;
}
};
}
示例6: values
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public Collection<VirtualFile> values() {
return ContainerUtil.union(mySet, myVcsIgnoredSet);
}
示例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));
}
示例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));
}