@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; }
@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; }
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))); }
@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()); }
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; }
@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; }
@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()); }
@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; }
@Override public boolean handlesItem(final Object element) { return element instanceof BeanPropertyElement; }
@Override public boolean handlesItem(final Object element) { return element instanceof PsiVariable || element instanceof PsiKeyword || element instanceof PsiExpression || element instanceof PsiTypeElement || element instanceof BeanPropertyElement; }
public String generateDoc(final PsiElement element, final PsiElement originalElement) { if (element instanceof BeanPropertyElement) { return JavaDocumentationProvider.generateExternalJavadoc(((BeanPropertyElement) element).getMethod()); } return null; }
public PsiElement getDocumentationElementForLookupItem(final PsiManager psiManager, final Object object, final PsiElement element) { if (object instanceof VtlVariable || object instanceof BeanPropertyElement) { return (PsiElement) object; } return null; }