devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
43 lines (42 loc) • 2.12 kB
JavaScript
import { DocumentLayoutDetailsLevel } from '../../../../layout/document-layout-details-level';
import { LayoutPosition } from '../../../../layout/layout-position';
import { LayoutBoxType } from '../../../../layout/main-structures/layout-boxes/layout-box';
import { Pair } from '@devexpress/utils/lib/class/pair';
import { BaseFormatter, StdProps } from '../base-formatter';
export class CCF_LayoutPosition extends BaseFormatter {
isHandleObject(obj) {
return obj instanceof LayoutPosition;
}
getShortDescription(_config) {
return this.stdShow(new StdProps([
new Pair("lvl", DocumentLayoutDetailsLevel[this.curr.detailsLevel]),
new Pair("p", this.curr.pageIndex),
new Pair("pa", this.curr.pageAreaIndex),
new Pair("c", this.curr.columnIndex),
new Pair("r", this.curr.rowIndex),
new Pair("b", this.curr.boxIndex),
new Pair("c", this.curr.charOffset)
]).showAsLine());
}
availableFullDescription(_config) {
return true;
}
getFullDescription(_config) {
return this.stdShow(new StdProps([
new Pair("detailsLevel", DocumentLayoutDetailsLevel[this.curr.detailsLevel]),
new Pair("pageInd", this.curr.pageIndex),
new Pair("page", this.curr.page),
new Pair("pageAreaInd", this.curr.pageAreaIndex),
new Pair("pageArea", this.curr.pageArea),
new Pair("columnInd", this.curr.columnIndex),
new Pair("column", this.curr.column),
new Pair("rowInd", this.curr.rowIndex),
new Pair("row", this.curr.row),
new Pair("boxInd", this.curr.boxIndex),
new Pair("box", this.curr.box),
new Pair("charOffset", this.curr.charOffset),
new Pair("char", this.curr.box && this.curr.box.getType() == LayoutBoxType.Text ? this.curr.box.text.charAt(this.curr.charOffset) : null),
]).showAsColumn());
}
}
CCF_LayoutPosition._foo = BaseFormatter.addToFormattersList(new CCF_LayoutPosition());