import { UpdateTablePropertiesAction } from '../actions/update-table-properties-action';
import { TablePropertiesEventHandler } from './table-properties';
/**
 * Cancel Event handler for the table properties.
 */
export class TablePropertiesCancelEventHandler extends TablePropertiesEventHandler {
  /**
   * Cancel table properties changes
   *
   * @param {RTETableExtensionContext} extensionContext - The table extension context.
   * @param {RTETableBlock} tableBlock - The table block that owns the properties.
   * @param {RTETablePropertiesType} data - The origin of the properties.
   * @param {RTENode} focusNode - The node to focus on.
   */
  handle(extensionContext, tableBlock, data, focusNode) {
    tableBlock.apply(new UpdateTablePropertiesAction(data));
    this.updateCursorPosition(extensionContext, focusNode);
  }
}
