Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

WizardTranslate.java

00001 /**
00002  * C-JDBC: Clustered JDBC.
00003  * Copyright (C) 2002-2004 French National Institute For Research In Computer
00004  * Science And Control (INRIA).
00005  * Contact: c-jdbc@objectweb.org
00006  * 
00007  * This library is free software; you can redistribute it and/or modify it
00008  * under the terms of the GNU Lesser General Public License as published by the
00009  * Free Software Foundation; either version 2.1 of the License, or any later
00010  * version.
00011  * 
00012  * This library is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
00015  * for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this library; if not, write to the Free Software Foundation,
00019  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00020  *
00021  * Initial developer(s): Nicolas Modrzyk.
00022  * Contributor(s):  Emmanuel Cecchet.
00023  */
00024 
00025 package org.objectweb.cjdbc.common.i18n;
00026 
00027 import java.util.MissingResourceException;
00028 import java.util.ResourceBundle;
00029 
00030 /**
00031  * Class to translate the different messages of cjdbc.
00032  * 
00033  * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
00034  * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
00035  * @version 1.0
00036  */
00037 
00038 public final class WizardTranslate extends I18N
00039 {
00040   /**
00041    * Wizard message description is stored in a different file
00042    */
00043   public static final String   MBEANS_LANGUAGE_FILE = "c-jdbc-wizard";
00044 
00045   /**
00046    * Translation bundle for C-JDBC messages
00047    */
00048   public static ResourceBundle bundle;
00049 
00050   static
00051   {
00052     try
00053     {
00054       bundle = ResourceBundle.getBundle(MBEANS_LANGUAGE_FILE);
00055     }
00056     catch (MissingResourceException e)
00057     {
00058       e.printStackTrace();
00059     }
00060   }
00061 
00062   /**
00063    * @param key the key to translate
00064    * @return translation
00065    * @see I18N#get(ResourceBundle, String)
00066    */
00067   public static String get(String key)
00068   {
00069     return get(bundle, key);
00070   }
00071 
00072   /**
00073    * @param key the key to translate
00074    * @param parameter boolean parameter
00075    * @return translation
00076    * @see I18N#get(ResourceBundle, String, boolean)
00077    */
00078   public static String get(String key, boolean parameter)
00079   {
00080     return get(bundle, key, parameter);
00081   }
00082 
00083   /**
00084    * @param key the key to translate
00085    * @param parameter int parameter
00086    * @return translation
00087    * @see I18N#get(ResourceBundle, String, int)
00088    */
00089   public static String get(String key, int parameter)
00090   {
00091     return get(bundle, key, parameter);
00092   }
00093 
00094   /**
00095    * @param key the key to translate
00096    * @param parameter long parameter
00097    * @return translation
00098    * @see I18N#get(ResourceBundle, String, long)
00099    */
00100   public static String get(String key, long parameter)
00101   {
00102     return get(bundle, key, parameter);
00103   }
00104 
00105   /**
00106    * @param key the key to translate
00107    * @param parameters Object array parameter
00108    * @return translation
00109    * @see I18N#get(ResourceBundle, String, Object[])
00110    */
00111   public static String get(String key, Object[] parameters)
00112   {
00113     return get(bundle, key, parameters);
00114   }
00115 
00116   /**
00117    * @param key the key to translate
00118    * @param parameter Object parameter
00119    * @return translation
00120    * @see I18N#get(ResourceBundle, String, Object)
00121    */
00122   public static String get(String key, Object parameter)
00123   {
00124     return get(bundle, key, parameter);
00125   }
00126 }

Generated on Mon Apr 11 22:01:35 2005 for C-JDBC by  doxygen 1.3.9.1