void (@NotNull Inlay inlay, @NotNull Graphics g, @NotNull Rectangle r, @NotNull TextAttributes textAttributes) { EditorImpl editor = (EditorImpl)inlay.getEditor(); TextAttributes inlineAttributes = getAttributes(editor); if (inlineAttributes == null || inlineAttributes.getForegroundColor() == null) return; Font font = getFont(editor); g.setFont(font); FontMetrics metrics = getFontMetrics(font, editor); int gap = 1;//(r.height < fontMetrics.lineHeight + 2) ? 1 : 2; int margin = metrics.charWidth(' ') / 4; Color backgroundColor = inlineAttributes.getBackgroundColor(); int curX = r.x + metrics.charWidth(' '); if (backgroundColor != null) { GraphicsConfig config = GraphicsUtil.setupAAPainting(g); GraphicsUtil.paintWithAlpha(g, BACKGROUND_ALPHA); g.setColor(backgroundColor); g.fillRoundRect(curX + margin, r.y + gap, r.width - (2 * margin) - metrics.charWidth(' '), r.height - gap * 2, 6, 6); config.restore(); } curX += (2 * margin); if (myCustomNode) { Icon watchIcon = AllIcons.Debugger.Watch; watchIcon.paintIcon(inlay.getEditor().getComponent(), g, curX, getIconY(watchIcon, r)); curX += watchIcon.getIconWidth() + margin * 2; } myTextStartXCoordinate = curX; for (int i = 0; i < myPresentation.getTexts().size(); i++) { String curText = myPresentation.getTexts().get(i); if (i == 0 && !isErrorMessage()) { curText += NAME_VALUE_SEPARATION; } SimpleTextAttributes attr = myPresentation.getAttributes().get(i); Color fgColor = isHovered ? inlineAttributes.getForegroundColor() : attr.getFgColor(); g.setColor(fgColor); g.drawString(curText, curX, r.y + inlay.getEditor().getAscent()); curX += metrics.stringWidth(curText); if (isErrorMessage()) { break; } } if (isHovered) { Icon icon; if (myCustomNode) { icon = AllIcons.Actions.Close; myRemoveXCoordinate = curX; } else { icon = AllIcons.General.LinkDropTriangle; } icon.paintIcon(inlay.getEditor().getComponent(), g, curX, getIconY(icon, r)); } paintEffects(g, r, editor, inlineAttributes, font, metrics); }