]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
go
authorthadh <thadh@THADH-LAPTOP.ad.corp.google.com>
Sun, 25 Oct 2009 21:56:20 +0000 (14:56 -0700)
committerthadh <thadh@THADH-LAPTOP.ad.corp.google.com>
Sun, 25 Oct 2009 21:56:20 +0000 (14:56 -0700)
.classpath
jars/buildICU4J.sh [new file with mode: 0755]
jars/icu4j-4_2_1-src/build.xml
jars/icu4j-4_2_1-src/eclipseProjectMisc/initSrc.launch [deleted file]
jars/icu4j-4_2_1-src/eclipseProjectMisc/normSrc.launch [deleted file]
src/com/hughes/android/dictionary/DictionaryActivity.java
src/com/hughes/android/dictionary/DictionaryActivityTest.java

index 8a2ab5a74bc09751ee88251399bd40f3d94f5d15..aa18ab6b7efdf35b834ce62eef20f306a54cd8ae 100755 (executable)
@@ -4,6 +4,6 @@
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>\r
        <classpathentry combineaccessrules="false" exported="true" kind="src" path="/Util"/>\r
        <classpathentry kind="src" path="gen"/>\r
-       <classpathentry kind="lib" path="jars/icu4j-4_2_1-src.jar/icu4j.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="jars/icu4j-4_2_1-src/icu4j.jar"/>\r
        <classpathentry kind="output" path="bin"/>\r
 </classpath>\r
diff --git a/jars/buildICU4J.sh b/jars/buildICU4J.sh
new file mode 100755 (executable)
index 0000000..a294d86
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash -e
+
+DIR=`dirname $0`/icu4j-4_2_1-src
+
+cd $DIR
+ant clean
+ant collator
+ant collIndices
+
+rm  classes/com/ibm/icu/impl/data/icudt42b/ubidi.icu
+rm  classes/com/ibm/icu/impl/data/icudt42b/cnvalias.icu
+rm -rf classes/com/ibm/icu/impl/data/icudt42b/brkitr
+
+rm -rf ./safe
+mkdir ./safe
+# Need this res_index.txt file because the process to auto-generate it from the context of the jar doesn't work on Android.
+mv classes/com/ibm/icu/impl/data/icudt42b/coll/res_index.txt ./safe
+mv classes/com/ibm/icu/impl/data/icudt42b/coll/en* ./safe
+mv classes/com/ibm/icu/impl/data/icudt42b/coll/de* ./safe
+mv classes/com/ibm/icu/impl/data/icudt42b/coll/ucadata.icu ./safe
+rm classes/com/ibm/icu/impl/data/icudt42b/coll/*
+mv ./safe/* classes/com/ibm/icu/impl/data/icudt42b/coll/
+rm -rf ./safe
+
+ant moduleJar
+
+ls -l $DIR/icu4j.jar
index 82b5bc5bcd4975edffa7e0e9d4c02e00a1ff3b33..b1bef2246f124268bbaa87828dfdf9445618d0e0 100755 (executable)
     </java>\r
   </target>\r
 \r
+  <target name="collIndices" depends="build_indexgenerator">\r
+    <java classname="com.ibm.icu.dev.tool.index.IndexGenerator" classpath="${build.dir}" logError="true">\r
+      <arg value="${build.dir}/${icu4j.data.path}/coll" />\r
+    </java>\r
+  </target>\r
+\r
   <target name="tools"\r
           depends="core"\r
           unless="before.java14"\r
   </target>\r
 \r
   <target name="moduleJar" depends="initBase" description="modular build of 'icu4j.jar' jar file">\r
-    <jar jarfile="${jar.file}" compress="true" includes="com/ibm/icu/util/**/*,com/ibm/icu/text/**/*,com/ibm/icu/math/**/*,com/ibm/icu/impl/**/*,com/ibm/icu/lang/**/*" basedir="${build.dir}">\r
+    <jar jarfile="${jar.file}" compress="true">\r
+\r
+       <!-- com/ibm/icu/util/**/*,com/ibm/icu/text/**/*,com/ibm/icu/math/**/*,com/ibm/icu/impl/**/*,com/ibm/icu/lang/**/* -->\r
+      <fileset dir="${build.dir}" includes="com/ibm/icu/util/**/*,com/ibm/icu/text/**/*,com/ibm/icu/math/**/*,com/ibm/icu/impl/**/*,com/ibm/icu/lang/**/*" excludes="META-INF/services/**/*,com/ibm/icu/charset/**/*,${icu4j.data.path}/*.cnv,${icu4j.data.path}/cnvalias.icu" />\r
+\r
+       <fileset dir="${basedir}" includes="license.html,unicode-license.txt" />\r
+      <fileset dir="${src.dir}" includes="com/ibm/icu/ICUConfig.properties" />\r
+       \r
       <manifest>\r
         <attribute name="Built-By" value="${corp}" />\r
         <section name="common">\r
