本文整理汇总了Java中com.intellij.util.containers.MultiMap.putAllValues方法的典型用法代码示例。如果您正苦于以下问题:Java MultiMap.putAllValues方法的具体用法?Java MultiMap.putAllValues怎么用?Java MultiMap.putAllValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.MultiMap
的用法示例。
在下文中一共展示了MultiMap.putAllValues方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkVcsRootsAreTracked
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
public void checkVcsRootsAreTracked(final MultiMap<String, String> vcses) throws VcsException {
if (vcses.isEmpty()) return;
final MultiMap<String, String> copy = new MultiMap<String, String>();
copy.putAllValues(vcses);
if (! checkForInMemory(copy)) return;
final HashSet<String> vcsNamesSet = new HashSet<String>(vcses.keySet());
for (Iterator<String> iterator = vcsNamesSet.iterator(); iterator.hasNext(); ) {
final String key = iterator.next();
if (myKnownRepositoryLocations.exists(key)) {
iterator.remove();
}
}
if (! vcsNamesSet.isEmpty()) {
ensureVcsAreInDB(vcsNamesSet);
}
final Set<Long> rootIdsToCheck = ensurePathsAreInDB(copy);
if (! rootIdsToCheck.isEmpty()) {
updateLastRevisions(rootIdsToCheck);
}
}
示例2: calculateInvalidated
import com.intellij.util.containers.MultiMap; //导入方法依赖的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());
}
示例3: getEverythingDirtyRoots
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
private MultiMap<AbstractVcs, FilePath> getEverythingDirtyRoots() {
MultiMap<AbstractVcs, FilePath> dirtyRoots = MultiMap.createSet();
dirtyRoots.putAllValues(groupByVcs(toFilePaths(DefaultVcsRootPolicy.getInstance(myProject).getDirtyRoots())));
List<VcsDirectoryMapping> mappings = myVcsManager.getDirectoryMappings();
for (VcsDirectoryMapping mapping : mappings) {
if (!mapping.isDefaultMapping() && mapping.getVcs() != null) {
AbstractVcs vcs = myVcsManager.findVcsByName(mapping.getVcs());
if (vcs != null) {
dirtyRoots.putValue(vcs, VcsUtil.getFilePath(mapping.getDirectory(), true));
}
}
}
return dirtyRoots;
}
示例4: fireNotifications
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private void fireNotifications() {
final MultiMap<ConfigurationErrorType, ConfigurationErrorDescription> descriptionsMap = new MultiMap<ConfigurationErrorType, ConfigurationErrorDescription>();
synchronized (myLock) {
if (myErrors.isEmpty()) return;
descriptionsMap.putAllValues(myErrors);
myErrors.clear();
}
for (final ConfigurationErrorType type : descriptionsMap.keySet()) {
final Collection<ConfigurationErrorDescription> descriptions = descriptionsMap.get(type);
if (descriptions.isEmpty()) continue;
final String invalidElements = getInvalidElementsString(type, descriptions);
final String errorText = ProjectBundle.message("error.message.configuration.cannot.load") + " " + invalidElements + " <a href=\"\">Details...</a>";
Notifications.Bus.notify(new Notification("Project Loading Error", "Error Loading Project", errorText, NotificationType.ERROR,
new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification,
@NotNull HyperlinkEvent event) {
final List<ConfigurationErrorDescription> validDescriptions =
ContainerUtil.findAll(descriptions, new Condition<ConfigurationErrorDescription>() {
@Override
public boolean value(ConfigurationErrorDescription errorDescription) {
return errorDescription.isValid();
}
});
RemoveInvalidElementsDialog
.showDialog(myProject, CommonBundle.getErrorTitle(), type, invalidElements,
validDescriptions);
notification.expire();
}
}), myProject);
}
}
示例5: buildTree
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
public Set<PsiFile> buildTree(DefaultMutableTreeNode root, ConfigFileSearcher... searchers) {
final Set<PsiFile> psiFiles = new com.intellij.util.containers.HashSet<PsiFile>();
final MultiMap<Module, PsiFile> files = new MultiMap<Module, PsiFile>();
final MultiMap<VirtualFile, PsiFile> jars = new MultiMap<VirtualFile, PsiFile>();
final MultiMap<VirtualFile, PsiFile> virtualFiles = new MultiMap<VirtualFile, PsiFile>();
for (ConfigFileSearcher searcher : searchers) {
files.putAllValues(searcher.getFilesByModules());
jars.putAllValues(searcher.getJars());
virtualFiles.putAllValues(searcher.getVirtualFiles());
}
psiFiles.addAll(buildModuleNodes(files, jars, root));
for (Map.Entry<VirtualFile, Collection<PsiFile>> entry : virtualFiles.entrySet()) {
DefaultMutableTreeNode node = createFileNode(entry.getKey());
List<PsiFile> list = new ArrayList<PsiFile>(entry.getValue());
Collections.sort(list, FILE_COMPARATOR);
for (PsiFile file : list) {
node.add(createFileNode(file));
}
root.add(node);
}
return psiFiles;
}
示例6: doTest
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private void doTest(final boolean checkMembersMovedCount,
String conflictMessage,
RefactoringTestUtil.MemberDescriptor... membersToFind) {
final MultiMap<PsiElement, String> conflictsMap = new MultiMap<>();
configureByFile(BASE_PATH + getTestName(false) + ".java");
PsiElement elementAt = getFile().findElementAt(getEditor().getCaretModel().getOffset());
final PsiClass sourceClass = PsiTreeUtil.getParentOfType(elementAt, PsiClass.class);
assertNotNull(sourceClass);
PsiClass targetClass = sourceClass.getSuperClass();
assertNotNull(targetClass);
if (!targetClass.isWritable()) {
final PsiClass[] interfaces = sourceClass.getInterfaces();
assertEquals(1, interfaces.length);
assertTrue(interfaces[0].isWritable());
targetClass = interfaces[0];
}
final MemberInfo[] infos = RefactoringTestUtil.findMembers(sourceClass, membersToFind);
final int[] countMoved = {0};
final MoveMemberListener listener = (aClass, member) -> {
assertEquals(sourceClass, aClass);
countMoved[0]++;
};
JavaRefactoringListenerManager.getInstance(getProject()).addMoveMembersListener(listener);
final PsiDirectory targetDirectory = targetClass.getContainingFile().getContainingDirectory();
final PsiPackage targetPackage = targetDirectory != null ? JavaDirectoryService.getInstance().getPackage(targetDirectory) : null;
conflictsMap.putAllValues(
PullUpConflictsUtil
.checkConflicts(infos, sourceClass, targetClass, targetPackage, targetDirectory,
psiMethod -> PullUpProcessor.checkedInterfacesContain(Arrays.asList(infos), psiMethod))
);
final PullUpProcessor helper = new PullUpProcessor(sourceClass, targetClass, infos, new DocCommentPolicy(DocCommentPolicy.ASIS));
helper.run();
UIUtil.dispatchAllInvocationEvents();
JavaRefactoringListenerManager.getInstance(getProject()).removeMoveMembersListener(listener);
if (conflictMessage != null && conflictsMap.isEmpty()) {
fail("Conflict was not detected");
}
if (conflictMessage == null && !conflictsMap.isEmpty()) {
fail(conflictsMap.values().iterator().next());
}
if (conflictMessage != null && !IGNORE_CONFLICTS.equals(conflictMessage)) {
assertEquals(conflictMessage, conflictsMap.values().iterator().next());
return;
}
if (checkMembersMovedCount) {
assertEquals(countMoved[0], membersToFind.length);
}
checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
}