本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.map2Map方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.map2Map方法的具体用法?Java ContainerUtil.map2Map怎么用?Java ContainerUtil.map2Map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.map2Map方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModulesMap
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
protected <T> Map<String, T> getModulesMap(final Class<T> aClass) {
final DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getIdeaProject().getModules();
final String filterKey = "to_filter";
final Map<String, T> map = ContainerUtil.map2Map(ideaModules, new Function<IdeaModule, Pair<String, T>>() {
@Override
public Pair<String, T> fun(IdeaModule module) {
final T value = allModels.getExtraProject(module, aClass);
final String key = value != null ? module.getGradleProject().getPath() : filterKey;
return Pair.create(key, value);
}
});
map.remove(filterKey);
return map;
}
示例2: GitBranchOperation
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
protected GitBranchOperation(@NotNull Project project, @NotNull GitPlatformFacade facade, @NotNull Git git,
@NotNull GitBranchUiHandler uiHandler, @NotNull Collection<GitRepository> repositories) {
myProject = project;
myFacade = facade;
myGit = git;
myUiHandler = uiHandler;
myRepositories = repositories;
myCurrentHeads = ContainerUtil.map2Map(repositories, new Function<GitRepository, Pair<GitRepository, String>>() {
@Override
public Pair<GitRepository, String> fun(GitRepository repository) {
GitLocalBranch currentBranch = repository.getCurrentBranch();
return Pair.create(repository, currentBranch == null ? repository.getCurrentRevision() : currentBranch.getName());
}
});
mySuccessfulRepositories = new ArrayList<GitRepository>();
myRemainingRepositories = new ArrayList<GitRepository>(myRepositories);
mySettings = myFacade.getSettings(myProject);
}
示例3: getProvidersForRoots
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Map<VirtualFile, VcsLogProvider> getProvidersForRoots(@NotNull Set<VirtualFile> roots) {
return ContainerUtil.map2Map(roots,
new Function<VirtualFile, Pair<VirtualFile, VcsLogProvider>>() {
@Override
public Pair<VirtualFile, VcsLogProvider> fun(VirtualFile root) {
return Pair.create(root, myProviders.get(root));
}
});
}
示例4: asMap
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
Map<VirtualFile, VcsLogProvider.Requirements> asMap(@NotNull Collection<VirtualFile> roots) {
return ContainerUtil.map2Map(roots, new Function<VirtualFile, Pair<VirtualFile, VcsLogProvider.Requirements>>() {
@Override
public Pair<VirtualFile, VcsLogProvider.Requirements> fun(VirtualFile root) {
return Pair.<VirtualFile, VcsLogProvider.Requirements>create(root, CommitCountRequirements.this);
}
});
}
示例5: updateRootInfoAndRememberPositions
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Map<GitRepository, String> updateRootInfoAndRememberPositions() {
return ContainerUtil.map2Map(myPushSpecs.keySet(),
new Function<GitRepository, Pair<GitRepository, String>>() {
@Override
public Pair<GitRepository, String> fun(GitRepository repository) {
repository.update();
return Pair.create(repository, repository.getCurrentRevision());
}
});
}
示例6: readInitialHeadPositions
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static Map<GitRepository, String> readInitialHeadPositions(@NotNull Collection<GitRepository> repositories) {
updateRepositoriesInfo(repositories);
return ContainerUtil.map2Map(repositories, new Function<GitRepository, Pair<GitRepository, String>>() {
@Override
public Pair<GitRepository, String> fun(@NotNull GitRepository repository) {
String currentRevision = repository.getCurrentRevision();
LOG.debug("Current revision in [" + repository.getRoot().getName() + "] is [" + currentRevision + "]");
return Pair.create(repository, currentRevision);
}
});
}