1 2 3 4 5 6 7 8 9 10 11 12 13 | 615× 615× | class ExecuteCommandHandler { constructor(editorSession, commandName) { this.editorSession = editorSession this.commandName = commandName } execute(params) { let commandState = params.editorSession.getCommandStates()[this.commandName] if (!commandState || commandState.disabled) return false this.editorSession.executeCommand(this.commandName, params) return true } } export default ExecuteCommandHandler |