devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
39 lines (38 loc) • 1.87 kB
JavaScript
import { ClientServerTextBufferChangedCommandRequest, EditCommandRequest, EditTextBufferCommandRequest, ServerCommandRequest } from '../../../model/json/command-request';
import { CommandType } from '../../../model/json/command-type';
import { Pair } from '@devexpress/utils/lib/class/pair';
import { BaseFormatter, StdProps } from './base-formatter';
export class CCF_ServerCommandRequest extends BaseFormatter {
isHandleObject(obj) {
return obj instanceof ServerCommandRequest;
}
getShortDescription(_config) {
const list = [
new Pair("type", `${CommandType[this.curr.type]}(${this.curr.type})`)
];
return this.stdShow(new StdProps(list).showAsLine());
}
availableFullDescription(_config) {
return true;
}
getFullDescription(_config) {
const list = [
new Pair("type", `${CommandType[this.curr.type]}(${this.curr.type})`),
new Pair("subDocId", this.curr.subDocumentId),
new Pair("id", this.curr.id),
new Pair("processOnCallback", this.curr.processOnCallback),
new Pair("params", this.curr.params)
];
if (this.curr instanceof EditCommandRequest) {
list.push(new Pair("editIncId", this.curr.editIncId));
if (this.curr instanceof EditTextBufferCommandRequest)
list.push(new Pair("text", this.curr.text));
if (this.curr instanceof ClientServerTextBufferChangedCommandRequest)
list.push(new Pair("text", this.curr.state));
}
else
list.push(new Pair("fontInfoCacheLength", this.curr.fontInfoCacheLength));
return this.stdShow(new StdProps(list).showAsColumn());
}
}
CCF_ServerCommandRequest._foo = BaseFormatter.addToFormattersList(new CCF_ServerCommandRequest());