本文整理汇总了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);
}
示例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;
}
示例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());
}
}
示例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;
}
示例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;
}
示例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);
}