Class: ParserTools

WebPDF.Toolbar. ParserTools


new ParserTools()

Methods


createComponent(type, config)

create a component instance by component's type and configuration object

Parameters:
Name Type Description
type string
config WebPDF.Toolbar.ComponentConfiguration
Returns:
Type
WebPDF.Toolbar.Component

createLayout(type, config)

create a layout instance by layout's type and configuration object

Parameters:
Name Type Description
type string
config WebPDF.Toolbar.ComponentConfiguration
Returns:
Type
WebPDF.Toolbar.Layout

extendConfig(extendFrom, config)

Get the default configuration by name and then merge the custom configuration with the default configuration.

Parameters:
Name Type Description
extendFrom string

name of default config

config WebPDF.Toolbar.ComponentConfiguration

user custom configuration

Returns:
Type
WebPDF.Toolbar.ComponentConfiguration

getController(handler)

Get the controller instance through the name of existing and registered controller

Parameters:
Name Type Description
handler string | function

get or create a controller instance by name or handler function

Returns:
Type
WebPDF.Toolbar.Controller

parseComponent(config)

A parser for parse an component's configuration as component instance

Parameters:
Name Type Description
config WebPDF.Toolbar.ComponentConfiguration
Returns:
Type
WebPDF.Toolbar.Component