void (@NotNull AnActionEvent e) { if (!myContent.isValid()) return; Boolean isPinnedAndExtracted = myContent.getUserData(PINNED_EXTRACTED_CONTENT); if (isPinnedAndExtracted == Boolean.TRUE) { e.getPresentation().setEnabledAndVisible(false); return; } ContentManager contentManager = myContent.getManager(); boolean isActiveTab = contentManager != null && contentManager.getSelectedContent() == myContent; boolean selected = myContent.isPinned(); e.getPresentation().setIcon(AllIcons.General.Pin_tab); Toggleable.setSelected(e.getPresentation(), selected); e.getPresentation().setText(selected ? IdeBundle.message("action.unpin.tab") : IdeBundle.message("action.pin.tab")); e.getPresentation().setEnabledAndVisible(true); }