@Override
  public void update(@NotNull AnActionEvent e) {
    ScopeDescriptor selection = getSelectedScope();
    String name = StringUtil.trimMiddle(StringUtil.notNullize(selection.getDisplayName()), 30);
    String text = StringUtil.escapeMnemonics(name).replaceFirst("(?i)([" + TOGGLE + CHOOSE + "])", "_$1");
    e.getPresentation().setText(text);
    e.getPresentation().setIcon(OffsetIcon.getOriginalIcon(selection.getIcon()));
    String shortcutText = KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke(
      CHOOSE, MnemonicHelper.getFocusAcceleratorKeyMask(), true));
    String shortcutText2 = KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke(
      TOGGLE, MnemonicHelper.getFocusAcceleratorKeyMask(), true));
    e.getPresentation().setDescription(LangBundle.message("action.choose.scope.p.toggle.scope.description", shortcutText, shortcutText2));
    JComponent button = e.getPresentation().getClientProperty(CustomComponentAction.COMPONENT_KEY);
    if (button != null) {
      button.setBackground(selection.getColor());
    }
  }
@Override
  public void update(@NotNull AnActionEvent e)