void (@NotNull AnActionEvent e) { boolean selected = !myContent.isPinned(); if (selected) { myContent.putUserData(ToolWindow.SHOW_CONTENT_ICON, Boolean.TRUE); } myContent.setPinned(selected); Toggleable.setSelected(e.getPresentation(), selected); }