boolean () { CharSequence hintText = myEditor.getPlaceholder(); EditorComponentImpl editorComponent = myEditor.getContentComponent(); if (myDocument.getTextLength() > 0 || hintText == null || hintText.length() == 0 || KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() == editorComponent && !myEditor.getShowPlaceholderWhenFocused()) { return false; } EditorFontType fontType = EditorFontType.PLAIN; Color color = JBColor.namedColor("Component.infoForeground", myEditor.getColorsScheme().getDefaultForeground()); TextAttributes attributes = myEditor.getPlaceholderAttributes(); if (attributes != null) { int type = attributes.getFontType(); if (type == Font.ITALIC) fontType = EditorFontType.ITALIC; else if (type == Font.BOLD) fontType = EditorFontType.BOLD; else if (type == (Font.ITALIC | Font.BOLD)) fontType = EditorFontType.BOLD_ITALIC; Color attColor = attributes.getForegroundColor(); if (attColor != null) color = attColor; } myGraphics.setColor(color); String hintString = hintText.toString(); myGraphics.setFont(UIUtil.getFontWithFallbackIfNeeded(myEditor.getColorsScheme().getFont(fontType), hintString)); String toDisplay = SwingUtilities.layoutCompoundLabel(myGraphics.getFontMetrics(), hintString, null, 0, 0, 0, 0, SwingUtilities.calculateInnerArea(editorComponent, null), // account for insets new Rectangle(), new Rectangle(), 0); myGraphics.drawString(toDisplay, myInsets.left, myInsets.top + myAscent + myYShift); return true; }