diff --git a/jars/icu4j-4_2_1-src/eclipseProjectMisc/initSrc.launch b/jars/icu4j-4_2_1-src/eclipseProjectMisc/initSrc.launch
deleted file mode 100755 (executable)
index 9a1b84e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
-<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">\r
-<stringAttribute key="org.eclipse.ant.ui.ATTR_BUILD_SCOPE" value="${none}"/>\r
-<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>\r
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;launchConfigurationWorkingSet editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; label=&quot;working set&quot; name=&quot;working set&quot;&gt;&#13;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/icu4j/src&quot; type=&quot;2&quot;/&gt;&#13;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>\r
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">\r
-<listEntry value="/icu4j/build.xml"/>\r
-</listAttribute>\r
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">\r
-<listEntry value="1"/>\r
-</listAttribute>\r
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>\r
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">\r
-<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>\r
-</listAttribute>\r
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="icu4j"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="jre1.6.0"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>\r
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="initSrc,"/>\r
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/icu4j/build.xml}"/>\r
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/icu4j}"/>\r
-<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>\r
-</launchConfiguration>\r
diff --git a/jars/icu4j-4_2_1-src/eclipseProjectMisc/normSrc.launch b/jars/icu4j-4_2_1-src/eclipseProjectMisc/normSrc.launch
deleted file mode 100755 (executable)
index 179d952..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
-<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">\r
-<stringAttribute key="org.eclipse.ant.ui.ATTR_BUILD_SCOPE" value="${none}"/>\r
-<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>\r
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;launchConfigurationWorkingSet editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; label=&quot;working set&quot; name=&quot;working set&quot;&gt;&#13;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/icu4j/src&quot; type=&quot;2&quot;/&gt;&#13;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>\r
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">\r
-<listEntry value="/icu4j/build.xml"/>\r
-</listAttribute>\r
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">\r
-<listEntry value="1"/>\r
-</listAttribute>\r
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>\r
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">\r
-<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>\r
-</listAttribute>\r
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="icu4j"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="jre1.6.0"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>\r
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="normSrc,"/>\r
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/icu4j/build.xml}"/>\r
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/icu4j}"/>\r
-<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>\r
-</launchConfiguration>\r
index 155a15cad207653f24cdbfa5c8b0d873fb6fd817..0bfd39ac1c1687cc81586328e80bf9668f29791c 100755 (executable)
@@ -205,7 +205,10 @@ public class DictionaryActivity extends ListActivity {
 
   private void closeCurrentDictionary() {
     Log.i(LOG, "closeCurrentDictionary");
-    searchOperation.stopAndWait();
+    if (searchOperation != null) {
+      searchOperation.stopAndWait();
+      searchOperation = null;
+    }
     languageList = null;
     setListAdapter(null);
     dictionary = null;
@@ -313,6 +316,7 @@ public class DictionaryActivity extends ListActivity {
     languageList = new LanguageListAdapter(
         dictionary.languageDatas[(languageList.languageData == dictionary.languageDatas[0]) ? 1
             : 0]);
+    Log.d(LOG, "onLanguageButton, newLang=" + languageList.languageData.language.symbol);
     setListAdapter(languageList);
     updateLangButton();
     onSearchTextChange(searchText.getText().toString());
@@ -327,8 +331,10 @@ public class DictionaryActivity extends ListActivity {
     if (selectedRowIndex == selectedTokenRowIndex && selectedRowIndex > 0) {
       destRowIndex = languageList.languageData.sortedIndex
           .get(prevTokenIndex).startRow;
+      Log.d(LOG, "onUpButton, jumping back a word, destRowIndex=" + destRowIndex);
     } else {
       destRowIndex = selectedTokenRowIndex;
+      Log.d(LOG, "onUpButton, jumping to top of word, destRowIndex=" + destRowIndex);
     }
     jumpToRow(languageList, destRowIndex);
   }
@@ -342,8 +348,10 @@ public class DictionaryActivity extends ListActivity {
     if (nextTokenIndex < languageList.languageData.sortedIndex.size()) {
       destRowIndex = languageList.languageData.sortedIndex
           .get(nextTokenIndex).startRow;
+      Log.d(LOG, "onDownButton, jumping down a word, destRowIndex=" + destRowIndex);
     } else {
       destRowIndex = languageList.languageData.rows.size() - 1;
+      Log.d(LOG, "onDownButton, jumping to end of dict, destRowIndex=" + destRowIndex);
     }
     jumpToRow(languageList, destRowIndex);
   }
index 5631b9d4fe87b18e4c6ba0c74bf54438c91e4768..5afcb229d033c07313c1cee9eb6dfe66c1d22a04 100755 (executable)
@@ -34,7 +34,7 @@ public class DictionaryActivityTest extends ActivityInstrumentationTestCase2<Dic
     assertEquals(Language.EN, dict.languageList.languageData.language);\r
 \r
     dict.uiHandler.post(switchLang);\r
-    Thread.sleep(100);\r
+    Thread.sleep(200);\r
     assertEquals(Language.DE, dict.languageList.languageData.language);\r
     \r
     dict.finish();\r