UNPKG

devexpress-richedit

Version:

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

44 lines (43 loc) 1.54 kB
import { ClientPublicUiChangesListener } from '../public/commands/ui-changes-listener'; export class ClientBarHolder { ribbon; contextMenu; horizontalRuler; publicUiChangesListener; constructor(ribbon, contextMenu, raiseUpdatePublicUi) { this.ribbon = ribbon; this.contextMenu = contextMenu; this.publicUiChangesListener = new ClientPublicUiChangesListener(raiseUpdatePublicUi); } initialize(core) { this.ribbon?.initialize(core); this.contextMenu.initialize(core); } updateItemsState(queryCommands) { this.ribbon?.updateItemsState(queryCommands); this.contextMenu.updateItemsState(queryCommands); this.publicUiChangesListener.forceUpdate(queryCommands); } setEnabled(_value) { } removeRibbonBar() { this.ribbon?.dispose(); this.ribbon = null; } dispose() { this.contextMenu.dispose(); this.ribbon?.dispose(); } forceUpdate(queryCommands) { this.ribbon?.forceUpdate(queryCommands); this.contextMenu.forceUpdate(queryCommands); this.horizontalRuler.forceUpdate(queryCommands); this.publicUiChangesListener.forceUpdate(queryCommands); } enableUpdate(value) { if (this.ribbon) this.ribbon.updateEnabled = value; this.contextMenu.updateEnabled = value; this.horizontalRuler.updateEnabled = value; this.publicUiChangesListener.updateEnabled = value; } }