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


Java ContainerUtil.newHashMap方法代码示例

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


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

示例1: configureDependencies

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public void configureDependencies(
    final @NotNull HybrisProjectDescriptor hybrisProjectDescriptor,
    final @NotNull IdeModifiableModelsProvider modifiableModelsProvider
) {
    final Map<String, ModifiableFacetModel> modifiableFacetModelMap = ContainerUtil.newHashMap();

    for (Module module : modifiableModelsProvider.getModules()) {
        final ModifiableFacetModel modifiableFacetModel = modifiableModelsProvider.getModifiableFacetModel(module);
        modifiableFacetModelMap.put(module.getName(), modifiableFacetModel);
    }

    for (HybrisModuleDescriptor moduleDescriptor : hybrisProjectDescriptor.getModulesChosenForImport()) {
        configureFacetDependencies(moduleDescriptor, modifiableFacetModelMap);
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:17,代码来源:DefaultSpringConfigurator.java

示例2: removeInjectionInPlace

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public boolean removeInjectionInPlace(@Nullable final PsiLanguageInjectionHost psiElement) {
  if (!isStringLiteral(psiElement)) return false;

  GrLiteralContainer host = (GrLiteralContainer)psiElement;
  final HashMap<BaseInjection, Pair<PsiMethod, Integer>> injectionsMap = ContainerUtil.newHashMap();
  final ArrayList<PsiElement> annotations = new ArrayList<PsiElement>();
  final Project project = host.getProject();
  final Configuration configuration = Configuration.getProjectInstance(project);
  collectInjections(host, configuration, this, injectionsMap, annotations);

  if (injectionsMap.isEmpty() && annotations.isEmpty()) return false;
  final ArrayList<BaseInjection> originalInjections = new ArrayList<BaseInjection>(injectionsMap.keySet());
  final List<BaseInjection> newInjections = ContainerUtil.mapNotNull(originalInjections, new NullableFunction<BaseInjection, BaseInjection>() {
    @Override
    public BaseInjection fun(final BaseInjection injection) {
      final Pair<PsiMethod, Integer> pair = injectionsMap.get(injection);
      final String placeText = JavaLanguageInjectionSupport.getPatternStringForJavaPlace(pair.first, pair.second);
      final BaseInjection newInjection = injection.copy();
      newInjection.setPlaceEnabled(placeText, false);
      return InjectorUtils.canBeRemoved(newInjection) ? null : newInjection;
    }
  });
  configuration.replaceInjectionsWithUndo(project, newInjections, originalInjections, annotations);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:GroovyLanguageInjectionSupport.java

示例3: buildIdTree

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static Map<String, List<String>> buildIdTree(@NotNull Map<String, ConfigurableWrapper> idToConfigurable,
                                                     @NotNull List<String> idsInEpOrder) {
  Map<String, List<String>> tree = ContainerUtil.newHashMap();
  for (String id : idsInEpOrder) {
    ConfigurableWrapper wrapper = idToConfigurable.get(id);
    String parentId = wrapper.getParentId();
    if (parentId != null) {
      ConfigurableWrapper parent = idToConfigurable.get(parentId);
      if (parent == null) {
        LOG.warn("Can't find parent for " + parentId + " (" + wrapper + ")");
        continue;
      }
      List<String> children = tree.get(parentId);
      if (children == null) {
        children = ContainerUtil.newArrayListWithCapacity(5);
        tree.put(parentId, children);
      }
      children.add(id);
    }
  }
  return tree;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ConfigurableExtensionPointUtil.java

示例4: setUp

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();

  myLogProvider = new TestVcsLogProvider(myProjectRoot);
  myLogProviders = Collections.<VirtualFile, VcsLogProvider>singletonMap(myProjectRoot, myLogProvider);
  myTopDetailsCache = ContainerUtil.newHashMap();

  myCommits = Arrays.asList("3|-a2|-a1", "2|-a1|-a", "1|-a|-");
  myLogProvider.appendHistory(log(myCommits));
  myLogProvider.addRef(createBranchRef("master", "a2"));

  myStartedTasks = new ArrayList<Future<?>>();
  myDataWaiter = new DataWaiter();
  myLoader = createLoader(myDataWaiter);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:VcsLogRefresherTest.java

示例5: getConfigurableGroup

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
 * @param configurables a list of settings to process
 * @param project       a project used to create a project settings group or {@code null}
 * @return the root configurable group that represents a tree of settings
 */
public static ConfigurableGroup getConfigurableGroup(@NotNull List<Configurable> configurables, @Nullable Project project) {
  Map<String, List<Configurable>> map = groupConfigurables(configurables);
  Map<String, Node<SortedConfigurableGroup>> tree = ContainerUtil.newHashMap();
  for (Map.Entry<String, List<Configurable>> entry : map.entrySet()) {
    addGroup(tree, project, entry.getKey(), entry.getValue(), null);
  }
  SortedConfigurableGroup root = getGroup(tree, "root");
  if (!tree.isEmpty()) {
    for (String groupId : tree.keySet()) {
      LOG.warn("ignore group: " + groupId);
    }
  }
  return root;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ConfigurableExtensionPointUtil.java

示例6: readBranchRefsFromFiles

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Map<String, String> readBranchRefsFromFiles() {
  Map<String, String> result = ContainerUtil.newHashMap(readPackedBranches()); // reading from packed-refs first to overwrite values by values from unpacked refs
  result.putAll(readFromBranchFiles(myRefsHeadsDir));
  result.putAll(readFromBranchFiles(myRefsRemotesDir));
  result.remove(REFS_REMOTES_PREFIX + GitUtil.ORIGIN_HEAD);
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GitRepositoryReader.java

示例7: calcArgRequiredNullability

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private Map<PsiExpression, Nullness> calcArgRequiredNullability(PsiSubstitutor substitutor, PsiParameter[] parameters) {
  int checkedCount = Math.min(myArgs.length, parameters.length) - (myVarArgCall ? 1 : 0);

  Map<PsiExpression, Nullness> map = ContainerUtil.newHashMap();
  for (int i = 0; i < checkedCount; i++) {
    map.put(myArgs[i], DfaPsiUtil.getElementNullability(substitutor.substitute(parameters[i].getType()), parameters[i]));
  }
  return map;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:MethodCallInstruction.java

示例8: JavaFxManifestHeaderParsers

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public JavaFxManifestHeaderParsers() {
  myParsers = ContainerUtil.newHashMap();
  myParsers.put("JavaFX-Application-Class", StandardHeaderParser.INSTANCE);
  myParsers.put("JavaFX-Version", StandardHeaderParser.INSTANCE);
  myParsers.put("JavaFX-Class-Path", StandardHeaderParser.INSTANCE);
  myParsers.put("JavaFX-Preloader-Class", StandardHeaderParser.INSTANCE);
  myParsers.put("JavaFX-Fallback-Class", StandardHeaderParser.INSTANCE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaFxManifestHeaderParsers.java

示例9: doTestCustomCommitMessage

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void doTestCustomCommitMessage(@NotNull String subject, @NotNull String expectedSubject) {
  Map<GitTestLogRecordInfo, Object> data = ContainerUtil.newHashMap(myRecord.myData);
  data.put(GitTestLogRecordInfo.SUBJECT, subject);
  myRecord = new GitTestLogRecord(data);

  myParser = new GitLogParser(myProject, STATUS, GIT_LOG_OPTIONS);
  String s = myRecord.prepareOutputLine(NONE);
  List<GitLogRecord> records = myParser.parse(s);
  assertEquals("Incorrect amount of actual records: " + StringUtil.join(records, "\n"), 1, records.size());
  assertEquals(records.get(0).getSubject(), expectedSubject);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GitLogParserTest.java

示例10: prepareRequirements

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Map<VirtualFile, VcsLogProvider.Requirements> prepareRequirements(@NotNull Collection<VirtualFile> roots,
                                                                          int commitCount,
                                                                          @NotNull Map<VirtualFile, Set<VcsRef>> prevRefs) {
  Map<VirtualFile, VcsLogProvider.Requirements> requirements = ContainerUtil.newHashMap();
  for (VirtualFile root : roots) {
    requirements.put(root, new RequirementsImpl(commitCount, true, ContainerUtil.notNullize(prevRefs.get(root))));
  }
  return requirements;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:VcsLogRefresherImpl.java

示例11: OneShotMergeInfoHelper

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public OneShotMergeInfoHelper(@NotNull MergeContext mergeContext) {
  myMergeContext = mergeContext;
  myPartiallyMerged = ContainerUtil.newHashMap();
  myMergeInfoLock = new Object();
  // TODO: Rewrite without AreaMap usage
  myMergeInfoMap = AreaMap.create(new PairProcessor<String, String>() {
    public boolean process(String parentUrl, String childUrl) {
      if (".".equals(parentUrl)) return true;
      return SVNPathUtil.isAncestor(SvnUtil.ensureStartSlash(parentUrl), SvnUtil.ensureStartSlash(childUrl));
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:OneShotMergeInfoHelper.java

示例12: forgetDisabledPlugins

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void forgetDisabledPlugins() {
  Map<String, String> newMapping = ContainerUtil.newHashMap();
  for (String pluginIdString : myPluginIdToVersion.keySet()) {
    IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.findId(pluginIdString));
    if (plugin != null && plugin.isEnabled()) {
      newMapping.put(pluginIdString, myPluginIdToVersion.get(pluginIdString));
    }
  }
  myPluginIdToVersion = newMapping;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ResourceVersions.java

示例13: newInstance

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static <CommitId> PermanentGraphImpl<CommitId> newInstance(@NotNull List<? extends GraphCommit<CommitId>> graphCommits,
                                                                  @NotNull final GraphColorManager<CommitId> graphColorManager,
                                                                  @NotNull Set<CommitId> branchesCommitId) {
  PermanentLinearGraphBuilder<CommitId> permanentLinearGraphBuilder = PermanentLinearGraphBuilder.newInstance(graphCommits);
  final Map<Integer, CommitId> notLoadCommits = ContainerUtil.newHashMap();
  PermanentLinearGraphImpl linearGraph = permanentLinearGraphBuilder.build(new NotNullFunction<CommitId, Integer>() {
    @NotNull
    @Override
    public Integer fun(CommitId dom) {
      int nodeId = -(notLoadCommits.size() + 2);
      notLoadCommits.put(nodeId, dom);
      return nodeId;
    }
  });

  final PermanentCommitsInfoIml<CommitId> commitIdPermanentCommitsInfo =
    PermanentCommitsInfoIml.newInstance(graphCommits, notLoadCommits);

  GraphLayoutImpl permanentGraphLayout = GraphLayoutBuilder.build(linearGraph, new Comparator<Integer>() {
    @Override
    public int compare(@NotNull Integer nodeIndex1, @NotNull Integer nodeIndex2) {
      CommitId commitId1 = commitIdPermanentCommitsInfo.getCommitId(nodeIndex1);
      CommitId commitId2 = commitIdPermanentCommitsInfo.getCommitId(nodeIndex2);
      return graphColorManager.compareHeads(commitId2, commitId1);
    }
  });

  return new PermanentGraphImpl<CommitId>(linearGraph, permanentGraphLayout, commitIdPermanentCommitsInfo, graphColorManager,
                                          branchesCommitId);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:PermanentGraphImpl.java

示例14: getRunProfile

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
protected MyRunProfile getRunProfile(@NotNull ExecutionEnvironment environment) {
  final TestNGConfiguration configuration = (TestNGConfiguration)myConsoleProperties.getConfiguration();
  final List<AbstractTestProxy> failedTests = getFailedTests(configuration.getProject());
  return new MyRunProfile(configuration) {
    @Override
    @NotNull
    public Module[] getModules() {
      return configuration.getModules();
    }

    @Override
    public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) {
      return new TestNGRunnableState(env, configuration) {
        @Override
        public SearchingForTestsTask createSearchingForTestsTask() {
          return new SearchingForTestsTask(myServerSocket, getConfiguration(), myTempFile, client) {
            @Override
            protected void fillTestObjects(final Map<PsiClass, Map<PsiMethod, List<String>>> classes) throws CantRunException {
              final HashMap<PsiClass, Map<PsiMethod, List<String>>> fullClassList = ContainerUtil.newHashMap();
              super.fillTestObjects(fullClassList);
              for (final PsiClass aClass : fullClassList.keySet()) {
                if (!ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
                  @Override
                  public Boolean compute() {
                    return TestNGUtil.hasTest(aClass);
                  }
                })) {
                  classes.put(aClass, fullClassList.get(aClass));
                }
              }

              final GlobalSearchScope scope = getConfiguration().getConfigurationModule().getSearchScope();
              final Project project = getConfiguration().getProject();
              for (final AbstractTestProxy proxy : failedTests) {
                ApplicationManager.getApplication().runReadAction(new Runnable() {
                  public void run() {
                    includeFailedTestWithDependencies(classes, scope, project, proxy);
                  }
                });
              }
            }


          };
        }
      };
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:51,代码来源:RerunFailedTestsAction.java

示例15: putChangeContext

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public <T> void putChangeContext(@NotNull Change change, @NotNull Key<T> key, T value) {
  if (myRequestContext == null) myRequestContext = ContainerUtil.newHashMap();
  if (!myRequestContext.containsKey(change)) myRequestContext.put(change, ContainerUtil.<Key, Object>newHashMap());
  myRequestContext.get(change).put(key, value);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ShowDiffContext.java


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