devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
21 lines (20 loc) • 1.07 kB
JavaScript
import { TableWidthUnit, TableWidthUnitType } from '../../../../../model/tables/secondary-structures/table-units';
import { Pair } from '@devexpress/utils/lib/class/pair';
import { UnitConverter } from '@devexpress/utils/lib/class/unit-converter';
import { BaseFormatter, StdProps } from '../../base-formatter';
export class CCF_TableWidthUnit extends BaseFormatter {
isHandleObject(obj) {
return obj instanceof TableWidthUnit;
}
getShortDescription(_config) {
const list = [
new Pair("", TableWidthUnitType[this.curr.type] + ":"),
];
if (this.curr.type == TableWidthUnitType.FiftiethsOfPercent)
list.push(new Pair("", `${this.curr.value}(${this.curr.value / TableWidthUnit.MAX_PERCENT_WIDTH * 100}%)`));
else
list.push(new Pair("", `${this.curr.value}(${UnitConverter.twipsToPixels(this.curr.value)}px)`));
return this.stdShow(new StdProps(list).showAsLine());
}
}
CCF_TableWidthUnit._foo = BaseFormatter.addToFormattersList(new CCF_TableWidthUnit());