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


Java ContainerUtilRt.addIfNotNull方法代码示例

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


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

示例1: fun

import com.intellij.util.containers.ContainerUtilRt; //导入方法依赖的package包/类
@NotNull
@Override
public Set<String> fun(ProximityLocation location) {
  final HashSet<String> result = new HashSet<String>();
  PsiClass contextClass = PsiTreeUtil.getContextOfType(location.getPosition(), PsiClass.class, false);
  Processor<PsiClass> processor = new Processor<PsiClass>() {
    @Override
    public boolean process(PsiClass psiClass) {
      ContainerUtilRt.addIfNotNull(result, psiClass.getQualifiedName());
      return true;
    }
  };
  while (contextClass != null) {
    InheritanceUtil.processSupers(contextClass, true, processor);
    contextClass = contextClass.getContainingClass();
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JavaInheritanceWeigher.java

示例2: enhanceRemoteProcessing

import com.intellij.util.containers.ContainerUtilRt; //导入方法依赖的package包/类
@Override
public void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) throws ExecutionException {
  final Set<String> additionalEntries = ContainerUtilRt.newHashSet();
  for (GradleProjectResolverExtension extension : RESOLVER_EXTENSIONS.getValue()) {
    ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(extension.getClass()));
    for (Class aClass : extension.getExtraProjectModelClasses()) {
      ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(aClass));
    }
    extension.enhanceRemoteProcessing(parameters);
  }

  final PathsList classPath = parameters.getClassPath();
  for (String entry : additionalEntries) {
    classPath.add(entry);
  }

  parameters.getVMParametersList().addProperty(
    ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY, GradleConstants.SYSTEM_ID.getId());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:GradleManager.java

示例3: fun

import com.intellij.util.containers.ContainerUtilRt; //导入方法依赖的package包/类
@NotNull
@Override
public Set<String> fun(ProximityLocation location)
{
	final HashSet<String> result = new HashSet<>();
	PsiClass contextClass = PsiTreeUtil.getContextOfType(location.getPosition(), PsiClass.class, false);
	Processor<PsiClass> processor = psiClass ->
	{
		ContainerUtilRt.addIfNotNull(result, psiClass.getQualifiedName());
		return true;
	};
	while(contextClass != null)
	{
		InheritanceUtil.processSupers(contextClass, true, processor);
		contextClass = contextClass.getContainingClass();
	}
	return result;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:19,代码来源:JavaInheritanceWeigher.java

示例4: getAffectedVcses

import com.intellij.util.containers.ContainerUtilRt; //导入方法依赖的package包/类
private static Collection<AbstractVcs> getAffectedVcses(Project project, final Collection<Change> changes) {
  Set<AbstractVcs> result = new THashSet<AbstractVcs>();
  for (Change change : changes) {
    ContainerUtilRt.addIfNotNull(result, ChangesUtil.getVcsForChange(change, project));
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CommitChangeListDialog.java

示例5: schemeDeleted

import com.intellij.util.containers.ContainerUtilRt; //导入方法依赖的package包/类
@Override
protected void schemeDeleted(@Nonnull Named scheme) {
  super.schemeDeleted(scheme);

  if (scheme instanceof ExternalizableScheme) {
    ContainerUtilRt.addIfNotNull(myFilesToDelete, ((ExternalizableScheme)scheme).getExternalInfo().getCurrentFileName());
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:SchemesManagerImpl.java

示例6: enhanceRemoteProcessing

import com.intellij.util.containers.ContainerUtilRt; //导入方法依赖的package包/类
@Override
public void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) throws ExecutionException {
  PathsList classPath = parameters.getClassPath();

  // Gradle i18n bundle.
  ExternalSystemApiUtil.addBundle(classPath, GradleBundle.PATH_TO_BUNDLE, GradleBundle.class);

  // Gradle tool jars.
  String toolingApiPath = PathManager.getJarPathForClass(ProjectConnection.class);
  if (toolingApiPath == null) {
    LOG.warn(GradleBundle.message("gradle.generic.text.error.jar.not.found"));
    throw new ExecutionException("Can't find gradle libraries");
  }
  File gradleJarsDir = new File(toolingApiPath).getParentFile();
  File[] gradleJars = gradleJarsDir.listFiles(FileFilters.filesWithExtension("jar"));
  if (gradleJars == null) {
    LOG.warn(GradleBundle.message("gradle.generic.text.error.jar.not.found"));
    throw new ExecutionException("Can't find gradle libraries at " + gradleJarsDir.getAbsolutePath());
  }
  for (File jar : gradleJars) {
    classPath.add(jar.getAbsolutePath());
  }

  List<String> additionalEntries = ContainerUtilRt.newArrayList();
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(GroovyObject.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(GsonBuilder.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ExternalProject.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaProjectData.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(LanguageLevel.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(StdModuleTypes.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaModuleType.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ModuleType.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(EmptyModuleType.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ProjectImportAction.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(Init.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(org.slf4j.Logger.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(Log4jLoggerFactory.class));
  for (String entry : additionalEntries) {
    classPath.add(entry);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:BaseGradleProjectResolverExtension.java

示例7: enhanceParameters

import com.intellij.util.containers.ContainerUtilRt; //导入方法依赖的package包/类
@Override
public void enhanceParameters(@NotNull SimpleJavaParameters parameters) throws ExecutionException {
  PathsList classPath = parameters.getClassPath();

  // Gradle i18n bundle.
  ExternalSystemApiUtil.addBundle(classPath, GradleBundle.PATH_TO_BUNDLE, GradleBundle.class);

  // Gradle tool jars.
  String toolingApiPath = PathManager.getJarPathForClass(ProjectConnection.class);
  if (toolingApiPath == null) {
    LOG.warn(GradleBundle.message("gradle.generic.text.error.jar.not.found"));
    throw new ExecutionException("Can't find gradle libraries");
  }
  File gradleJarsDir = new File(toolingApiPath).getParentFile();
  String[] gradleJars = gradleJarsDir.list(new FilenameFilter() {
    @Override
    public boolean accept(File dir, String name) {
      return name.endsWith(".jar");
    }
  });
  if (gradleJars == null) {
    LOG.warn(GradleBundle.message("gradle.generic.text.error.jar.not.found"));
    throw new ExecutionException("Can't find gradle libraries at " + gradleJarsDir.getAbsolutePath());
  }
  for (String jar : gradleJars) {
    classPath.add(new File(gradleJarsDir, jar).getAbsolutePath());
  }

  List<String> additionalEntries = ContainerUtilRt.newArrayList();
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaProjectData.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(LanguageLevel.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(StdModuleTypes.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaModuleType.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ModuleType.class));
  ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(EmptyModuleType.class));
  for (String entry : additionalEntries) {
    classPath.add(entry);
  }

  for (GradleProjectResolverExtension extension : RESOLVER_EXTENSIONS.getValue()) {
    extension.enhanceParameters(parameters);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:44,代码来源:GradleManager.java


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