devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
44 lines (43 loc) • 2.1 kB
JavaScript
import { Table } from '../../../../../model/tables/main-structures/table';
import { TableLookTypes } from '../../../../../model/tables/secondary-structures/table-base-structures';
import { Log } from '../../../logger/base-logger/log';
import { Pair } from '@devexpress/utils/lib/class/pair';
import { NumberMapUtils } from '@devexpress/utils/lib/utils/map/number';
import { BaseFormatter, StdProps } from '../../base-formatter';
export class CCF_Table extends BaseFormatter {
isHandleObject(obj) {
return obj instanceof Table;
}
getShortDescription(_config) {
const list = [
new Pair("", this.curr.index + ":"),
new Pair("lvl", this.curr.nestedLevel),
new Pair("rows", this.curr.rows.length)
];
return this.stdShow(new StdProps(list).showAsLine());
}
availableFullDescription(_config) {
return true;
}
getFullDescription(_config) {
const list = [
new Pair("index", this.curr.index),
new Pair("nestedLevel", this.curr.nestedLevel),
new Pair("interval", this.curr.interval),
new Pair("preferredWidth", this.curr.preferredWidth),
new Pair("properties", this.curr.properties),
new Pair("text", this.getRawText(this.getSubDocument().getText(this.curr.interval)).setLen(30)),
new Pair("runsOnCell", this.getSubDocument().getRunsByInterval(this.curr.interval)),
new Pair("lookTypes", Log.mask(TableLookTypes, this.curr.lookTypes, TableLookTypes.None)),
new Pair("style", this.curr.style),
new Pair("rows", this.curr.rows),
];
if (this.curr.nestedLevel > 0)
list.push(new Pair("parentCell", this.curr.parentCell));
return this.stdShow(new StdProps(list).showAsColumn());
}
getSubDocument() {
return NumberMapUtils.elementBy(this.model.subDocuments, (subDoc) => subDoc.tables[this.curr.index] == this.curr);
}
}
CCF_Table._foo = BaseFormatter.addToFormattersList(new CCF_Table());