Presentation (@NotNull AnAction action) { Presentation presentation = myPresentations.get(action); if (presentation == null && action instanceof TransparentWrapper && action instanceof ActionWithDelegate<?> wrapper) { presentation = myPresentations.get(wrapper.getDelegate()); } boolean needUpdate = presentation != null && Boolean.TRUE.equals(presentation.getClientProperty(NEED_UPDATE_PRESENTATION)); if (presentation == null || needUpdate) { Presentation templatePresentation = action.getTemplatePresentation(); if (presentation == null) { presentation = templatePresentation.clone(); presentation = Objects.requireNonNullElse(myPresentations.putIfAbsent(action, presentation), presentation); } if (needUpdate) { presentation.setIcon(templatePresentation.getIcon()); presentation.setDisabledIcon(templatePresentation.getDisabledIcon()); presentation.putClientProperty(NEED_UPDATE_PRESENTATION, null); } processPresentation(presentation, action); } return presentation; }