| <?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. |
| |
| --> |
| <!-- Sample program for spark.globalization.StringTools --> |
| <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"> |
| |
| <fx:Declarations> |
| <s:StringTools id="stringTools" /> |
| </fx:Declarations> |
| |
| <fx:Script> |
| <![CDATA[ |
| import mx.collections.ArrayCollection; |
| |
| private static const localeList:ArrayCollection |
| = new ArrayCollection([ |
| { label:"Turkish (tr)", data:"tr" }, |
| { label:"Greek (el)", data:"el" }, |
| { label:"German (de)", data:"de" }, |
| { label:"English (en)", data:"en" } ]); |
| |
| private static const inputString:String = |
| "aáḁæa Iıİi (Turkish), σςΣΣ (Greek), SSß (German), bβв (Latin/Greek/Cyrillic)"; |
| ]]> |
| </fx:Script> |
| |
| <mx:Form width="100%"> |
| <mx:FormItem label="Select Language"> |
| <mx:ComboBox id="localeSelector" |
| change="setStyle('locale', localeSelector.selectedItem.data);" |
| dataProvider="{localeList}"/> |
| </mx:FormItem> |
| <mx:FormItem label="Actual Locale ID Name"> |
| <mx:Text text="{stringTools.actualLocaleIDName}"/> |
| </mx:FormItem> |
| <mx:FormItem width="100%" label="Upper Case Result"> |
| <mx:Text width="100%" |
| text="{stringTools.toUpperCase(inputString)}"/> |
| </mx:FormItem> |
| <mx:FormItem width="100%" label="Lower Case Result"> |
| <mx:Text width="100%" |
| text="{stringTools.toLowerCase(inputString)}"/> |
| </mx:FormItem> |
| </mx:Form> |
| </s:Application> |