Licensed to the Apache Software Foundation (ASF) under one or more

contributor license agreements. See the NOTICE file distributed with

this work for additional information regarding copyright ownership.

The ASF licenses this file to You under the Apache License, Version 2.0

(the “License”); you may not use this file except in compliance with

the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an “AS IS” BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

layout: docpage title: Jewel Application description: The Jewel Application permalink: /component-sets/jewel/application

< Jewel Components list

Jewel Application

Reference

Available since version 0.9.4.

ClassExtendsImplements
org.apache.royale.jewel.Application{:target=‘_blank’}ApplicationBase{:target=‘_blank’}IStrand{:target=‘_blank’}, IParent{:target=‘_blank’}, IEventDispatcher{:target=‘_blank’}, IInitialViewApplication{:target=‘_blank’}, IPopUpHost{:target=‘_blank’}, IPopUpHostParent{:target=‘_blank’}, IRenderedObject{:target=‘_blank’}

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{:target=‘_blank’}). This Application class expects there to be a main model, a controller, and an initial view.

Jewel Application holds specific Jewel needs in a Royale Application. This class extends the standard ApplicationBase and sets up the AllCSSValuesImpl{:target=‘_blank’} implementation for convenience.

Example of use

In MXML declare a 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{:target=‘_blank’} for a more detailed list of properties and methods.