@NotNull @Override public PsiElement getNavigationElement() { if (myTarget instanceof PsiTarget) { return ((PsiTarget)myTarget).getNavigationElement(); } return super.getNavigationElement(); }
@Override public boolean isValid() { if (myTarget instanceof PsiTarget) { return ((PsiTarget)myTarget).getNavigationElement().isValid(); } return myTarget.isValid(); }
@Override public PsiElement getContext() { if (myTarget instanceof PsiTarget) { return ((PsiTarget)myTarget).getNavigationElement(); } return null; }
@Override @Nullable public PsiFile getContainingFile() { if (myTarget instanceof PsiTarget) { return ((PsiTarget)myTarget).getNavigationElement().getContainingFile(); } return null; }
@Override @NotNull public Language getLanguage() { if (myTarget instanceof PsiTarget) { return ((PsiTarget)myTarget).getNavigationElement().getLanguage(); } return Language.ANY; }
@Override public String getLocationString() { if (myTarget instanceof PsiTarget) { PsiFile file = ((PsiTarget)myTarget).getNavigationElement().getContainingFile(); if (file != null) { return "(" + file.getName() + ")"; } } return super.getLocationString(); }
@Override public boolean execute(@NotNull PsiElement queryParameters, @NotNull Processor<PsiElement> consumer) { if (queryParameters instanceof PomTargetPsiElement) { final PomTarget target = ((PomTargetPsiElement)queryParameters).getTarget(); if (target instanceof PsiTarget) { if (!consumer.process(((PsiTarget)target).getNavigationElement())) return false; } } return true; }
@Override public boolean execute(@Nonnull DefinitionsScopedSearch.SearchParameters parameters, @Nonnull Processor<PsiElement> consumer) { PsiElement element = parameters.getElement(); if (element instanceof PomTargetPsiElement) { final PomTarget target = ((PomTargetPsiElement)element).getTarget(); if (target instanceof PsiTarget) { if (!consumer.process(((PsiTarget)target).getNavigationElement())) return false; } } return true; }
@Nonnull @Override public PsiElement getNavigationElement() { if (myTarget instanceof PsiTarget) { return ((PsiTarget)myTarget).getNavigationElement(); } return super.getNavigationElement(); }
@Override public Icon getIcon() { Icon icon = TypePresentationService.getInstance().getIcon(myTarget); if (icon != null) return icon; if (myTarget instanceof PsiTarget) { return IconDescriptorUpdaters.getIcon(((PsiTarget)myTarget).getNavigationElement(), 0); } return null; }
@Override @Nonnull public Language getLanguage() { if (myTarget instanceof PsiTarget) { return ((PsiTarget)myTarget).getNavigationElement().getLanguage(); } return Language.ANY; }
public static PsiElement convertToPsi(@NotNull PsiTarget target) { return getInstance(target.getNavigationElement().getProject()).convertToPsi((PomTarget)target); }
public PomTargetPsiElementImpl(@NotNull PsiTarget target) { this(target.getNavigationElement().getProject(), target); }
@Override public boolean isEquivalentTo(PsiElement another) { return equals(another) || (another != null && myTarget instanceof PsiTarget && another.isEquivalentTo(((PsiTarget)myTarget).getNavigationElement())); }
public static PsiElement convertToPsi(@Nonnull PsiTarget target) { return getInstance(target.getNavigationElement().getProject()).convertToPsi((PomTarget)target); }
public PomTargetPsiElementImpl(@Nonnull PsiTarget target) { this(target.getNavigationElement().getProject(), target); }