import { TableSettingButtonSlimmer } from './table-setting-button-slimmer.abstract';
import { TableSettingType } from '../../../setting-event-handlers/setting-event-handler.abstract';
/**
 * Slimmer dedicated to building the caption button.
 */
export class CaptionButtonSlimmer extends TableSettingButtonSlimmer {
  constructor() {
    super({
      icon: 'rte-table-caption',
      title: 'caption off',
      showArrowIcon: false,
    });
  }
  isSelected() {
    return this.hasCaption;
  }
  isDisabled() {
    return false;
  }
  handleClick() {
    const caption = !this.hasCaption ? 'rte-table-caption' : '';
    this.emitClickEvent([TableSettingType.CAPTION, caption]);
  }
  getTitle() {
    return this.hasCaption ? 'caption on' : 'caption off';
  }
}
