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


Java MultiMap.put方法代码示例

本文整理汇总了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));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:MoveInnerProcessor.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ChangeSignatureProcessor.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:ExternalProjectsViewImpl.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:GrChangeSignatureProcessor.java

示例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;
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:7,代码来源:BusinessNode.java

示例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;
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:7,代码来源:ApplicationNode.java

示例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;
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:7,代码来源:DomainNode.java


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