Skip to content

Commit

Permalink
MONDRIAN: fix Javadoc
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 9623]
  • Loading branch information
Sherman Wood committed Jul 19, 2007
1 parent 4b3de92 commit fadd3ed
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions src/main/mondrian/gui/I18n.java
Expand Up @@ -27,10 +27,10 @@ public class I18n {

private static String defaultIcon = "nopic";

public static Vector languageChangedListeners = null;
public static Vector<LanguageChangedListener> languageChangedListeners = null;

static {
languageChangedListeners = new Vector();
languageChangedListeners = new Vector<LanguageChangedListener>();
}

public static void addOnLanguageChangedListener(LanguageChangedListener listener) {
Expand All @@ -44,7 +44,7 @@ public I18n(ResourceBundle guiBundle, ResourceBundle languageBundle) {


public static List getListOfAvailableLanguages(Class cl) {
java.util.List supportedLocales = new ArrayList();
java.util.List<Locale> supportedLocales = new ArrayList<Locale>();

try {
Set names = getResourcesInPackage( cl, cl.getName() );
Expand Down Expand Up @@ -113,7 +113,7 @@ public static List getListOfAvailableLanguages(Class cl) {
// Sort the list. Probably should use the current locale when getting the
// DisplayLanguage so the sort order is correct for the user.

Collections.sort( supportedLocales, new Comparator() {
Collections.sort( supportedLocales, new Comparator<Object>() {
public int compare(Object lhs, Object rhs) {
String ls = ((Locale)lhs).getDisplayLanguage();
String rs = ((Locale)rhs).getDisplayLanguage();
Expand Down Expand Up @@ -141,6 +141,7 @@ public int compare(Object lhs, Object rhs) {
* on the java.sun.com message boards.
* http://forum.java.sun.com/thread.jsp?forum=22&thread=30984
*
* @param coreClass Class for class loader to find the resources
* @param packageName The package to enumerate
* @return A Set of Strings for each resouce in the package.
*/
Expand All @@ -156,7 +157,7 @@ public static Set getResourcesInPackage(Class coreClass, String packageName) thr

Enumeration dirEnum = cl.getResources( localPackageName );

Set names = new HashSet();
Set<String> names = new HashSet<String>();

// Loop CLASSPATH directories
while( dirEnum.hasMoreElements() ) {
Expand Down Expand Up @@ -258,13 +259,19 @@ public String getGUIReference(String reference) {

/**
* Retreive a resource string using the current locale.
* @param cID The resouce sting identifier
* @param stringID The resource string identifier
* @return The locale specific string
*/
public String getString(String stringID) {
return getString(stringID, getCurrentLocale() );
}

/**
* Retreive a resource string using the current locale, with a default.
* @param stringID The resource string identifier
* @param defaultValue if no resource for the stringID is specified, use this default value
* @return The locale specific string
*/
public String getString(String stringID, String defaultValue) {
return getString(stringID, getCurrentLocale(), defaultValue );
}
Expand All @@ -284,10 +291,23 @@ public String getFormattedString(String stringID, String defaultValue, Object[]
}


/**
* Retreive a resource string using the given locale. The stringID is the default.
* @param stringID The resource string identifier
* @param currentLocale required Locale for resource
* @return The locale specific string
*/
private String getString(String stringID, Locale currentLocale) {
return getString(stringID, currentLocale, stringID);
}

/**
* Retreive a resource string using the given locale. Use the default if there is nothing for the given Locale.
* @param stringID The resource string identifier
* @param currentLocale required Locale for resource
* @param defaultValue The default value for the resource string
* @return The locale specific string
*/
public String getString(String stringID, Locale currentLocale, String defaultValue) {
try {
if (languageBundle == null) {
Expand Down

0 comments on commit fadd3ed

Please sign in to comment.