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


Java ContainerUtil.newHashSet方法代码示例

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


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

示例1: topLevelKeywords

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
 * @return set of keywords.
 */
public static Set<String> topLevelKeywords() {
    return ContainerUtil.newHashSet(
        "SELECT",
        "FROM",
        "WHERE",
        "ORDER",

        // Temporarily place this
        "LEFT",
        "JOIN",
        "ON",

        "BY",
        "ASC",
        "DESC"
    );
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:21,代码来源:FSKeywords.java

示例2: getFontAbleToDisplay

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Nullable
Font getFontAbleToDisplay(LookupElementPresentation p) {
  String sampleString = p.getItemText() + p.getTailText() + p.getTypeText();

  // assume a single font can display all lookup item chars
  Set<Font> fonts = ContainerUtil.newHashSet();
  for (int i = 0; i < sampleString.length(); i++) {
    fonts.add(EditorUtil.fontForChar(sampleString.charAt(i), Font.PLAIN, myLookup.getEditor()).getFont());
  }

  eachFont: for (Font font : fonts) {
    if (font.equals(myNormalFont)) continue;
    
    for (int i = 0; i < sampleString.length(); i++) {
      if (!font.canDisplay(sampleString.charAt(i))) {
        continue eachFont;
      }
    }
    return font;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:LookupCellRenderer.java

示例3: checkList

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public SvnMergeInfoCache.MergeCheckResult checkList(@NotNull SvnChangeList changeList) {
  Set<String> notMergedPaths = ContainerUtil.newHashSet();
  boolean hasMergedPaths = false;

  for (String path : changeList.getAffectedPaths()) {
    //noinspection EnumSwitchStatementWhichMissesCases
    switch (checkPath(path, changeList.getNumber())) {
      case MERGED:
        hasMergedPaths = true;
        break;
      case NOT_MERGED:
        notMergedPaths.add(path);
        break;
    }
  }

  if (hasMergedPaths && !notMergedPaths.isEmpty()) {
    myPartiallyMerged.put(changeList.getNumber(), notMergedPaths);
  }

  return notMergedPaths.isEmpty()
         ? hasMergedPaths ? SvnMergeInfoCache.MergeCheckResult.MERGED : SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS
         : SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:OneShotMergeInfoHelper.java

示例4: withNotInstanceofValue

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Nullable
public DfaVariableState withNotInstanceofValue(DfaTypeValue dfaType) {
  if (myNotInstanceofValues.contains(dfaType.getDfaType())) return this;

  for (DfaPsiType dfaTypeValue : myInstanceofValues) {
    if (dfaType.getDfaType().isAssignableFrom(dfaTypeValue)) return null;
  }

  List<DfaPsiType> moreSpecific = ContainerUtil.newArrayList();
  for (DfaPsiType alreadyNotInstanceof : myNotInstanceofValues) {
    if (alreadyNotInstanceof.isAssignableFrom(dfaType.getDfaType())) {
      return this;
    }
    if (dfaType.getDfaType().isAssignableFrom(alreadyNotInstanceof)) {
      moreSpecific.add(alreadyNotInstanceof);
    }
  }

  HashSet<DfaPsiType> newNotInstanceof = ContainerUtil.newHashSet(myNotInstanceofValues);
  newNotInstanceof.removeAll(moreSpecific);
  newNotInstanceof.add(dfaType.getDfaType());
  return createCopy(myInstanceofValues, newNotInstanceof, myNullability);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DfaVariableState.java

示例5: getDescendantsWithAddedStatus

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Set<File> getDescendantsWithAddedStatus(@NotNull File ioFile) throws SvnBindException {
  final Set<File> result = ContainerUtil.newHashSet();
  StatusClient statusClient = myVcs.getFactory(ioFile).createStatusClient();

  statusClient.doStatus(ioFile, SVNRevision.UNDEFINED, Depth.INFINITY, false, false, false, false,
                        new StatusConsumer() {
                          @Override
                          public void consume(Status status) throws SVNException {
                            if (status != null && StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
                              result.add(status.getFile());
                            }
                          }
                        }, null);

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

示例6: collectUnhandledExceptions

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
static Set<PsiClassType> collectUnhandledExceptions(@NotNull final PsiTryStatement statement) {
  final Set<PsiClassType> thrownTypes = ContainerUtil.newHashSet();

  final PsiCodeBlock tryBlock = statement.getTryBlock();
  if (tryBlock != null) {
    thrownTypes.addAll(ExceptionUtil.collectUnhandledExceptions(tryBlock, tryBlock));
  }

  final PsiResourceList resources = statement.getResourceList();
  if (resources != null) {
    thrownTypes.addAll(ExceptionUtil.collectUnhandledExceptions(resources, resources));
  }

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

示例7: invokeInner

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static void invokeInner(Project project, PsiElement[] elements, Editor editor) {
  Set<GroovyFile> files = ContainerUtil.newHashSet();

  for (PsiElement element : elements) {
    if (!(element instanceof PsiFile)) {
      element = element.getContainingFile();
    }

    if (element instanceof GroovyFile) {
      files.add((GroovyFile)element);
    }
    else {
      if (!ApplicationManager.getApplication().isUnitTestMode()) {
        CommonRefactoringUtil.showErrorHint(project, editor, GroovyRefactoringBundle.message("convert.to.java.can.work.only.with.groovy"), REFACTORING_NAME, null);
        return;
      }
    }
  }

  new ConvertToJavaProcessor(project, files.toArray(new GroovyFile[files.size()])).run();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ConvertToJavaHandler.java

示例8: getModulesToShow

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Collection<Module> getModulesToShow() {
    final VisibilityLevel visibilityLevel = getVisibilityManager().getCurrentVisibilityLevel();
    final Module[] allModules = myModuleManager.getModules();

    if (ModuleDepDiagramVisibilityManager.LARGE.equals(visibilityLevel)) {
        return Arrays
            .stream(allModules)
            .filter(module -> isCustomExtension(module) || isOotbOrPlatformExtension(module))
            .collect(Collectors.toList());
    }
    final List<Module> customExtModules = Arrays
        .stream(allModules)
        .filter(this::isCustomExtension)
        .collect(Collectors.toList());

    if (ModuleDepDiagramVisibilityManager.SMALL.equals(visibilityLevel)) {
        return customExtModules;
    }
    final List<Module> dependencies = customExtModules
        .stream()
        .flatMap(module -> Arrays.stream(ModuleRootManager.getInstance(module).getDependencies()))
        .filter(this::isOotbOrPlatformExtension)
        .collect(Collectors.toList());

    final List<Module> backwardDependencies = Arrays
        .stream(allModules)
        .filter(module -> Arrays
            .stream(ModuleRootManager.getInstance(module).getDependencies())
            .anyMatch(this::isCustomExtension))
        .filter(this::isOotbOrPlatformExtension)
        .collect(Collectors.toList());

    final Set<Module> result = ContainerUtil.newHashSet();
    result.addAll(customExtModules);
    result.addAll(dependencies);
    result.addAll(backwardDependencies);
    return result;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:40,代码来源:ModuleDepDiagramDataModel.java

示例9: joinKeywords

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static Set<String> joinKeywords() {
    return ContainerUtil.newHashSet(
        "LEFT",
        "JOIN",
        "ON"
    );
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:FSKeywords.java

示例10: orderKeywords

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static Set<String> orderKeywords() {
    return ContainerUtil.newHashSet(
        "BY",
        "ASC",
        "DESC"
    );
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:FSKeywords.java

示例11: TSMetaModelBuilder

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public TSMetaModelBuilder(
    final @NotNull Project project,
    @NotNull final Collection<VirtualFile> filesToExclude
) {
    myProject = project;
    myDomManager = DomManager.getDomManager(project);
    myFilesToExclude = ContainerUtil.newHashSet(filesToExclude);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:9,代码来源:TSMetaModelBuilder.java

示例12: keywords

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
 * @return set of keywords.
 */
public static Set<String> keywords() {
    return ContainerUtil.newHashSet(
        "INSERT",
        "UPDATE",
        "INSERT_UPDATE",
        "REMOVE"
    );
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:12,代码来源:ImpexKeywords.java

示例13: keywordMacros

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
 * @return set of keywords.
 */
public static Set<String> keywordMacros() {
    return ContainerUtil.newHashSet(
        "$START_USERRIGHTS",
        "$END_USERRIGHTS"
    );
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:10,代码来源:ImpexKeywords.java

示例14: testLinksInJavaDoc

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void testLinksInJavaDoc() {
  configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");
  @SuppressWarnings("SpellCheckingInspection") Set<String> expected = ContainerUtil.newHashSet(
    "http://www.unicode.org/unicode/standard/standard.html",
    "http://docs.oracle.com/javase/7/docs/technotes/guides/lang/cl-mt.html",
    "https://youtrack.jetbrains.com/issue/IDEA-131621",
    "mailto:[email protected]");
  Set<String> actual = collectWebReferences().stream().map(PsiReferenceBase::getCanonicalText).collect(Collectors.toSet());
  assertEquals(expected, actual);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JavadocHighlightingTest.java

示例15: getAllNewCommits

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private Set<Commit> getAllNewCommits(@NotNull List<? extends Commit> unsafeGreenPartSavedLog,
                                                    @NotNull List<? extends Commit> firstBlock) {
  Set<CommitId> existedCommitHashes = ContainerUtil.newHashSet();
  for (Commit commit : unsafeGreenPartSavedLog) {
    existedCommitHashes.add(commit.getId());
  }
  Set<Commit> allNewsCommits = ContainerUtil.newHashSet();
  for (Commit newCommit : firstBlock) {
    if (!existedCommitHashes.contains(newCommit.getId())) {
      allNewsCommits.add(newCommit);
    }
  }
  return allNewsCommits;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:VcsLogJoiner.java


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