| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| 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. |
| |
| --> |
| <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" |
| xmlns:styleTest="assets.styleTest.*" |
| xmlns:assets="assets.*"> |
| |
| <fx:Style> |
| @namespace s "library://ns.adobe.com/flex/spark"; |
| @namespace mx "library://ns.adobe.com/flex/mx"; |
| @namespace styleTest "assets.styleTest.*"; |
| @namespace assets "assets.*"; |
| /* Type Selector */ |
| styleTest|ADVStyleTestClass{ |
| teststyle_2_number_noinh : 54321; |
| teststyle_3_uint_inh : 76; |
| teststyle_4_date_inh : PropertyReference("compDate2"); |
| } |
| |
| /* Class Selector */ |
| .styleInComponent{ |
| teststyle_2_number_noinh : 12345; |
| teststyle_3_uint_inh : 67; |
| teststyle_4_date_inh : PropertyReference("compDate1"); |
| } |
| |
| /* ID Selector */ |
| #componentADV{ |
| teststyle_1_string_noinh : "idAppStr"; |
| teststyle_3_uint_inh : 345; |
| teststyle_4_date_inh: PropertyReference("appDate"); |
| } |
| |
| </fx:Style> |
| <fx:Script> |
| <![CDATA[ |
| import assets.styleTest.ADVStyleTestConstants; |
| import assets.styleTest.ADVStyleTestEvent; |
| import assets.styleTest.ADVStyleTestVo; |
| |
| import mx.collections.ArrayCollection; |
| import mx.collections.XMLListCollection; |
| import mx.events.FlexEvent; |
| import mx.styles.IStyleManager2; |
| |
| public var myComp:FlexComponent; |
| public function addFlexComponent():void |
| { |
| myComp = new FlexComponent(); |
| myComp.styleName = "styleInComponent"; |
| myGroup.addElement(myComp); |
| } |
| |
| private var myStyleManager:IStyleManager2; |
| public function testAdvStyleInSM():void |
| { |
| myStyleManager = StyleManager.getStyleManager(this.moduleFactory); |
| myStyleManager.getStyleDeclaration(".styleInComponent").setStyle("teststyle_4_date_inh", appDate1); |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Declarations> |
| <fx:Date id="appDate" fullYear="2098" month="7" date="19" /> |
| <fx:Date id="appDate1" fullYear="2010" month="7" date="12"/> |
| <fx:Date id="compDate1" fullYear="2000" month="12" date="20" /> |
| <fx:Date id="compDate2" fullYear="2099" month="5" date="5"/> |
| |
| <styleTest:ADVStyleTestClass id="componentADV"/> |
| <styleTest:ADVStyleTestClass id="componentADVStyle" styleName="styleInComponent" /> |
| </fx:Declarations> |
| |
| <s:Group id="myGroup" > |
| <s:layout> |
| <s:VerticalLayout> |
| |
| </s:VerticalLayout> |
| </s:layout> |
| </s:Group> |
| |
| <assets:FlexComponent id="advStyleTest_flexComponent" /> |
| |
| <s:layout> |
| <s:VerticalLayout> |
| |
| </s:VerticalLayout> |
| </s:layout> |
| |
| </s:Application> |