IDEA-25024 Quick preview (Ctrl+Shift+I) does not work for Spring beans

This commit is contained in:
Dmitry Avdeev
2012-04-06 11:31:37 +04:00
parent 54beec7c9e
commit b22f502d77
@@ -16,6 +16,7 @@
package com.intellij.psi.impl;
import com.intellij.ide.IconProvider;
import com.intellij.ide.TypePresentationService;
import com.intellij.lang.Language;
import com.intellij.openapi.project.Project;
import com.intellij.pom.*;
@@ -93,6 +94,9 @@ public class PomTargetPsiElementImpl extends RenameableFakePsiElement implements
}
}
Icon icon = TypePresentationService.getService().getIcon(myTarget);
if (icon != null) return icon;
if (myTarget instanceof PsiTarget) {
return ((PsiTarget)myTarget).getNavigationElement().getIcon(0);
}
@@ -192,4 +196,15 @@ public class PomTargetPsiElementImpl extends RenameableFakePsiElement implements
public Project getProject() {
return myProject;
}
@Override
public String getLocationString() {
if (myTarget instanceof PsiTarget) {
PsiFile file = ((PsiTarget)myTarget).getNavigationElement().getContainingFile();
if (file != null) {
return "(" + file.getName() + ")";
}
}
return super.getLocationString();
}
}