# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: D:\ws\main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: java.editor/src/org/netbeans/modules/java/editor/overridden/ElementDescription.java --- java.editor/src/org/netbeans/modules/java/editor/overridden/ElementDescription.java +++ java.editor/src/org/netbeans/modules/java/editor/overridden/ElementDescription.java @@ -48,6 +48,7 @@ import java.util.Collection; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; +import static javax.lang.model.element.ElementKind.METHOD; import javax.lang.model.element.Modifier; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; @@ -70,6 +71,7 @@ public class ElementDescription { private static final String PKG_COLOR = Utilities.getHTMLColor(192, 192, 192); + private final ElementKind imageKind; private ClasspathInfo originalCPInfo; @@ -82,6 +84,12 @@ public ElementDescription(CompilationInfo info, Element element, boolean overriddenFlag) { this.originalCPInfo = info.getClasspathInfo(); this.handle = ElementHandle.create(element); + if (METHOD.equals(element.getKind()) && null != element.getEnclosingElement()) { + //when showing the implementors/overriders of a method, show the type icon (not the method icon) + this.imageKind = element.getEnclosingElement().getKind(); + } else { + this.imageKind = this.handle.getKind(); + } this.outtermostElement = ElementHandle.create(SourceUtils.getOutermostEnclosingTypeElement(element)); this.modifiers = element.getModifiers(); this.displayName = overriddenFlag ? computeDisplayNameIsOverridden(element) : computeDisplayNameOverrides(element); @@ -190,7 +198,7 @@ badge = ImageUtilities.loadImage("org/netbeans/modules/java/editor/resources/overrides-badge.png"); } - Image icon = ImageUtilities.icon2Image(ElementIcons.getElementIcon(handle.getKind(), modifiers)); + Image icon = ImageUtilities.icon2Image(ElementIcons.getElementIcon(imageKind, modifiers)); return ImageUtilities.image2Icon(ImageUtilities.mergeImages(icon, badge, 16, 0)); }