/** * Gets the label for the given member. * * @param member the Java member * @param constantValue the constant value if any * @param defaultValue the default value of the annotation type member, if any * @param allowImage <code>true</code> if the Java element image should be shown * @return a string containing the member's label */ private String getInfoText(IJavaElement member, String constantValue, String defaultValue, boolean allowImage) { long flags= JavadocHover.getHeaderFlags(member); IBinding binding= JavadocHover.getHoverBinding(member, null); StringBuffer label; if (binding != null) { label= new StringBuffer(); // setting haveSource to false lets the JavadocView *always* show qualified type names, // would need to track the source of our input to distinguish classfile/compilationUnit: boolean haveSource= false; new BindingLinkedLabelComposer(member, label, haveSource).appendBindingLabel(binding, flags); } else { label= new StringBuffer(JavaElementLinks.getElementLabel(member, flags)); } if (member.getElementType() == IJavaElement.FIELD && constantValue != null) { label.append(constantValue); } else if (member.getElementType() == IJavaElement.METHOD && defaultValue != null) { label.append(JavadocHover.CONSTANT_VALUE_SEPARATOR); label.append(defaultValue); } return JavadocHover.getImageAndLabel(member, allowImage, label.toString()); }
/** * Gets the label for the given member. * * @param member the Java member * @param constantValue the constant value if any * @param allowImage <code>true</code> if the Java element image should be shown * @return a string containing the member's label */ private String getInfoText(IJavaElement member, String constantValue, boolean allowImage) { long flags= JavadocHover.getHeaderFlags(member); IBinding binding= JavadocHover.getHoverBinding(member, null); StringBuffer label; if (binding != null) { label= new StringBuffer(); // setting haveSource to false lets the JavadocView *always* show qualified type names, // would need to track the source of our input to distinguish classfile/compilationUnit: boolean haveSource= false; new BindingLinkedLabelComposer(member, label, haveSource).appendBindingLabel(binding, flags); } else { label= new StringBuffer(JavaElementLinks.getElementLabel(member, flags)); } if (member.getElementType() == IJavaElement.FIELD && constantValue != null) { label.append(constantValue); } return JavadocHover.getImageAndLabel(member, allowImage, label.toString()); }
IBinding binding= getHoverBinding(element, node);
IBinding binding= getHoverBinding(element, node);