add squiggly examples

Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/ef10f5c7
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/ef10f5c7
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/ef10f5c7

Branch: refs/heads/develop
Commit: ef10f5c7f206cd0bced5a959d99d4ded8f65902b
Parents: a3bf10b
Author: Justin Mclean <jmcl...@apache.org>
Authored: Thu Oct 9 13:56:44 2014 +1100
Committer: Justin Mclean <jmcl...@apache.org>
Committed: Thu Oct 9 13:56:44 2014 +1100

----------------------------------------------------------------------
 .../src/apache/squiggly/SpellingConfig.xml      | 23 +++++++++
 .../src/apache/squiggly/SpellingExExample.mxml  | 49 ++++++++++++++++++++
 .../src/apache/squiggly/SpellingExample.mxml    | 48 +++++++++++++++++++
 3 files changed, 120 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/ef10f5c7/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingConfig.xml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingConfig.xml 
b/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingConfig.xml
new file mode 100644
index 0000000..300e394
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingConfig.xml
@@ -0,0 +1,23 @@
+       <?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.
+
+-->
+<SpellingConfig>
+  <LanguageResource language="English (British)" languageCode="en_GB" 
ruleFile="./dictionaries/en_GB/en_GB.aff" 
dictionaryFile="dictionaries/en_GB/en_GB.dic"/>
+  <LanguageResource language="English (US)" languageCode="en_US" 
ruleFile="./dictionaries/en_US/en_US.aff" 
dictionaryFile="dictionaries/en_US/en_US.dic"/>
+</SpellingConfig>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/ef10f5c7/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingExExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingExExample.mxml 
b/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingExExample.mxml
new file mode 100644
index 0000000..af31565
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingExExample.mxml
@@ -0,0 +1,49 @@
+<?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"
+                          applicationComplete="init()">
+       <fx:Script>
+               <![CDATA[
+                       import com.adobe.linguistics.spelling.SpellUI;
+                       import 
com.adobe.linguistics.spelling.framework.SpellingConfiguration;
+                       import 
com.adobe.linguistics.spelling.framework.ResourceTable;
+                               
+                       public function init():void
+                       {
+                               var resourceTable:ResourceTable = new 
ResourceTable();
+                               resourceTable.setResource("en_US", 
{rule:"data/en_US.aff", dict:"data/en_US.dic"});
+                               SpellingConfiguration.resourceTable = 
resourceTable;
+                       }
+               ]]>
+       </fx:Script>
+
+       <s:Panel title="Spell Check" width="100%" height="100%" 
borderAlpha="0.15">
+               <s:layout>
+                       <s:VerticalLayout paddingLeft="20" paddingTop="20" 
gap="10" />
+               </s:layout>
+               <s:Group width="100%" height="100%">
+                       <s:TextArea id="ta_en" width="50%" height="50%" 
fontSize="20"
+                                               text="I know Enlish. Use the 
context menu to see the suggestions of the missbelled word."
+                                               
creationComplete="SpellUI.enableSpelling(ta_en, 'en_US');"/>                    
                
+               </s:Group>
+       </s:Panel>
+
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/ef10f5c7/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingExample.mxml 
b/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingExample.mxml
new file mode 100644
index 0000000..5b36ef3
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/apache/squiggly/SpellingExample.mxml
@@ -0,0 +1,48 @@
+<?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.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
+                               xmlns:s="library://ns.adobe.com/flex/spark"
+                               layout="vertical">              
+<mx:Script>
+       <![CDATA[
+                       import com.adobe.linguistics.spelling.SpellUI;  
+                       
+                       private function enableUS():void {
+                               SpellUI.enableSpelling(textArea, "en_US");
+                       }
+
+                       private function enableGB():void {
+                               SpellUI.enableSpelling(textArea, "en_GB");
+                       }
+       ]]>
+</mx:Script>
+       <s:Panel title="Spell Check" width="100%" height="100%" 
borderAlpha="0.15">
+               <s:layout>
+                       <s:VerticalLayout paddingLeft="20" paddingTop="20" 
gap="10" />
+               </s:layout>
+               <s:VGroup width="100%" height="100%">
+                       <mx:TextArea id="textArea" width="50%" height="50%" 
fontSize="20" text="Spell cheecking in TextArea"/>
+                       <mx:Button id="tt2" label="Check British English" 
click="enableGB()" /> 
+                       <mx:Button id="tt3" label="Check American English" 
click="enableUS()" />                        
+               </s:VGroup>
+       </s:Panel>
+       
+</mx:Application>
+

Reply via email to