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

NameTypegetsetDescripton
accessibilityDescriptionStringcheckedcheckedThis 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.
accessibilityModeBooleancheckedcheckedThis 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.
adfBiAdfcheckedReturns the BiAdf instance
adfPathStringcheckedReturns the directory path of the ADF
autoNameMappingBooleancheckedcheckedWhen 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.
defaultPackagesString[]checkedcheckedThe 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.
focusManagerBiFocusManagercheckedThe focus manager handles focus in bindows.
focusOnLoadBooleancheckedcheckedWhether to try to focus the window when the application loads
inactivityTimeoutNumbercheckedcheckedWhen 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.
loaderTypeStringcheckedcheckedCan be either "timer" (default) or "normal". If "timer" is used a special timer based script loader used so the progress info of the splash screen is updated correctly. Only works in retail version
packagesString[]checkedReturns an array containing the names of the known packages
pathBiUricheckedReturns the directory path of the Bindows root
progressStatusStringcheckedcheckedThis is the progress status text shown while loading
resourceLoaderBiResourceLoadercheckedReturns the resource loader used to load the core script files as well as the resources defined in the ADF.
stringBundleBiStringBundlecheckedcheckedThe string bundle to use for the application.
themeBiThemecheckedReturns the currently used theme
themeManagerBiThemeManagercheckedThe theme manager keeps track of exisiting themese and more
uriBiUricheckedReturns the full URI of the current page
versionStringcheckedReturns the version of the Bindows framework.
windowBiApplicationWindowcheckedReturns the BiApplicationWindow representing the browser window in which the application is running.

Methods

NameDescription
addPackageAdds 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
flushLayoutQueueThis method is used internally to update the layout of existing components
getComponentByIdReturns 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.
getPackageReturns an array containing the paths to the files in the package
getResourceByIdReturns the object with the given id, created by the resourceLoader.
restartInactivityTimerThis resets the inactivity timer. This is usually called by the BiEventManager when it recieves a user input.
startStarts the application. If any arguments are passed to this method then these are used, otherwise the arguments passed to the page are used.

Events

NameTypeBubblesDescripton
disposeBiEventFires just before the application is disposed. This allows you to clean up your main program before closing the application window.
loadBiEventThis is fired when everything has been loaded and initialized. This is called after the main method has been called.
progressstatusBiEventFires when the progress status has changed.
resourcesreadyBiEventThis 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 ApplicationErrorInMain - The main() method threw an exception

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

NameTypeOptionalDefaultDescripton
sNameStringThe name of the package
oFilesString[]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

NameTypeOptionalDefaultDescripton
sIdStringThe 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

NameTypeOptionalDefaultDescripton
sNameStringThe name of the package

Return Type

String[]

getResourceById

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

Syntax

object.getResourceById ( sId )

Parameters

NameTypeOptionalDefaultDescripton
sIdStringThe 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

NameTypeOptionalDefaultDescripton
sRootPathStringcheckedThe path to where Bindows resides. This is usually the path where bimain.html can be found.
sAdfPathStringcheckedThe 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.
oArgsObjectcheckedAny number of arguments that will be passed to the main ADF method.

Return Type

void