void (@NotNull JList list, Object value, int index, boolean selected, boolean hasFocus) { //noinspection UseDPIAwareInsets setIpad(new Insets(0, 0, 0, getIpad().right)); // Border of top panel is used for around insets of renderer setIcon(presentation.getIcon()); setIconTextGap(RendererPanelsUtils.getIconTextGap()); SimpleTextAttributes nameAttributes = presentation.getPresentableTextAttributes() != null ? SimpleTextAttributes.fromTextAttributes(presentation.getPresentableTextAttributes()) : new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, null); SpeedSearchUtil.appendColoredFragmentForMatcher(presentation.getPresentableText(), this, nameAttributes, matchers.nameMatcher, bgColor, selected); if (presentation.getContainerText() != null) { Insets listInsets = list.getInsets(); Insets rendererInsets = getInsets(); FontMetrics fm = list.getFontMetrics(list.getFont()); int containerMaxWidth = list.getWidth() - listInsets.left - listInsets.right - rendererInsets.left - rendererInsets.right - getPreferredSize().width; if (locationLabel != null) containerMaxWidth -= locationLabel.getPreferredSize().width; @NlsSafe String containerText = PSIRenderingUtils.cutContainerText(presentation.getContainerText(), containerMaxWidth, fm); SimpleTextAttributes containerAttributes = presentation.getContainerTextAttributes() != null ? SimpleTextAttributes.fromTextAttributes(presentation.getContainerTextAttributes()) : SimpleTextAttributes.GRAYED_ATTRIBUTES; SpeedSearchUtil.appendColoredFragmentForMatcher(" " + containerText, this, containerAttributes, matchers.locationMatcher, bgColor, selected); } }