本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.newMapFromValues方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.newMapFromValues方法的具体用法?Java ContainerUtil.newMapFromValues怎么用?Java ContainerUtil.newMapFromValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.newMapFromValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateOptionsList
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public void updateOptionsList() {
myOptionsModel.clear();
myDescriptions.clear();
Map<TextAttributesKey, TextDiffType> typesByKey = ContainerUtil.newMapFromValues(TextDiffType.MERGE_TYPES.iterator(),
TextDiffType.ATTRIBUTES_KEY);
for (int i = 0; i < myOptions.getCurrentDescriptions().length; i++) {
EditorSchemeAttributeDescriptor description = myOptions.getCurrentDescriptions()[i];
TextAttributesKey type = TextAttributesKey.find(description.getType());
if (description.getGroup() == ColorAndFontOptions.DIFF_GROUP &&
typesByKey.keySet().contains(type)) {
myOptionsModel.add(typesByKey.get(type));
myDescriptions.put(type.getExternalName(), (MyColorAndFontDescription)description);
}
}
ScrollingUtil.ensureSelectionExists(myOptionsList);
}
示例2: processListOptions
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public Set<String> processListOptions() {
Set<String> result = ContainerUtil.newHashSet();
Map<TextAttributesKey, TextDiffType> typesByKey = ContainerUtil.newMapFromValues(TextDiffType.MERGE_TYPES.iterator(),
TextDiffType.ATTRIBUTES_KEY);
for (int i = 0; i < myOptions.getCurrentDescriptions().length; i++) {
EditorSchemeAttributeDescriptor description = myOptions.getCurrentDescriptions()[i];
TextAttributesKey type = TextAttributesKey.find(description.getType());
if (description.getGroup() == ColorAndFontOptions.DIFF_GROUP &&
typesByKey.keySet().contains(type)) {
result.add(type.getExternalName());
}
}
return result;
}
示例3: configure
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private Map<String, XmlElementDescriptor> configure(String... files) {
myFixture.configureByFiles(files);
XmlTag tag = ((XmlFile)getFile()).getRootTag();
assertNotNull(tag);
XmlElementDescriptor descriptor = tag.getDescriptor();
assertNotNull(descriptor);
XmlElementDescriptor[] descriptors = descriptor.getElementsDescriptors(tag);
Map<String, XmlElementDescriptor> map =
ContainerUtil.newMapFromValues(Arrays.asList(descriptors).iterator(), new Convertor<XmlElementDescriptor, String>() {
@Override
public String convert(XmlElementDescriptor o) {
return o.getName();
}
});
map.put(tag.getName(), tag.getDescriptor());
return map;
}
示例4: getConfiguredAnts
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public Map<AntReference, AntInstallation> getConfiguredAnts() {
Map<AntReference, AntInstallation> map = ContainerUtil.newMapFromValues(ANTS.getIterator(getProperties()),
AntInstallation.REFERENCE_TO_ANT);
map.put(AntReference.BUNDLED_ANT, myBundledAnt);
return map;
}