UNPKG

devexpress-richedit

Version:

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

27 lines (26 loc) 1 kB
import { Pair } from '@devexpress/utils/lib/class/pair'; import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed'; import { BaseFormatter, StdProps } from '../base-formatter'; export class CCF_FixedInterval extends BaseFormatter { isHandleObject(obj) { return obj instanceof FixedInterval; } getShortDescription(_config) { const list = [ new Pair("", `[${this.curr.start}, ${this.curr.end}]`), ]; return this.stdShow(new StdProps(list).showAsLine()); } availableFullDescription(_config) { return this.curr.length > 1; } getFullDescription(_config) { const list = [ new Pair("start", this.curr.start), new Pair("end", this.curr.end), new Pair("length", this.curr.length), ]; return this.stdShow(new StdProps(list).showAsColumn()); } } CCF_FixedInterval._foo = BaseFormatter.addToFormattersList(new CCF_FixedInterval());