本文整理汇总了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;
}
示例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());
}
示例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;
}
示例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;
}
示例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());
}
}
示例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);
}
}
示例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);
}
}