devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
58 lines (57 loc) • 3.63 kB
JavaScript
import { TableProperties, TablePropertiesMask } from '../../../../../model/tables/properties/table-properties';
import { TableLayoutType, 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_TableProperties extends BaseFormatter {
isHandleObject(obj) {
return obj instanceof TableProperties;
}
getShortDescription(_config) {
const list = [
new Pair("", TableLayoutType[this.curr.layoutType]),
new Pair("indent", this.curr.indent),
];
return this.stdShow(new StdProps(list).showAsLine());
}
availableFullDescription(_config) {
return true;
}
getFullDescription(_config) {
const list = [
new Pair("layoutType", TableLayoutType[this.curr.layoutType]),
new Pair("indent", this.curr.indent),
new Pair("mask", Log.mask(TablePropertiesMask, this.curr.mask, TablePropertiesMask.UseNone)),
];
if (this.curr.getUseValue(TablePropertiesMask.UseCellSpacing))
list.push(new Pair("cellSpacing", this.curr.cellSpacing));
if (this.curr.getUseValue(TablePropertiesMask.UseLeftMargin))
list.push(new Pair("cellMargins.left", this.curr.cellMargins.left));
if (this.curr.getUseValue(TablePropertiesMask.UseRightMargin))
list.push(new Pair("cellMargins.right", this.curr.cellMargins.right));
if (this.curr.getUseValue(TablePropertiesMask.UseTopMargin))
list.push(new Pair("cellMargins.top", this.curr.cellMargins.top));
if (this.curr.getUseValue(TablePropertiesMask.UseBottomMargin))
list.push(new Pair("cellMargins.bottom", this.curr.cellMargins.bottom));
if (this.curr.getUseValue(TablePropertiesMask.UseLeftBorder))
list.push(new Pair("borders.left", this.curr.borders.left));
if (this.curr.getUseValue(TablePropertiesMask.UseRightBorder))
list.push(new Pair("borders.right", this.curr.borders.right));
if (this.curr.getUseValue(TablePropertiesMask.UseTopBorder))
list.push(new Pair("borders.top", this.curr.borders.top));
if (this.curr.getUseValue(TablePropertiesMask.UseBottomBorder))
list.push(new Pair("borders.bottom", this.curr.borders.bottom));
if (this.curr.getUseValue(TablePropertiesMask.UseShadingInfoIndex))
list.push(new Pair("backgroundColor", BaseFormatter.getColorBoxNode(this.curr.shadingInfo.getActualColor(this.model.colorProvider))));
if (this.curr.getUseValue(TablePropertiesMask.UseTableAlignment))
list.push(new Pair("tableRowAlignment", TableRowAlignment[this.curr.tableRowAlignment]));
if (this.curr.getUseValue(TablePropertiesMask.UseTableStyleColBandSize))
list.push(new Pair("tableStyleColumnBandSize", this.curr.tableStyleColumnBandSize));
if (this.curr.getUseValue(TablePropertiesMask.UseTableStyleRowBandSize))
list.push(new Pair("tableStyleRowBandSize", this.curr.tableStyleRowBandSize));
if (this.curr.getUseValue(TablePropertiesMask.UseAvoidDoubleBorders))
list.push(new Pair("avoidDoubleBorders", this.curr.avoidDoubleBorders));
return this.stdShow(new StdProps(list).showAsColumn());
}
}
CCF_TableProperties._foo = BaseFormatter.addToFormattersList(new CCF_TableProperties());