BiApplication

This is a singleton class and the instance can be found as the global application object.

This class extends BiEventTarget and therefore all methods and fields available for BiEventTarget are also available for BiApplication .

Constructor

new BiApplication ( )

Parameters

No parameters.

Properties

Name Type get set Descripton
accessibilityDescription String checked checked This property can be used to popup an alert with a description about the application when the application is in accessibility mode. This is useful if the user needs to be informed about something to be able to use the application.
accessibilityMode Boolean checked checked This property can be used to tell whether the application should be in an accessibility mode. This does not really do anything and it is up to the components and implementations to make sure of this.
adf BiAdf checked Returns the BiAdf instance
adfPath String checked Returns the directory path of the ADF
autoNameMapping Boolean checked checked When this is true any XML object that has an id attribute will create a global reference to the object created from this XML element. This property is mapped to the xmlResourceParser as well as the resource loader used to load the resources.
defaultPackages String[] checked checked The default packages to load. This needs to be set before the loading actually starts. To do this you can use an attribute in the Application tag in your ADF or set this in the HTML file hosting your application.

If you just want to add a few packages then use a Package tag in your Resources section of the ADF.
focusOnLoad Boolean checked checked Whether to try to focus the window when the application loads
inactivityTimeout Number checked checked When this is set the application will fire an event called inactive. The value of this is the number of minutes before the inactive is fired.
packages String[] checked Returns an array containing the names of the known packages
path BiUri checked Returns the directory path of the Bindows root
progressStatus String checked checked This is the progress status text shown while loading
resourceLoader BiResourceLoader checked Returns the resource loader used to load the core script files as well as the resources defined in the ADF.
stringBundle BiStringBundle checked checked The string bundle to use for this wizard pane.
theme BiTheme checked Returns the currently used theme
themeManager BiThemeManager checked The theme manager keeps track of exisiting themese and more
uri BiUri checked Returns the full URI of the current page
version String checked Returns the version of the Bindows framework.
window BiApplicationWindow checked Returns the BiApplicationWindow representing the browser window in which the application is running.

Methods

Name Description
addPackage Adds a named package to the known packages. The second argument is an array containing the paths to the files in the package. These paths are relative to the system root
flushLayoutQueue This method is used internally to update the layout of existing components
getComponentById Returns the object created by the Bindows markup, in the Window part, with the given id. This only finds objects that are part of the original ADF or objects created from the BiXmlResourceParser associated with the ADF instance.
getPackage Returns an array containing the paths to the files in the package
getResourceById Returns the object created by the resourceLoader with the given id.
restartInactivityTimer This resets the inactivity timer. This is usually called by the BiEventManager when it recieves a user input.
start Starts the application. If any arguments are passed to this method then these are used, otherwise the arguments passed to the page are used.

Events

Name Type Bubbles Descripton
dispose BiEvent Fires just before the application is disposed. This allows you to clean up your main program before closing the application window.
load BiEvent This is fired when everything has been loaded and initialized. This is called after the main method has been called.
progressstatus BiEvent Fires when the progress status has changed.
resourcesready BiEvent This is fired after the Bindows markup has been handled but before the main method is called.

Static Methods

None.

Static Fields

None.

Remarks

The text that is shown during startup can be localized by changing the stringBundle for the application object. The following keys are currently used: ApplicationIncorrectAdfArgument - The string to show when the ADF argument is incorrect ApplicationLoadingAdf - The string to show when the ADF file is loading ApplicationNoAdf - The string to show when the ADF is not specified ApplicationAdfLoaded - The string to show when the ADF file is loaded ApplicationAdfLoadError - The string to show when there was an error loading the ADF ApplicationAdfLoadErrorDetails - The string to use when showing the details of the ADF load error. This may contain %1 - %3 which maps to URI, HTTP status code and HTTP status text ApplicationLoadingResources - The string to show when loading resources. This may contain %1 and %2 which maps to the number of loaded resources and the total number of resources. ApplicationLoadingCompleted - The string to show when the loading is complete

Method Details

addPackage

Adds a named package to the known packages. The second argument is an array containing the paths to the files in the package. These paths are relative to the system root

Syntax

object.addPackage
 (
 sName,oFiles
 )
 

Parameters

Name Type Optional Default Descripton
sName String The name of the package
oFiles String[] An array containing the paths to the files in the package

Return Type

void

flushLayoutQueue

This method is used internally to update the layout of existing components

Syntax

object.flushLayoutQueue
 (
 
 )
 

Parameters

No arguments.

Return Type

void

getComponentById

Returns the object created by the Bindows markup, in the Window part, with the given id. This only finds objects that are part of the original ADF or objects created from the BiXmlResourceParser associated with the ADF instance.

Syntax

object.getComponentById
 (
 sId
 )
 

Parameters

Name Type Optional Default Descripton
sId String The id of the object

Return Type

Object

getPackage

Returns an array containing the paths to the files in the package

Syntax

object.getPackage
 (
 sName
 )
 

Parameters

Name Type Optional Default Descripton
sName String The name of the package

Return Type

String[]

getResourceById

Returns the object created by the resourceLoader with the given id.

Syntax

object.getResourceById
 (
 sId
 )
 

Parameters

Name Type Optional Default Descripton
sId String The id of the resource object

Return Type

Object

restartInactivityTimer

This resets the inactivity timer. This is usually called by the BiEventManager when it recieves a user input.

Syntax

object.restartInactivityTimer
 (
 
 )
 

Parameters

No arguments.

Return Type

void

start

Starts the application. If any arguments are passed to this method then these are used, otherwise the arguments passed to the page are used.

Syntax

object.start
 (
 
 [
 sRootPath
 [
 ,sAdfPath
 [
 ,oArgs
 ]
 
 ]
 
 ]
 
 )
 

Parameters

Name Type Optional Default Descripton
sRootPath String checked The path to where Bindows resides. This is usually the path where bimain.html can be found.
sAdfPath String checked The path to the ADF file. If this is a relative path it is relative to the current document. If this is left out then the adfPath is used.
oArgs Object checked Any number of arguments that will be passed to the main ADF method.

Return Type

void