@Override
    public final void update(@NotNull AnActionEvent event) {
      Presentation presentation = event.getPresentation();

      HierarchyBrowserBaseEx browser = event.getData(HIERARCHY_BROWSER);
      if (browser == null) {
        presentation.setEnabledAndVisible(false);
        return;
      }

      presentation.setVisible(true);

      PsiElement selectedElement = browser.getSelectedElement(event.getDataContext());
      if (selectedElement == null || !browser.isApplicableElementForBaseOn(selectedElement)) {
        presentation.setEnabledAndVisible(false);
      }
      else {
        String typeName = ElementDescriptionUtil.getElementDescription(selectedElement, UsageViewTypeLocation.INSTANCE);
        if (StringUtil.isNotEmpty(typeName)) {
          presentation.setText(IdeBundle.messagePointer("action.base.on.this.0", StringUtil.capitalize(typeName)));
        }
        presentation.setEnabled(isEnabled(browser, selectedElement));
      }
    }
@Override
    public final void update(@NotNull AnActionEvent event)