package com.acme.resource;

import java.util.Locale;
import java.util.ResourceBundle;


//import oracle.adf.view.rich.component.rich.output.RichImage;


public class ResourceHelper
{ 
    private static Locale defaultLocale;

    static
    {
        //will be planned that locale would be set according to user selection next
        setDefaultLocale(new Locale("tr", "TR"));
    }

    public static void setDefaultLocale(Locale locale)
    {
        defaultLocale = locale;
    }

    public static String getStringResourceItem(String moduleShortName, String itemName)
    {
        ResourceBundle stats = ResourceBundle.getBundle("com.acme.resource.bundle.ResourceBundle_" + moduleShortName, defaultLocale);

        return (String)stats.getObject(itemName);
    }

    public static String getStringResourceItem(String moduleShortName, String itemName, Locale currentLocale)
    {
        ResourceBundle stats = ResourceBundle.getBundle("com.acme.resource.bundle.ResourceBundle_" + moduleShortName, currentLocale);

        return (String)stats.getObject(itemName);
    }

    public static Object getVisualResourceItem(String itemName)
    {
        ResourceBundle stats = ResourceBundle.getBundle("com.acme.resource.bundle.VisualResourceBundle");

        return stats.getObject(itemName);
    }

    public static Locale getDefaultLocale()
    {
        return defaultLocale;
    }
}
