AbstractApplication

AbstractApplication ⇐ Class

Kind: global abstract class
Extends: Class
Singleton:
Properties

NameTypeDescription
initializedBoolean

Flag to tell if the application have been initialized

isAppReadyBoolean

Flag to tell if the application is ready

isAppSuspendedBoolean

Flag to tell if the application is suspended

nameString

The name of the application

configObject

The application configuration (as resolved from app.config.json on the current profile)

startednumber

The timestamp of the application start

i18nManagerI18nManager

Ref to the i18nManager - internal use

routerManagerRouterManager

Ref to the routerManager - internal use

moduleManagerModuleManager

Ref to the moduleManager - internal use

rendererRenderer

Ref to the Renderer - internal use

isMonitoringBoolean

Enable monitorBus (by default false)

personalizationServiceNativePersonalizationService

The personalization service

AbstractApplication()

This class represents the main Application. You must instantiate it once using the init method at the very beginning of the application dependencies load.

quit(options) ⇒ Promise.<Boolean, Error>

Quit application.

Kind: instance method of AbstractApplication
Returns: Promise.<Boolean, Error> - A promised resolved to true if application is quit

ParamTypeDescription
optionsObject

options to pass to quit process

suspend(options) ⇒ Promise.<Boolean, Error>

Suspend application.

Kind: instance method of AbstractApplication
Returns: Promise.<Boolean, Error> - A promised resolved to true if application is suspended

ParamTypeDescription
optionsObject

options to pass to suspend process

resume() ⇒ Promise.<Boolean, Error>

Resume suspended application.

Kind: instance method of AbstractApplication
Returns: Promise.<Boolean, Error> - A promised resolved to true if application is resumed

setFocus() ⇒ Promise.<Boolean, Error>

Set focus to main window

Kind: instance method of AbstractApplication
Returns: Promise.<Boolean, Error> - A promised resolved to true if application is focused

addStartupError(error)

Register an error that was catched during the startup process, but without breaking the process Mostly, you will need to call these method in the beforeInitialize/initialize extension points As of writing, it’s up to the application to handle the registered errors

Kind: instance method of AbstractApplication

ParamTypeDescription
errorError

the error

getStartupErrors() ⇒ Array.<Error>

Get the registered errors grabed during the startup process

Kind: instance method of AbstractApplication
Returns: Array.<Error> - the list of errors

loadAndStart() ⇒ Promise

Initialize, load the screens/views and start the application You should never call these method directly, as it is called by the bootstrap sequence

Kind: instance method of AbstractApplication

_initialize() ⇒ Promise

Initialize the application Find the first screen to show Extension point: initialize

Kind: instance method of AbstractApplication
Emits: Application#event:initialized
Access: protected

_beforeShow() ⇒ Promise

Show application information and call extension point. The right place to prepare things before the first screen is shown. Extension point: beforeShow

Kind: instance method of AbstractApplication
Access: protected

_show() ⇒ Promise

Show the application Focus the application and display the first screen

Kind: instance method of AbstractApplication
Emits: Application#event:ready
Access: protected

beforeInitialize() ⇒ Promise

Extension point that is called right after the bootstrap You should rarely need to implement it.

Kind: instance method of AbstractApplication

initialize() ⇒ Promise

Extension point that is called right after the application has been initialized. You should rarely need to implement it.

Kind: instance method of AbstractApplication

beforeShow() ⇒ Promise

Extension point that is called when the application is ready to be shown. The first screen is not yet shown. Right place to initialize services, player, get data, …

Kind: instance method of AbstractApplication

afterShow() ⇒ void

Extension point that is called when the application is ready and first screen is shown.

Kind: instance method of AbstractApplication

_registerModules()

Find modules declared in the profile and register them Must always return a resolved promise !

Kind: instance method of AbstractApplication
Access: protected

_initializeModules() ⇒ Promise

Initialize modules Must always return a resolved promise !

Kind: instance method of AbstractApplication
Returns: Promise - A promise always resolved
Access: protected

_beforeShowModules() ⇒ Promise

Call the beforeShow of modules Must always return a resolved promise !

Kind: instance method of AbstractApplication
Returns: Promise - A promise always resolved
Access: protected

_setFocus()

Set focus to window to capture key events

Kind: instance abstract method of AbstractApplication

_quit()

Quit application.

Kind: instance abstract method of AbstractApplication

_suspend()

Suspend application.

Kind: instance abstract method of AbstractApplication

_resume()

Resume application.

Kind: instance abstract method of AbstractApplication

_showApplicationInfo() ⇒ Promise

Display information at application startup

Kind: instance method of AbstractApplication
Access: protected

bootstrap([options]) ⇒ Promise

Start the application

Kind: static method of AbstractApplication

ParamType
[options]Object

_bootstrap(application, [options]) ⇒ Promise

Extension point for boot-strapping application On some implementations, you need to wait an event before starting the app. For example, html browser will wait the DOM to be ready before launching the app

Kind: static method of AbstractApplication
Access: protected

ParamTypeDescription
applicationApplication

The application instance

[options]Object