void (boolean error) { JBTextField textEditor = mySpeedSearchPatternField.getTextEditor(); if (ExperimentalUI.isNewUI()) { textEditor.setForeground(error ? NamedColorUtil.getErrorForeground() : UIUtil.getLabelForeground()); } else { textEditor.setBackground(error ? LightColors.RED : UIUtil.getTextFieldBackground()); } }