本文整理匯總了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;
}