use of com.intellij.uiDesigner.radComponents.RadGridLayoutManager in project intellij-community by JetBrains.
the class IntrospectedProperty method appliesTo.
@Override
public boolean appliesTo(final RadComponent component) {
@NonNls String name = getName();
//noinspection SimplifiableIfStatement
if (name.equals(SwingProperties.PREFERRED_SIZE) || name.equals(SwingProperties.MINIMUM_SIZE) || name.equals(SwingProperties.MAXIMUM_SIZE)) {
// our own properties must be used instead
final RadContainer parent = component.getParent();
return parent != null && !(parent.getLayoutManager() instanceof RadGridLayoutManager);
}
// check if property is available in the JDK used by the module containing the component
final PsiManager psiManager = PsiManager.getInstance(component.getProject());
final GlobalSearchScope scope = component.getModule().getModuleWithDependenciesAndLibrariesScope(true);
PsiClass componentClass = JavaPsiFacade.getInstance(psiManager.getProject()).findClass(component.getComponentClassName(), scope);
if (componentClass == null)
return true;
final PsiMethod[] psiMethods = componentClass.findMethodsByName(myReadMethod.getName(), true);
for (PsiMethod method : psiMethods) {
if (!method.hasModifierProperty(PsiModifier.STATIC) && method.getParameterList().getParametersCount() == 0) {
return true;
}
}
return false;
}
Aggregations