Icon (boolean hovered) { Presentation presentation = action.getTemplatePresentation(); if (!(action instanceof TextSearchRightActionAction)) return presentation.getIcon(); if (((TextSearchRightActionAction)action).isSelected()) { return presentation.getSelectedIcon(); } else if (hovered) { return presentation.getHoveredIcon(); } else { return presentation.getIcon(); } }