fix instance methods lookup presentation

This commit is contained in:
peter
2011-03-29 10:51:16 +02:00
parent 19b6fb0300
commit 0e43bd831b
2 changed files with 4 additions and 3 deletions
@@ -234,6 +234,7 @@ public class JavaMethodCallElement extends LookupItem<PsiMethod> implements Type
presentation.setItemTextBold(getAttribute(HIGHLIGHTED_ATTR) != null);
MemberLookupHelper helper = myHelper != null ? myHelper : new MemberLookupHelper(myMethod, myContainingClass, false, false);
helper.renderElement(presentation, getAttribute(FORCE_QUALIFY) != null, getSubstitutor());
final Boolean qualify = getAttribute(FORCE_QUALIFY) != null ? Boolean.TRUE : myHelper == null ? Boolean.FALSE : null;
helper.renderElement(presentation, qualify, getSubstitutor());
}
}
@@ -45,11 +45,11 @@ public class MemberLookupHelper {
return myShouldImport;
}
public void renderElement(LookupElementPresentation presentation, boolean forceQualify, PsiSubstitutor substitutor) {
public void renderElement(LookupElementPresentation presentation, @Nullable Boolean qualify, PsiSubstitutor substitutor) {
final String className = myContainingClass == null ? "???" : myContainingClass.getName();
final String memberName = myMember.getName();
if (!myShouldImport && StringUtil.isNotEmpty(className) || forceQualify) {
if (!Boolean.FALSE.equals(qualify) && (!myShouldImport && StringUtil.isNotEmpty(className) || Boolean.TRUE.equals(qualify))) {
presentation.setItemText(className + "." + memberName);
} else {
presentation.setItemText(memberName);