UNPKG

devexpress-richedit

Version:

DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.

45 lines (44 loc) 2.66 kB
import { TableRowProperties, TableRowPropertiesMask } from '../../../../../model/tables/properties/table-row-properties'; import { TableRowAlignment } from '../../../../../model/tables/secondary-structures/table-base-structures'; import { Log } from '../../../logger/base-logger/log'; import { Pair } from '@devexpress/utils/lib/class/pair'; import { BaseFormatter, StdProps } from '../../base-formatter'; export class CCF_TableRowProperties extends BaseFormatter { isHandleObject(obj) { return obj instanceof TableRowProperties; } getShortDescription(_config) { const list = []; if (this.curr.getUseValue(TableRowPropertiesMask.UseCantSplit)) list.push(new Pair("cantSplit", this.curr.cantSplit)); if (this.curr.getUseValue(TableRowPropertiesMask.UseCellSpacing)) list.push(new Pair("cellSpacing", this.curr.cellSpacing)); if (this.curr.getUseValue(TableRowPropertiesMask.UseTableRowAlignment) && this.curr.tableRowAlignment != TableRowAlignment.Left) list.push(new Pair("tableRowAlignment", TableRowAlignment[this.curr.tableRowAlignment])); if (this.curr.getUseValue(TableRowPropertiesMask.UseHideCellMark) && this.curr.header) list.push(new Pair("", "header")); return this.stdShow(new StdProps(list).showAsLine()); } availableFullDescription(_config) { return true; } getFullDescription(_config) { const list = [ new Pair("mask", Log.mask(TableRowPropertiesMask, this.curr.mask, TableRowPropertiesMask.UseNone)), ]; if (this.curr.getUseValue(TableRowPropertiesMask.UseCellSpacing)) list.push(new Pair("cellSpacing", this.curr.cellSpacing)); if (this.curr.getUseValue(TableRowPropertiesMask.UseCantSplit)) list.push(new Pair("cantSplit", this.curr.cantSplit)); if (this.curr.getUseValue(TableRowPropertiesMask.UseHeader)) list.push(new Pair("header", this.curr.header)); if (this.curr.getUseValue(TableRowPropertiesMask.UseDivId)) list.push(new Pair("divId", this.curr.divId)); if (this.curr.getUseValue(TableRowPropertiesMask.UseTableRowAlignment)) list.push(new Pair("tableRowAlignment", TableRowAlignment[this.curr.tableRowAlignment])); if (this.curr.getUseValue(TableRowPropertiesMask.UseHideCellMark)) list.push(new Pair("header", this.curr.hideCellMark)); return this.stdShow(new StdProps(list).showAsColumn()); } } CCF_TableRowProperties._foo = BaseFormatter.addToFormattersList(new CCF_TableRowProperties());