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


Java ContainerUtil.addAllNotNull方法代码示例

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


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

示例1: addRange

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void addRange(int[] starts, int[] ends) {
  List<FoldedBlock> result = new ArrayList<FoldedBlock>(3);
  int[] rangeStarts = new int[myCount];
  int[] rangeEnds = new int[myCount];

  for (int number = 0; ; number++) {
    int shift = getRangeShift(mySettings.range, number);
    if (shift == -1) break;

    for (int i = 0; i < myCount; i++) {
      rangeStarts[i] = bound(starts[i] + shift, i);
      rangeEnds[i] = bound(ends[i] - shift, i);
    }
    ContainerUtil.addAllNotNull(result, createRange(rangeStarts, rangeEnds, myExpandSuggester.isExpanded(rangeStarts, rangeEnds)));
  }

  if (result.size() > 0) {
    FoldedBlock[] block = ContainerUtil.toArray(result, new FoldedBlock[result.size()]);
    for (FoldedBlock folding : block) {
      folding.installHighlighter(block);
    }
    myFoldings.add(block);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:FoldingModelSupport.java

示例2: getReferencesByElement

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
  Collection<PsiReference> result = ContainerUtil.newArrayList();
  for (PsiReferenceProvider child : children) {
    ContainerUtil.addAllNotNull(result, child.getReferencesByElement(element, context));
  }
  return result.toArray(new PsiReference[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ReferenceProviderType.java

示例3: getParameterSubstrings

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public List<Substring> getParameterSubstrings() {
  final List<Substring> result = new ArrayList<Substring>();
  for (SectionField field : getParameterFields()) {
    ContainerUtil.addAllNotNull(result, field.getNamesAsSubstrings());
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SectionBasedDocString.java

示例4: getKeywordArgumentSubstrings

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public List<Substring> getKeywordArgumentSubstrings() {
  final List<Substring> result = new ArrayList<Substring>();
  for (SectionField field : getKeywordArgumentFields()) {
    ContainerUtil.addAllNotNull(field.getNamesAsSubstrings());
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SectionBasedDocString.java

示例5: getModules

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static Module[] getModules(@Nullable PsiFile context) {
  if (context == null) return Module.EMPTY_ARRAY;

  final Set<Module> modules = new HashSet<Module>();
  for (ModuleContextProvider moduleContextProvider : Extensions.getExtensions(EP_NAME)) {
    ContainerUtil.addAllNotNull(modules, moduleContextProvider.getContextModules(context));
  }
  Module module = ModuleUtilCore.findModuleForPsiElement(context);
  if (module != null) modules.add(module);

  return modules.toArray(new Module[modules.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ModuleContextProvider.java

示例6: configure

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public void configure(CommandLineParser parser) {
  systemPropertiesCommandLineConverter.configure(parser);
  parser.allowMixedSubcommandsAndOptions();

  //noinspection unchecked
  final Collection<Option> supportedOptions = GradleCommandLineOptionsProvider.getSupportedOptions().getOptions();
  for (Option supportedOption : supportedOptions) {


    final List<String> objects = ContainerUtil.newSmartList();
    ContainerUtil.addAllNotNull(objects, supportedOption.getOpt(), supportedOption.getLongOpt());

    if (!objects.isEmpty()) {
      try {
        final CommandLineOption option = parser.option(ArrayUtil.toStringArray(objects));
        if (supportedOption.hasArg()) {
          option.hasArgument();
        }

        if (supportedOption.hasArgs()) {
          option.hasArguments();
        }
        option.hasDescription(supportedOption.getDescription());
      }
      catch (IllegalArgumentException ignore) {
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:GradleCommandLineOptionsConverter.java

示例7: getToolingExtensionClasses

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Set<Class> getToolingExtensionClasses() {
  final Set<Class> classes = ContainerUtil.<Class>set(
    ExternalProject.class,
    // gradle-tooling-extension-api jar
    ProjectImportAction.class,
    // gradle-tooling-extension-impl jar
    ModelBuildScriptClasspathBuilderImpl.class,
    ShortTypeHandling.class
  );

  ContainerUtil.addAllNotNull(classes, doGetToolingExtensionClasses());
  return classes;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AbstractModelBuilderTest.java

示例8: visitReferenceExpression

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public void visitReferenceExpression(GrReferenceExpression referenceExpression) {
  final int size = myInfos.size();
  super.visitReferenceExpression(referenceExpression);
  if (size == myInfos.size()) {
    List<HighlightInfo> infos = myReferenceChecker.checkReferenceExpression(referenceExpression);
    if (infos != null) {
      ContainerUtil.addAllNotNull(myInfos, infos);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ResolveHighlightingVisitor.java

示例9: addEnterProcessors

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
protected void addEnterProcessors(FixEnterProcessor... processors) {
  ContainerUtil.addAllNotNull(myEnterProcessors, processors);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:SmartEnterProcessorWithFixers.java

示例10: addFixers

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
protected void addFixers(Fixer<? extends SmartEnterProcessorWithFixers>... fixers) {
  ContainerUtil.addAllNotNull(myFixers, fixers);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:SmartEnterProcessorWithFixers.java


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