Java 类com.intellij.psi.impl.beanProperties.BeanPropertyElement 实例源码

项目:intellij-ce-playground    文件:JavaDocumentationProvider.java   
@Override
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
  if (element instanceof PsiClass) {
    return generateClassInfo((PsiClass)element);
  }
  else if (element instanceof PsiMethod) {
    return generateMethodInfo((PsiMethod)element, calcSubstitutor(originalElement));
  }
  else if (element instanceof PsiField) {
    return generateFieldInfo((PsiField)element, calcSubstitutor(originalElement));
  }
  else if (element instanceof PsiVariable) {
    return generateVariableInfo((PsiVariable)element);
  }
  else if (element instanceof PsiPackage) {
    return generatePackageInfo((PsiPackage)element);
  }
  else if (element instanceof BeanPropertyElement) {
    return generateMethodInfo(((BeanPropertyElement)element).getMethod(), PsiSubstitutor.EMPTY);
  }
  return null;
}
项目:tools-idea    文件:JavaDocumentationProvider.java   
@Override
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
  if (element instanceof PsiClass) {
    return generateClassInfo((PsiClass)element);
  }
  else if (element instanceof PsiMethod) {
    return generateMethodInfo((PsiMethod)element, calcSubstitutor(originalElement));
  }
  else if (element instanceof PsiField) {
    return generateFieldInfo((PsiField)element, calcSubstitutor(originalElement));
  }
  else if (element instanceof PsiVariable) {
    return generateVariableInfo((PsiVariable)element);
  }
  else if (element instanceof PsiPackage) {
    return generatePackageInfo((PsiPackage)element);
  }
  else if (element instanceof BeanPropertyElement) {
    return generateMethodInfo(((BeanPropertyElement) element).getMethod(), PsiSubstitutor.EMPTY);
  }
  return null;
}
项目:consulo-apache-velocity    文件:VtlReferenceExpression.java   
protected ResolveResult[] resolveInner() {
    final String referenceName = getReferenceName();
    if (referenceName == null) {
        return ResolveResult.EMPTY_ARRAY;
    }

    final PsiElement parent = getParent();
    if (parent instanceof VtlAssignment) {
        VtlAssignment assignment = (VtlAssignment) parent;
        VtlVariable var = assignment.getAssignedVariable();
        if (var != null && assignment.getAssignedVariableElement() == this) {
            return new ResolveResult[]{new PsiElementResolveResult(var)};
        }
    }

    final VtlVariantsProcessor<ResolveResult> processor = new VtlVariantsProcessor<ResolveResult>(parent, getContainingFile(), referenceName, false) {
        protected ResolveResult execute(final PsiNamedElement element, final boolean error) {
            if (element instanceof BeanPropertyElement) {
                return new PsiElementResolveResult(((BeanPropertyElement) element).getMethod());
            }
            return new PsiElementResolveResult(element, !error);
        }
    };
    processVariantsInner(processor);
    return processor.getVariants(ResolveResult.EMPTY_ARRAY, Character.isLowerCase(referenceName.charAt(0)));
}
项目:intellij-ce-playground    文件:JavaElementLookupRenderer.java   
@Override
public void renderElement(final LookupItem item, final Object element, final LookupElementPresentation presentation) {
  presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));

  presentation.setItemText(PsiUtilCore.getName((PsiElement)element));
  presentation.setStrikeout(isToStrikeout(item));

  presentation.setTailText((String)item.getAttribute(LookupItem.TAIL_TEXT_ATTR), item.getAttribute(LookupItem.TAIL_TEXT_SMALL_ATTR) != null);

  PsiType type = ((BeanPropertyElement)element).getPropertyType();
  presentation.setTypeText(type == null ? null : type.getPresentableText());
}
项目:consulo-apache-velocity    文件:VtlDocumentationProvider.java   
public String getQuickNavigateInfo(final PsiElement element, PsiElement element1) {
    if (element instanceof VtlVariable) {
        final VtlVariable variable = (VtlVariable) element;
        final String name = variable.getName();
        PsiType type = variable.getPsiType();
        if (type != null) {
            return type.getPresentableText() + " " + name;
        }
        return name;
    }
    if (element instanceof BeanPropertyElement) {
        return JavaDocumentationProvider.generateMethodInfo(((BeanPropertyElement) element).getMethod(), PsiSubstitutor.EMPTY);
    }
    return null;
}
项目:consulo-apache-velocity    文件:VtlReferenceExpression.java   
@Override
public boolean isReferenceTo(final PsiElement element) {
    final PsiManager manager = getManager();
    for (final ResolveResult result : multiResolve(false)) {
        final PsiElement target = result.getElement();
        if (manager.areElementsEquivalent(element, target)) {
            return true;
        }
        if (target instanceof BeanPropertyElement
                && manager.areElementsEquivalent(element, ((BeanPropertyElement) target).getMethod())) {
            return true;
        }
    }
    return false;
}
项目:consulo-java    文件:JavaElementLookupRenderer.java   
@Override
public void renderElement(final LookupItem item, final Object element, final LookupElementPresentation presentation)
{
    presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));

    presentation.setItemText(PsiUtilCore.getName((PsiElement) element));
    presentation.setStrikeout(isToStrikeout(item));

    presentation.setTailText((String) item.getAttribute(LookupItem.TAIL_TEXT_ATTR), item.getAttribute(LookupItem.TAIL_TEXT_SMALL_ATTR) != null);

    PsiType type = ((BeanPropertyElement) element).getPropertyType();
    presentation.setTypeText(type == null ? null : type.getPresentableText());
}
项目:consulo-java    文件:JavaDocumentationProvider.java   
@Override
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement)
{
    if(element instanceof PsiClass)
    {
        return generateClassInfo((PsiClass) element);
    }
    else if(element instanceof PsiMethod)
    {
        return generateMethodInfo((PsiMethod) element, calcSubstitutor(originalElement));
    }
    else if(element instanceof PsiField)
    {
        return generateFieldInfo((PsiField) element, calcSubstitutor(originalElement));
    }
    else if(element instanceof PsiVariable)
    {
        return generateVariableInfo((PsiVariable) element);
    }
    else if(element instanceof PsiPackage)
    {
        return generatePackageInfo((PsiPackage) element);
    }
    else if(element instanceof BeanPropertyElement)
    {
        return generateMethodInfo(((BeanPropertyElement) element).getMethod(), PsiSubstitutor.EMPTY);
    }
    else if(element instanceof PsiJavaModule)
    {
        return generateModuleInfo((PsiJavaModule) element);
    }
    return null;
}
项目:intellij-ce-playground    文件:JavaElementLookupRenderer.java   
@Override
public boolean handlesItem(final Object element) {
  return element instanceof BeanPropertyElement;
}
项目:tools-idea    文件:JavaElementLookupRenderer.java   
@Override
public boolean handlesItem(final Object element) {
  return element instanceof PsiVariable ||
         element instanceof PsiKeyword || element instanceof PsiExpression ||
         element instanceof PsiTypeElement || element instanceof BeanPropertyElement;
}
项目:consulo-apache-velocity    文件:VtlDocumentationProvider.java   
public String generateDoc(final PsiElement element, final PsiElement originalElement) {
    if (element instanceof BeanPropertyElement) {
        return JavaDocumentationProvider.generateExternalJavadoc(((BeanPropertyElement) element).getMethod());
    }
    return null;
}
项目:consulo-apache-velocity    文件:VtlDocumentationProvider.java   
public PsiElement getDocumentationElementForLookupItem(final PsiManager psiManager, final Object object, final PsiElement element) {
    if (object instanceof VtlVariable || object instanceof BeanPropertyElement) {
        return (PsiElement) object;
    }
    return null;
}
项目:consulo-java    文件:JavaElementLookupRenderer.java   
@Override
public boolean handlesItem(final Object element)
{
    return element instanceof BeanPropertyElement;
}