Reference Source
public class | source

DisplayCommand

Extends:

devapt-core-common/dist/js/base/loggable~LoggableNameTypeSettingsLoggableCommand → DisplayCommand

Display command class.

Example:


	API
		->do():Promise - do display.
		->undo():Promise - undo display and display history previous content.

Constructor Summary

Public Constructor
public

constructor(arg_runtime: object, arg_settings: object, arg_log_context: string): nothing

Creates an instance of DisplayCommand.

Member Summary

Public Members
public

Method Summary

Public Methods
public

Get route.

public

Get target route.

public

Check if command settings is valid.

Private Methods
private

Do command.

private

Undo command.

Inherited Summary

From class NameTypeSettingsLoggable
public
private
private
private

_ui: *

public

Get instance name.

public

Get router.

public

Get runtime.

public

Get instance settings.

public

get_state_store(): Store

Get runtime state store.

public

Get instance type.

public

get_ui(): UI

Get UI.

public

Check if instance settings is valid.

From class Command
public
public

do(): Promise

Do command.

public

Undo command.

private

Do command.

private

Undo command.

Public Constructors

public constructor(arg_runtime: object, arg_settings: object, arg_log_context: string): nothing source

Creates an instance of DisplayCommand.

A DisplayCommand configuration is a simple object with:

Common attributes:

    - name:string - command unique name.
    - type:string - type of commnand from command factory known types list (example: display).
    - label:string - displayable short descriptive string.
    - url or route:string : route to display content.

Middleware route attributes:

    - middleware:string - middleware name to call on server side.

Browser route attributes:

    - view:string - view name to render on browser side.
    - menubar:string - menubar name to render on browser side (optional).

Override:

Command#constructor

Params:

NameTypeAttributeDescription
arg_runtime object

client runtime.

arg_settings object

command settings.

arg_log_context string

context of traces of this instance (optional).

Return:

nothing

Public Members

public is_display_command: boolean source

Public Methods

public get_route(): string source

Get route.

Return:

string

public get_target_route(): string source

Get target route.

Return:

string

public is_valid(): boolean source

Check if command settings is valid.

Override:

NameTypeSettingsLoggable#is_valid

Return:

boolean

Private Methods

private _do(): Promise source

Do command.

Override:

Command#_do

Return:

Promise

private _undo(): Promise source

Undo command.

Override:

Command#_undo

Return:

Promise