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


Java MultiMap.putValues方法代码示例

本文整理汇总了Java中com.intellij.util.containers.MultiMap.putValues方法的典型用法代码示例。如果您正苦于以下问题:Java MultiMap.putValues方法的具体用法?Java MultiMap.putValues怎么用?Java MultiMap.putValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.containers.MultiMap的用法示例。


在下文中一共展示了MultiMap.putValues方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preprocessUsages

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
  final UsageInfo[] usages = refUsages.get();
  final MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
  ArrayList<UsageInfo> filteredUsages = new ArrayList<UsageInfo>();
  for (UsageInfo usage : usages) {
    if (usage instanceof ConflictsUsageInfo) {
      final ConflictsUsageInfo info = (ConflictsUsageInfo)usage;
      final PsiElement element = info.getElement();
      conflicts.putValues(element, info.getConflicts());
    }
    else {
      filteredUsages.add(usage);
    }
  }

  refUsages.set(filteredUsages.toArray(new UsageInfo[filteredUsages.size()]));
  return showConflicts(conflicts, usages);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MoveClassesOrPackagesProcessor.java

示例2: getTemplatesMap

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
public static MultiMap<TemplatesGroup, ProjectTemplate> getTemplatesMap(WizardContext context) {
  ProjectTemplatesFactory[] factories = ProjectTemplatesFactory.EP_NAME.getExtensions();
  final MultiMap<TemplatesGroup, ProjectTemplate> groups = new MultiMap<TemplatesGroup, ProjectTemplate>();
  for (ProjectTemplatesFactory factory : factories) {
    for (String group : factory.getGroups()) {
      ProjectTemplate[] templates = factory.createTemplates(group, context);
      List<ProjectTemplate> values = Arrays.asList(templates);
      if (!values.isEmpty()) {
        Icon icon = factory.getGroupIcon(group);
        String parentGroup = factory.getParentGroup(group);
        TemplatesGroup templatesGroup = new TemplatesGroup(group, null, icon, factory.getGroupWeight(group), parentGroup, group, null);
        groups.putValues(templatesGroup, values);
      }
    }
  }
  return groups;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CreateFromTemplateMode.java

示例3: collectConflicts

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
public static void collectConflicts(final PsiReference reference,
                                    final PsiElement element,
                                    final Map<Language, InlineHandler.Inliner> inliners,
                                    final MultiMap<PsiElement, String> conflicts) {
  final PsiElement referenceElement = reference.getElement();
  if (referenceElement == null) return;
  final Language language = referenceElement.getLanguage();
  final InlineHandler.Inliner inliner = inliners.get(language);
  if (inliner != null) {
    final MultiMap<PsiElement, String> refConflicts = inliner.getConflicts(reference, element);
    if (refConflicts != null) {
      for (PsiElement psiElement : refConflicts.keySet()) {
        conflicts.putValues(psiElement, refConflicts.get(psiElement));
      }
    }
  }
  else {
    conflicts.putValue(referenceElement, "Cannot inline reference from " + language.getDisplayName());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:GenericInlineHandler.java

示例4: getCustomTemplatesLookupItems

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
public static MultiMap<String, CustomLiveTemplateLookupElement> getCustomTemplatesLookupItems(@NotNull Editor editor,
                                                                                              @NotNull PsiFile file,
                                                                                              int offset) {
  final MultiMap<String, CustomLiveTemplateLookupElement> result = MultiMap.create();
  CustomTemplateCallback customTemplateCallback = new CustomTemplateCallback(editor, file);
  for (CustomLiveTemplate customLiveTemplate : TemplateManagerImpl.listApplicableCustomTemplates(editor, file, false)) {
    if (customLiveTemplate instanceof CustomLiveTemplateBase) {
      String customTemplatePrefix = ((CustomLiveTemplateBase)customLiveTemplate).computeTemplateKeyWithoutContextChecking(customTemplateCallback);
      if (customTemplatePrefix != null) {
        result.putValues(customTemplatePrefix, ((CustomLiveTemplateBase)customLiveTemplate).getLookupElements(file, editor, offset));
      }
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ListTemplatesHandler.java

示例5: computeCompilersToRunAndInvalidateLocalAttributesMap

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
private MultiMap<Module, AndroidAutogeneratorMode> computeCompilersToRunAndInvalidateLocalAttributesMap() {
  if (myProject.isDisposed()) {
    return MultiMap.emptyInstance();
  }
  final MultiMap<Module, AndroidAutogeneratorMode> result = MultiMap.create();
  final Set<Module> modulesToInvalidateAttributeDefs = new HashSet<Module>();

  for (VirtualFile file : myFiles) {
    final Module module = ModuleUtilCore.findModuleForFile(file, myProject);

    if (module == null || module.isDisposed()) {
      continue;
    }
    final AndroidFacet facet = AndroidFacet.getInstance(module);

    if (facet == null) {
      continue;
    }
    final VirtualFile parent = file.getParent();
    final VirtualFile gp = parent != null ? parent.getParent() : null;
    final VirtualFile resourceDir = AndroidRootUtil.getResourceDir(facet);

    if (gp != null &&
        Comparing.equal(gp, resourceDir) &&
        ResourceFolderType.VALUES.getName().equals(AndroidCommonUtils.getResourceTypeByDirName(parent.getName()))) {
      modulesToInvalidateAttributeDefs.add(module);
    }
    final List<AndroidAutogeneratorMode> modes = computeCompilersToRunAndInvalidateLocalAttributesMap(facet, file);

    if (modes.size() > 0) {
      result.putValues(module, modes);
    }
  }
  invalidateAttributeDefinitions(modulesToInvalidateAttributeDefs);
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:AndroidResourceFilesListener.java

示例6: createCache

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
protected static PackageDirectoryCache createCache(@NotNull final List<VirtualFile> roots) {
  final MultiMap<String, VirtualFile> map = MultiMap.create();
  map.putValues("", roots);
  return new PackageDirectoryCache(map);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:NonClasspathClassFinder.java


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