use of com.intellij.psi.JavaPsiFacade in project intellij-community by JetBrains.
the class GroovyConsoleUtil method hasGroovyAll.
static boolean hasGroovyAll(Module module) {
final GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module);
final JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject());
return (facade.findClass("org.apache.commons.cli.CommandLineParser", scope) != null || facade.findClass("groovyjarjarcommonscli.CommandLineParser", scope) != null) && facade.findClass("groovy.ui.GroovyMain", scope) != null;
}
use of com.intellij.psi.JavaPsiFacade in project intellij-community by JetBrains.
the class SceneBuilderImpl method prepareCustomComponents.
@NotNull
private Collection<CustomComponent> prepareCustomComponents(Collection<PsiClass> psiClasses) {
final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(myProject);
final GlobalSearchScope scope = GlobalSearchScope.allScope(myProject);
final Map<String, BuiltinComponent> builtinComponents = loadBuiltinComponents(className -> psiFacade.findClass(className, scope) != null);
final List<CustomComponent> customComponents = new ArrayList<>();
for (PsiClass psiClass : psiClasses) {
final String qualifiedName = psiClass.getQualifiedName();
final String name = psiClass.getName();
if (qualifiedName != null && name != null) {
BuiltinComponent parentComponent = null;
for (PsiClass aClass = psiClass; aClass != null; aClass = aClass.getSuperClass()) {
final BuiltinComponent component = builtinComponents.get(aClass.getQualifiedName());
if (component != null) {
parentComponent = component;
break;
}
}
final String moduleName = getComponentModuleName(psiClass);
final Map<String, String> attributes = parentComponent != null ? parentComponent.getAttributes() : Collections.emptyMap();
customComponents.add(new CustomComponent(name, qualifiedName, moduleName, attributes));
}
}
return customComponents;
}
use of com.intellij.psi.JavaPsiFacade in project intellij-community by JetBrains.
the class SpringLoadedPositionManagerFactory method usesSpringLoaded.
private static boolean usesSpringLoaded(@NotNull final DebugProcess process) {
Boolean force = process.getProcessHandler().getUserData(FORCE_SPRINGLOADED);
if (force == Boolean.TRUE)
return true;
try (AccessToken ignored = ApplicationManager.getApplication().acquireReadActionLock()) {
JavaPsiFacade facade = JavaPsiFacade.getInstance(process.getProject());
if (facade.findPackage("com.springsource.loaded") != null || facade.findPackage("org.springsource.loaded") != null) {
return true;
}
}
// Check spring loaded for remote process
VirtualMachineProxy proxy = process.getVirtualMachineProxy();
return !proxy.classesByName("com.springsource.loaded.agent.SpringLoadedAgent").isEmpty() || !proxy.classesByName("org.springsource.loaded.agent.SpringLoadedAgent").isEmpty();
}
use of com.intellij.psi.JavaPsiFacade in project intellij-community by JetBrains.
the class DefaultGroovyShellRunner method hasGroovyWithNeededJars.
public static boolean hasGroovyWithNeededJars(Module module) {
GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module);
JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject());
for (String className : REQUIRED_GROOVY_CLASSES) {
if (facade.findClass(className, scope) == null) {
return false;
}
}
return true;
}
use of com.intellij.psi.JavaPsiFacade in project intellij-community by JetBrains.
the class MavenPluginCustomParameterValueConverter method getConverter.
@Override
public Converter getConverter(@NotNull GenericDomValue domElement) {
Project project = domElement.getManager().getProject();
JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
PsiClass psiClass = psiFacade.findClass(myType, GlobalSearchScope.allScope(project));
if (psiClass != null) {
GenericDomValueConvertersRegistry convertersRegistry = MavenDomConvertersRegistry.getInstance().getConvertersRegistry();
return convertersRegistry.getConverter(domElement, psiFacade.getElementFactory().createType(psiClass));
}
return null;
}
Aggregations