ICU-4907 modifications for eclipse/1.3/foundation compatibility

X-SVN-Rev: 18838
This commit is contained in:
Doug Felt 2005-11-29 19:23:58 +00:00
parent 3771029ec0
commit 4b7cdda12e
6 changed files with 60 additions and 13 deletions

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="icu4j.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>

View file

@ -1,8 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: International Components for Unicode for Java (ICU4J)
Bundle-SymbolicName: com.ibm.icu
Bundle-Version: 3.4.1
Bundle-SymbolicName: com.ibm.icu; singleton:=true
Bundle-Version: 3.4.2
Bundle-Vendor: IBM
Bundle-Localization: plugin
Bundle-Copyright: Licensed Materials - Property of IBM
@ -15,5 +15,9 @@ Export-Package: com.ibm.icu.impl;x-friends:="com.ibm.icu.tests",
com.ibm.icu.math,
com.ibm.icu.text,
com.ibm.icu.util
Bundle-ClassPath: icu4j.jar
Bundle-ClassPath: icu4j.jar,
bin/
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
J2SE-1.3
Require-Bundle: org.eclipse.icu

View file

@ -1,5 +1,16 @@
source.. = src/
output.. = bin/
bin.includes = .classpath,\
.project,\
build.properties,\
META-INF/,\
com.ibm.icu_3.4.1.jar
icu4j.jar,\
plugin.xml,\
bin/
src.includes = src/,\
build.properties,\
.classpath,\
.project,\
.settings/,\
META-INF/

View file

@ -1,4 +1,4 @@
//##header 1132615047000
//##header 1133291226000
/**
*******************************************************************************
* Copyright (C) 2001-2005, International Business Machines Corporation and *
@ -993,7 +993,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
public void TestJavaULocaleBundleLoading(){
String baseName="com.ibm.icu.dev.data.resources.TestDataElements";
String locName = "en_Latn_US";
UResourceBundle bundle = UResourceBundle.getBundleInstance(baseName, locName);
UResourceBundle bundle = UResourceBundle.getBundleInstance(baseName, locName, testLoader);
String fromRoot = bundle.getString("from_root");
if(!fromRoot.equals("This data comes from root")){
errln("Did not get the expected string for from_root");
@ -1010,7 +1010,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
if(!fromEnLatnUs.equals("This data comes from en_Latn_US")){
errln("Did not get the expected string for from_en_Latn_US");
}
UResourceBundle bundle1 = UResourceBundle.getBundleInstance(baseName, new ULocale(locName));
UResourceBundle bundle1 = UResourceBundle.getBundleInstance(baseName, new ULocale(locName), testLoader);
if(!bundle1.equals(bundle)){
errln("Did not get the expected bundle for "+baseName +"."+locName);
}
@ -1018,7 +1018,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
errln("Did not load the bundle from cache");
}
// non-existent bundle .. should return default
UResourceBundle defaultBundle = UResourceBundle.getBundleInstance(baseName, "hi_IN");
UResourceBundle defaultBundle = UResourceBundle.getBundleInstance(baseName, "hi_IN", testLoader);
ULocale defaultLocale = ULocale.getDefault();
if(!defaultBundle.getULocale().equals(defaultLocale)){
errln("Did not get the default bundle for non-existent bundle");
@ -1026,7 +1026,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
// non-existent bundle, non-existent default locale
// so return the root bundle.
ULocale.setDefault(ULocale.CANADA_FRENCH);
UResourceBundle root = UResourceBundle.getBundleInstance(baseName, "hi_IN");
UResourceBundle root = UResourceBundle.getBundleInstance(baseName, "hi_IN", testLoader);
if(!root.getULocale().toString().equals("")){
errln("Did not get the root bundle for non-existent default bundle for non-existent bundle");
}
@ -1041,7 +1041,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
if(i!=4){
errln("Did not get the expected number of keys: got " + i + ", expected 4");
}
UResourceBundle bundle4 = UResourceBundle.getBundleInstance(baseName,"fr_Latn_FR");
UResourceBundle bundle4 = UResourceBundle.getBundleInstance(baseName,"fr_Latn_FR", testLoader);
if(bundle==null){
errln("Could not load bundle fr_Latn_FR");
}

View file

@ -2,10 +2,10 @@ Manifest-Version: 1.0
Name: com/ibm/icu/
Specification-Title: ICU for Java
Specification-Version: 3.5
Specification-Version: 3.4.2
Specification-Vendor: ICU
Implementation-Title: ICU for Java
Implementation-Version: 3.5
Implementation-Version: 3.4.2
Implementation-Vendor: IBM Corporation
Implementation-Vendor-Id: com.ibm
Copyright-Info: Copyright (c) 2000-2005, International Business Machines Corporation and others. All Rights Reserved.

View file

@ -196,7 +196,38 @@ public abstract class UResourceBundle extends ResourceBundle{
return getBundleInstance(baseName, locale.toString(),ICUResourceBundle.ICU_DATA_CLASS_LOADER);
}
/**
* Creates a UResourceBundle for the specified locale and specified base name,
* from which users can extract resources by using their corresponding keys.
* @param baseName specifies the locale for which we want to open the resource.
* If null the bundle for default locale is opened.
* @param locale specifies the locale for which we want to open the resource.
* If null the bundle for default locale is opened.
* @param loader the loader to use
* @return a resource bundle for the given base name and locale
* @draft ICU 3.4.2
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public static UResourceBundle getBundleInstance(String baseName, Locale locale, ClassLoader loader){
return getBundleInstance(baseName, ULocale.forLocale(locale), loader);
}
/**
* Creates a UResourceBundle, from which users can extract resources by using
* their corresponding keys.
* @param baseName string containing the name of the data package.
* If null the default ICU package name is used.
* @param locale specifies the locale for which we want to open the resource.
* If null the bundle for default locale is opened.
* @param loader the loader to use
* @return a resource bundle for the given base name and locale
* @draft ICU 3.4.2
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public static UResourceBundle getBundleInstance(String baseName, ULocale locale, ClassLoader loader){
return getBundleInstance(baseName, locale.toString(),loader);
}
/**
* Returns the RFC 3066 conformant locale id of this resource bundle.
* This method can be used after a call to getBundleInstance() to