本文整理汇总了Java中com.intellij.util.containers.MultiMap.put方法的典型用法代码示例。如果您正苦于以下问题:Java MultiMap.put方法的具体用法?Java MultiMap.put怎么用?Java MultiMap.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.MultiMap
的用法示例。
在下文中一共展示了MultiMap.put方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerConflict
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private static void registerConflict(PsiJavaCodeReferenceElement reference,
PsiElement resolved,
HashMap<PsiElement, HashSet<PsiElement>> reported, MultiMap<PsiElement, String> conflicts) {
final PsiElement container = ConflictsUtil.getContainer(reference);
HashSet<PsiElement> containerSet = reported.get(container);
if (containerSet == null) {
containerSet = new HashSet<PsiElement>();
reported.put(container, containerSet);
}
if (!containerSet.contains(resolved)) {
containerSet.add(resolved);
String placesDescription;
if (containerSet.size() == 1) {
placesDescription = RefactoringUIUtil.getDescription(resolved, true);
} else {
placesDescription = "<ol><li>" + StringUtil.join(containerSet, new Function<PsiElement, String>() {
@Override
public String fun(PsiElement element) {
return RefactoringUIUtil.getDescription(element, true);
}
}, "</li><li>") + "</li></ol>";
}
String message = RefactoringBundle.message("0.will.become.inaccessible.from.1",
placesDescription,
RefactoringUIUtil.getDescription(container, true));
conflicts.put(container, Collections.singletonList(message));
}
}
示例2: preprocessUsages
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
for (ChangeSignatureUsageProcessor processor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
if (!processor.setupDefaultValues(myChangeInfo, refUsages, myProject)) return false;
}
MultiMap<PsiElement, String> conflictDescriptions = new MultiMap<PsiElement, String>();
for (ChangeSignatureUsageProcessor usageProcessor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
final MultiMap<PsiElement, String> conflicts = usageProcessor.findConflicts(myChangeInfo, refUsages);
for (PsiElement key : conflicts.keySet()) {
Collection<String> collection = conflictDescriptions.get(key);
if (collection.size() == 0) collection = new HashSet<String>();
collection.addAll(conflicts.get(key));
conflictDescriptions.put(key, collection);
}
}
final UsageInfo[] usagesIn = refUsages.get();
RenameUtil.addConflictDescriptions(usagesIn, conflictDescriptions);
Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
RenameUtil.removeConflictUsages(usagesSet);
if (!conflictDescriptions.isEmpty()) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new ConflictsInTestsException(conflictDescriptions.values());
}
if (myPrepareSuccessfulSwingThreadCallback != null) {
ConflictsDialog dialog = prepareConflictsDialog(conflictDescriptions, usagesIn);
if (!dialog.showAndGet()) {
if (dialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
}
if (myChangeInfo.isReturnTypeChanged()) {
askToRemoveCovariantOverriders(usagesSet);
}
refUsages.set(usagesSet.toArray(new UsageInfo[usagesSet.size()]));
prepareSuccessful();
return true;
}
示例3: createNodes
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
public List<ExternalSystemNode<?>> createNodes(@NotNull ExternalProjectsView externalProjectsView,
@Nullable ExternalSystemNode<?> parent,
@NotNull DataNode<?> dataNode) {
final List<ExternalSystemNode<?>> result = new SmartList<ExternalSystemNode<?>>();
final MultiMap<Key<?>, DataNode<?>> groups = ExternalSystemApiUtil.group(dataNode.getChildren());
for (ExternalSystemViewContributor contributor : ExternalSystemViewContributor.EP_NAME.getExtensions()) {
Set<Key<?>> keys = ContainerUtil.newTreeSet(contributor.getKeys());
final MultiMap<Key<?>, DataNode<?>> dataNodes = MultiMap.create();
for (Key<?> key : keys) {
final Collection<DataNode<?>> values = groups.get(key);
if(key != null) {
dataNodes.put(key, values);
}
}
if (dataNodes.isEmpty()) continue;
final List<ExternalSystemNode<?>> childNodes = contributor.createNodes(externalProjectsView, dataNodes);
result.addAll(childNodes);
if (parent == null) continue;
for (ExternalSystemNode childNode : childNodes) {
childNode.setParent(parent);
}
}
return result;
}
示例4: preprocessUsages
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Override
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
MultiMap<PsiElement, String> conflictDescriptions = new MultiMap<PsiElement, String>();
for (ChangeSignatureUsageProcessor usageProcessor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
final MultiMap<PsiElement, String> conflicts = usageProcessor.findConflicts(myChangeInfo, refUsages);
for (PsiElement key : conflicts.keySet()) {
Collection<String> collection = conflictDescriptions.get(key);
if (collection.isEmpty()) collection = new HashSet<String>();
collection.addAll(conflicts.get(key));
conflictDescriptions.put(key, collection);
}
}
final UsageInfo[] usagesIn = refUsages.get();
RenameUtil.addConflictDescriptions(usagesIn, conflictDescriptions);
Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
RenameUtil.removeConflictUsages(usagesSet);
if (!conflictDescriptions.isEmpty()) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new ConflictsInTestsException(conflictDescriptions.values());
}
ConflictsDialog dialog = prepareConflictsDialog(conflictDescriptions, usagesIn);
if (!dialog.showAndGet()) {
if (dialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
refUsages.set(usagesSet.toArray(new UsageInfo[usagesSet.size()]));
prepareSuccessful();
return true;
}
示例5: computeChildren
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Override
protected MultiMap<PsiFile, SeedStackGroupNode> computeChildren(@Nullable PsiFile psiFile) {
MultiMap<PsiFile, SeedStackGroupNode> children = new MultiMap<>();
children.put(null, Lists.newArrayList(domainNode, applicationNode));
return children;
}
示例6: computeChildren
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Override
protected MultiMap<PsiFile, SeedStackGroupNode> computeChildren(@Nullable PsiFile psiFile) {
MultiMap<PsiFile, SeedStackGroupNode> children = new MultiMap<>();
children.put(null, Lists.newArrayList(applicationServicesNode));
return children;
}
示例7: computeChildren
import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Override
protected MultiMap<PsiFile, SeedStackGroupNode> computeChildren(@Nullable PsiFile psiFile) {
MultiMap<PsiFile, SeedStackGroupNode> children = new MultiMap<>();
children.put(null, Lists.newArrayList(aggregatesNode, domainServicesNode, policiesNode));
return children;
}