Java Code Examples for com.intellij.util.containers.ContainerUtil#subtract()
The following examples show how to use
com.intellij.util.containers.ContainerUtil#subtract() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StructureFilterPopupComponent.java From consulo with Apache License 2.0 | 6 votes |
private void setVisible(@Nonnull 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<>(rootFilter.getRoots()), Collections.singleton(root)); } else { visibleRoots = ContainerUtil.subtract(rootFilter.getRoots(), Collections.singleton(root)); } } myFilterModel.setFilter(new VcsLogFileFilter(null, new VcsLogRootFilterImpl(visibleRoots))); }
Example 2
Source File: PermanentCommitsInfoImpl.java From consulo with Apache License 2.0 | 6 votes |
@Nonnull public Set<Integer> convertToNodeIds(@Nonnull 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.warn("Unmatched commit ids " + unmatchedIds); } } for (Map.Entry<Integer, CommitId> entry : myNotLoadCommits.entrySet()) { if (commitIds.contains(entry.getValue())) result.add(entry.getKey()); } return result; }
Example 3
Source File: ApplyPatchDifferentiatedDialog.java From consulo with Apache License 2.0 | 5 votes |
@Nonnull private List<FilePatch> getOriginalRemaining() { Collection<AbstractFilePatchInProgress> notIncluded = ContainerUtil.subtract(myPatches, getIncluded()); List<FilePatch> remainingOriginal = ContainerUtil.newArrayList(); for (AbstractFilePatchInProgress progress : notIncluded) { progress.reset(); remainingOriginal.add(progress.getPatch()); } return remainingOriginal; }