Reference Source
public class | source

UI

Extends:

../node_modules/devapt-core-common/dist/js/base/loggable.js~Loggable → UI

Constructor Summary

Public Constructor
public

constructor(arg_runtime: object, arg_store: object): nothing

Create a UI instance.

Member Summary

Public Members
public
public

classes: {}

public
public

page: {"menubar": *, "header": *, "breadcrumbs": *, "content": *, "footer": *}

public

store: *

Private Members
private
private
private
private
private
private
private
private
private
private
private
private

Method Summary

Public Methods
public

create(arg_name: string): Promise

Create a UI component.

public

Create a DisplayCommand instance.

public

create_local(arg_name: string, arg_component_desc: object): Component

Create a UI component.

public

get(arg_name: string): Component

Get a UI component by its name.

public

Get current application layout.

public

Get a resolver function to find UI component class.

public

Get a resolver function to find UI rendering function.

public

Get a resolver function to find UI component description.

public

has(arg_name: string): boolean

Test a UI component by its name.

public

Test if UI is loaded and is ready to process display commands.

public

load(): nothing

Load plugins.

public

pipe_display_command(arg_display_command: DisplayCommand): nothing

Append a display command to the UI commands pipe.

public

register_rendering_plugin(arg_plugin_class: *): nothing

Register a browser rendering plugin.

public

request_middleware(arg_middleware: string, arg_svc_route: string): Promise

Request server about middleware rendering.

Public Constructors

public constructor(arg_runtime: object, arg_store: object): nothing source

Create a UI instance.

API:
    ->constructor(arg_runtime, arg_store)

    ->is_loaded():boolean - Test if UI is loaded and is ready to process display commands.

    ->create_display_command(arg_cmd_settings):DisplayCommand - Create a DisplayCommand instance.
    ->pipe_display_command(arg_display_command):nothing - Append a display command to the UI commands pipe.

    ->get_current_layout():Layout - Get current application layout.
    ->get_resource_description_resolver():function - Get a resolver function to find UI component description.
    ->get_rendering_function_resolver():function - Get a resolver function to find UI rendering function.
    ->get_rendering_class_resolver():Class - Get a resolver function to find UI component class.

    ->load():nothing - Load plugins.

    ->get(arg_name):Component - Get a UI component by its name.
    ->create(arg_name):Promise - Create a UI component.
    ->create_local(arg_name, arg_component_desc):Component - Create a UI component.

    ->register_rendering_plugin(arg_plugin_class):nothing - Register a browser rendering plugin.
    ->request_middleware(arg_middleware, arg_svc_route):Promise - Request server about middleware rendering.

Params:

NameTypeAttributeDescription
arg_runtime object

client runtime.

arg_store object

UI components state store.

Return:

nothing

Public Members

public body_page: * source

public classes: {} source

public is_ui: boolean source

public page: {"menubar": *, "header": *, "breadcrumbs": *, "content": *, "footer": *} source

public store: * source

Private Members

private _display_command_timer: * source

private _display_command_waiting: *[] source

private _display_commands_pipe: * source

private _ordered_used_plugins_name: *[] source

private _rendering_plugins: *[] source

private _rendering_plugins_counter: number source

private _rendering_plugins_map: {} source

private _runtime: * source

private _ui_builder: * source

private _ui_factory: * source

private _ui_layout: * source

private _ui_rendering: * source

Public Methods

public create(arg_name: string): Promise source

Create a UI component.

Params:

NameTypeAttributeDescription
arg_name string

component name.

Return:

Promise

Promise of a Component instance.

public create_display_command(arg_cmd_settings: object): DisplayCommand source

Create a DisplayCommand instance.

Params:

NameTypeAttributeDescription
arg_cmd_settings object

command settings.

Return:

DisplayCommand

public create_local(arg_name: string, arg_component_desc: object): Component source

Create a UI component.

Params:

NameTypeAttributeDescription
arg_name string

component name.

arg_component_desc object

component description.

Return:

Component

Component instance.

public get(arg_name: string): Component source

Get a UI component by its name.

Params:

NameTypeAttributeDescription
arg_name string

component name.

Return:

Component

public get_current_layout(): Layout source

Get current application layout.

Return:

Layout

public get_rendering_class_resolver(): Class source

Get a resolver function to find UI component class.

Return:

Class

(string)=>Class.

public get_rendering_function_resolver(): function source

Get a resolver function to find UI rendering function.

Return:

function

(string)=>function.

public get_resource_description_resolver(): function source

Get a resolver function to find UI component description.

Return:

function

(string)=>Immutable.Map|undefined.

public has(arg_name: string): boolean source

Test a UI component by its name.

Params:

NameTypeAttributeDescription
arg_name string

component name.

Return:

boolean

public is_loaded(): boolean source

Test if UI is loaded and is ready to process display commands.

Return:

boolean

true:UI is ready to process display commands,false:UI isn't ready.

public load(): nothing source

Load plugins.

Return:

nothing

public pipe_display_command(arg_display_command: DisplayCommand): nothing source

Append a display command to the UI commands pipe. If UI isn't ready to process display command, delay append. Commands are pushed into a stream.

Params:

NameTypeAttributeDescription
arg_display_command DisplayCommand

display command to pipe.

Return:

nothing

public register_rendering_plugin(arg_plugin_class: *): nothing source

Register a browser rendering plugin.

@param{RenderingPlugin} arg_plugin - rendering plugin.

Params:

NameTypeAttributeDescription
arg_plugin_class *

Return:

nothing

public request_middleware(arg_middleware: string, arg_svc_route: string): Promise source

Request server about middleware rendering.

Params:

NameTypeAttributeDescription
arg_middleware string

middleware name.

arg_svc_route string

requested route.

Return:

Promise

Promise of a RenderingResult instance.