In XUI a project acts as the root or owner for all objects within an application. The project also acts in a coordinating role, providing access to resources and components.
Adding extra project initialization
The initialization of the project can be extended by adding a ##LifeCycleListener##. The ##LifeCycleListener## interface is called during initialization and again at shutdown. The calls provide an opportunity to off-load project specific initialization functionality to custom classes without having to customize the ##XApplet## class, for example special database of connectivity functionality may require custom initialization prior to the display of the first page.
* Called when the application/applet has been created and initialized.
* @param project the owner project
*/
publicvoid initialize( XProject project )
{
// Setup connections, etc... here
}
/**
* Called when the application/applet has been shutdown and is about to exit
*/
publicvoid shutdown()
{
// Release resources, connections, etc... here
}
}
In XUI 3 (aka Juice), a multi-project application style is being added whereby projects can be treated like modules and loaded within another project. The first loaded project is in control and specifies the general setup, with subsequent projects providing features for the first project. In this way related projects can collaborate and functionality can be reused in a modulear way.
Project Objects
As of XUI 3, the project may store a number of useful objects, these objects can be retrived by calling project.getObject( key ), where the key references the objects listed below:
ActionManager the ActionManager instance used to manage actions
Applet the applet object
AppContext the instance of the XApplicationContext class that manages the project/application
ComponentCustomizera component customizer used to apply customizations to components loaded as elements of pages
ClientShell the SWT Shell object
DefaultAttributeEvaluator the default attibute evaluator, used for evaluated attributes
DialogList a list (Hashtable) of dialogs that have been loaded by the application
Display the SWT Display object
LayoutHelper a helper class used to create layout managers and the constraints used by layout managers
ResourceBundles the resource bundles used in translating/localizing the application
RouteMgr the XRouteManager
StartupArgs the command-line arguments passed to the application
ScriptAttributeEvaluator the evaluator for script attributes
Translator the XTranslator instance used to translate text
UserClassReferences a Hashtable of class instance used by the script evaluator, in any
XOptionalBindingFactory an instance of XOptionalBindingFactory. if one is used
It is not guaranteed that these objects are available and set. Nor is any guarantee given as to when the objects are created as the lifecycle of the various objects differ and may in some cases depend on the type and configuration of an application. The list is not exhaustive and other application components or extensions may add and use additional properties.
There are no comments on this page. [Add comment]