Search in sources :

Example 1 with RadGridLayoutManager

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;
}
Also used : NonNls(org.jetbrains.annotations.NonNls) RadGridLayoutManager(com.intellij.uiDesigner.radComponents.RadGridLayoutManager) GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope) RadContainer(com.intellij.uiDesigner.radComponents.RadContainer)

Aggregations

GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 RadContainer (com.intellij.uiDesigner.radComponents.RadContainer)1 RadGridLayoutManager (com.intellij.uiDesigner.radComponents.RadGridLayoutManager)1 NonNls (org.jetbrains.annotations.NonNls)1