< Jewel Components list

Jewel Application

Reference

Available since version 0.9.4.

Class Extends Implements
org.apache.royale.jewel.Application ApplicationBase IStrand, IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost, IPopUpHostParent, IRenderedObject

Note: This component is currently only available for JavaScript.

Overview

The Application class is the main class and entry point for a Royale application and does not contain user interface elements. Those UI elements go in the view (Jewel ViewBase). This Application class expects a main model, a controller, and an initial view.

Jewel Application holds specific elements that Jewel needs. This class extends the standard ApplicationBase and sets up the AllCSSValuesImpl implementation for convenience.

Example of use

In MXML declare an Application as the root tag of the main application file like this:

<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
	xmlns:j="library://ns.apache.org/royale/jewel">

    <j:valuesImpl>
		<js:SimpleCSSValuesImpl />
	</j:valuesImpl>

	<j:initialView>
		<!-- add a View or ResponsiveView -->
		<j:View width="100%" height="100%"/>
	</j:initialView>
</j:Application>

If the filename is App.mxml, building the application will generate the following code in the index.html file:

<script type="text/javascript">
	new App().start();
</script>

launching the html file in a browser will execute the Jewel Royale Application.

Relevant Properties and Methods

Check the Reference of org.apache.royale.jewel.Application for a more detailed list of properties and methods.