Icon (@Nullable ActionOrGroup actionOrGroup) { if (actionOrGroup == null || !DomUtil.hasXml(actionOrGroup.getIcon())) { return actionOrGroup instanceof Group ? AllIcons.Actions.GroupByPackage : null; } XmlAttributeValue iconAttrValue = actionOrGroup.getIcon().getXmlAttributeValue(); assert iconAttrValue != null; boolean referenceFound = false; for (PsiReference reference : iconAttrValue.getReferences()) { referenceFound = true; Icon icon = getIconFromReference(reference); if (icon != null) { return icon; } } // icon field initializer may not be available if there're no attached sources for containing class if (referenceFound) { String value = iconAttrValue.getValue(); Icon icon = IconLoader.findIcon(value, ActionOrGroupPresentationProvider.class, false, false); if (icon != null) { return icon; } } return null; }