AbstractApplication
On this page
- AbstractApplication ⇐
Class
- AbstractApplication()
- quit(options) ⇒
Promise.<Boolean, Error>
- suspend(options) ⇒
Promise.<Boolean, Error>
- resume() ⇒
Promise.<Boolean, Error>
- setFocus() ⇒
Promise.<Boolean, Error>
- addStartupError(error)
- getStartupErrors() ⇒
Array.<Error>
- loadAndStart() ⇒
Promise
- _initialize() ⇒
Promise
- _beforeShow() ⇒
Promise
- _show() ⇒
Promise
- beforeInitialize() ⇒
Promise
- initialize() ⇒
Promise
- beforeShow() ⇒
Promise
- afterShow() ⇒
void
- _registerModules()
- _initializeModules() ⇒
Promise
- _beforeShowModules() ⇒
Promise
- _setFocus()
- _quit()
- _suspend()
- _resume()
- _showApplicationInfo() ⇒
Promise
- bootstrap([options]) ⇒
Promise
- _bootstrap(application, [options]) ⇒
Promise
AbstractApplication ⇐ Class
Kind: global abstract class
Extends: Class
Singleton:
Properties
Name | Type | Description |
---|---|---|
initialized | Boolean | Flag to tell if the application have been initialized |
isAppReady | Boolean | Flag to tell if the application is ready |
isAppSuspended | Boolean | Flag to tell if the application is suspended |
name | String | The name of the application |
config | Object | The application configuration (as resolved from app.config.json on the current profile) |
started | number | The timestamp of the application start |
i18nManager | I18nManager | Ref to the i18nManager - internal use |
routerManager | RouterManager | Ref to the routerManager - internal use |
moduleManager | ModuleManager | Ref to the moduleManager - internal use |
renderer | Renderer | Ref to the Renderer - internal use |
isMonitoring | Boolean | Enable monitorBus (by default false) |
personalizationService | NativePersonalizationService | The personalization service |
- AbstractApplication ⇐
Class
- new AbstractApplication()
- instance
- .quit(options) ⇒
Promise.<Boolean, Error>
- .suspend(options) ⇒
Promise.<Boolean, Error>
- .resume() ⇒
Promise.<Boolean, Error>
- .setFocus() ⇒
Promise.<Boolean, Error>
- .addStartupError(error)
- .getStartupErrors() ⇒
Array.<Error>
- .loadAndStart() ⇒
Promise
- ._initialize() ⇒
Promise
- ._beforeShow() ⇒
Promise
- ._show() ⇒
Promise
- .beforeInitialize() ⇒
Promise
- .initialize() ⇒
Promise
- .beforeShow() ⇒
Promise
- .afterShow() ⇒
void
- ._registerModules()
- ._initializeModules() ⇒
Promise
- ._beforeShowModules() ⇒
Promise
- ._setFocus()
- ._quit()
- ._suspend()
- ._resume()
- ._showApplicationInfo() ⇒
Promise
- .quit(options) ⇒
- static
- .bootstrap([options]) ⇒
Promise
- ._bootstrap(application, [options]) ⇒
Promise
- .bootstrap([options]) ⇒
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
Param | Type | Description |
---|---|---|
options | Object | 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
Param | Type | Description |
---|---|---|
options | Object | 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
Param | Type | Description |
---|---|---|
error | Error | 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
Param | Type |
---|---|
[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
Param | Type | Description |
---|---|---|
application | Application | The application instance |
[options] | Object |