javauis/lcdui_qt/src_j2me/javax/microedition/lcdui/OpenLcduiLocalization.java
changeset 23 98ccebc37403
parent 21 2a9601315dfc
child 87 1627c337e51e
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: 
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 package javax.microedition.lcdui;
    18 package javax.microedition.lcdui;
    19 
    19 
    20 import com.nokia.mj.impl.utils.ResourceLoader;
    20 import com.nokia.mj.impl.utils.ResourceLoader;
    21 import org.eclipse.swt.SWT;
    21 import org.eclipse.swt.SWT;
    22 
    22 
    23 final class OpenLcduiLocalization {
    23 final class OpenLcduiLocalization
    24 	
    24 {
    25 	private static ResourceLoader iRes;
    25 
    26 	
    26     private static ResourceLoader iRes;
    27 	public static String getMessage(String key) {
    27 
    28   
    28     public static String getMessage(String key)
    29     if (key == null) throw new IllegalArgumentException(
    29     {
    30             MsgRepository.TEXT_EXCEPTION_TXT_IS_NULL);
    30 
    31     
    31         if(key == null) throw new IllegalArgumentException(
    32     if(key.equals("key_up")){
    32                 MsgRepository.TEXT_EXCEPTION_TXT_IS_NULL);
    33     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
    33 
    34    		return iRes.format(key).toString();
    34         if(key.equals("key_up"))
       
    35         {
       
    36             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    37             return iRes.format(key).toString();
       
    38         }
       
    39 
       
    40         if(key.equals("key_down"))
       
    41         {
       
    42             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    43             return iRes.format(key).toString();
       
    44         }
       
    45 
       
    46         if(key.equals("key_left"))
       
    47         {
       
    48             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    49             return iRes.format(key).toString();
       
    50         }
       
    51 
       
    52         if(key.equals("key_right"))
       
    53         {
       
    54             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    55             return iRes.format(key).toString();
       
    56         }
       
    57 
       
    58         if(key.equals("key_select"))
       
    59         {
       
    60             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    61             return iRes.format(key).toString();
       
    62         }
       
    63 
       
    64         if(key.equals("key_stop"))
       
    65         {
       
    66             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    67             return iRes.format(key).toString();
       
    68         }
       
    69 
       
    70         if(key.equals("alert_error"))
       
    71         {
       
    72             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    73             return iRes.format(key).toString();
       
    74         }
       
    75 
       
    76         if(key.equals("alert_warning"))
       
    77         {
       
    78             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    79             return iRes.format(key).toString();
       
    80         }
       
    81 
       
    82         if(key.equals("alert_info"))
       
    83         {
       
    84             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    85             return iRes.format(key).toString();
       
    86         }
       
    87 
       
    88         if(key.equals("alert_conf"))
       
    89         {
       
    90             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    91             return iRes.format(key).toString();
       
    92         }
       
    93 
       
    94         if(key.equals("alert_alarm"))
       
    95         {
       
    96             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    97             return iRes.format(key).toString();
       
    98         }
       
    99 
       
   100         if(key.equals("alert_null"))
       
   101         {
       
   102             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
   103             return iRes.format(key).toString();
       
   104         }
       
   105 
       
   106         if(key.equals("pb_fetch_number"))
       
   107         {
       
   108             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   109             return iRes.format(key).toString();
       
   110         }
       
   111 
       
   112         if(key.equals("pb_fetch_number_short"))
       
   113         {
       
   114             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   115             return iRes.format(key).toString();
       
   116         }
       
   117 
       
   118         if(key.equals("pb_fetch_email"))
       
   119         {
       
   120             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   121             return iRes.format(key).toString();
       
   122         }
       
   123 
       
   124         if(key.equals("pb_fetch_email_short"))
       
   125         {
       
   126             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   127             return iRes.format(key).toString();
       
   128         }
       
   129 
       
   130         if(key.equals("create_call"))
       
   131         {
       
   132             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   133             return iRes.format(key).toString();
       
   134         }
       
   135 
       
   136         if(key.equals("create_call_short"))
       
   137         {
       
   138             iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   139             return iRes.format(key).toString();
       
   140         }
       
   141 
       
   142         if(key.equals("back"))
       
   143         {
       
   144             iRes = ResourceLoader.getInstance("lcduiavkon", "text_softkey_");
       
   145             return iRes.format(key).toString();
       
   146         }
       
   147 
       
   148         if(key.equals("close"))
       
   149         {
       
   150             iRes = ResourceLoader.getInstance("lcduiavkon", "text_softkey_");
       
   151             return iRes.format(key).toString();
       
   152         }
       
   153 
       
   154         if(key.equals("empty_list"))
       
   155         {
       
   156             iRes = ResourceLoader.getInstance("lcduiavkon", "qtn_selec_");
       
   157             return iRes.format(key).toString();
       
   158         }
       
   159 
       
   160         if(key.equals("help"))
       
   161         {
       
   162             iRes = ResourceLoader.getInstance("lcduiavkon", "qtn_options_");
       
   163             return iRes.format(key).toString();
       
   164         }
       
   165 
       
   166         return SWT.getMessage(key);
    35     }
   167     }
    36     
   168 
    37     if(key.equals("key_down")){
       
    38     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    39    		return iRes.format(key).toString();
       
    40     }
       
    41     
       
    42     if(key.equals("key_left")){
       
    43     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    44    		return iRes.format(key).toString();
       
    45     }
       
    46     
       
    47     if(key.equals("key_right")){
       
    48     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    49    		return iRes.format(key).toString();
       
    50     }
       
    51     
       
    52     if(key.equals("key_select")){
       
    53     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    54    		return iRes.format(key).toString();
       
    55     }
       
    56     
       
    57     if(key.equals("key_stop")){
       
    58     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    59    		return iRes.format(key).toString();
       
    60     }
       
    61   
       
    62     if(key.equals("alert_error")){
       
    63     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    64    		return iRes.format(key).toString();
       
    65     }
       
    66      
       
    67     if(key.equals("alert_warning")){
       
    68     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    69    		return iRes.format(key).toString();
       
    70     }
       
    71      
       
    72     if(key.equals("alert_info")){
       
    73     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    74    		return iRes.format(key).toString();
       
    75     }
       
    76      
       
    77     if(key.equals("alert_conf")){
       
    78     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    79    		return iRes.format(key).toString();
       
    80     }
       
    81      
       
    82     if(key.equals("alert_alarm")){
       
    83     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    84    		return iRes.format(key).toString();
       
    85     }
       
    86      
       
    87     if(key.equals("alert_null")){
       
    88     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_");
       
    89    		return iRes.format(key).toString();
       
    90     }
       
    91      
       
    92     if(key.equals("pb_fetch_number")){
       
    93     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
    94    		return iRes.format(key).toString();
       
    95     }
       
    96      
       
    97     if(key.equals("pb_fetch_number_short")){
       
    98     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
    99    		return iRes.format(key).toString();
       
   100     }
       
   101      
       
   102     if(key.equals("pb_fetch_email")){
       
   103     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   104    		return iRes.format(key).toString();
       
   105     }
       
   106       
       
   107     if(key.equals("pb_fetch_email_short")){
       
   108     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   109    		return iRes.format(key).toString();
       
   110     }
       
   111       
       
   112     if(key.equals("create_call")){
       
   113     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   114    		return iRes.format(key).toString();
       
   115     }
       
   116       
       
   117     if(key.equals("create_call_short")){
       
   118     	iRes = ResourceLoader.getInstance("lcdui", "qtn_midp_option_");
       
   119    		return iRes.format(key).toString();
       
   120     }
       
   121    
       
   122     if(key.equals("back")){
       
   123     	iRes = ResourceLoader.getInstance("lcduiavkon", "text_softkey_");
       
   124    		return iRes.format(key).toString();
       
   125     }
       
   126     
       
   127     if(key.equals("close")){
       
   128     	iRes = ResourceLoader.getInstance("lcduiavkon", "text_softkey_");
       
   129    		return iRes.format(key).toString();
       
   130     }
       
   131     
       
   132     if(key.equals("empty_list")){
       
   133     	iRes = ResourceLoader.getInstance("lcduiavkon", "qtn_selec_");
       
   134    		return iRes.format(key).toString();
       
   135     }
       
   136     
       
   137     if(key.equals("help")){
       
   138     	iRes = ResourceLoader.getInstance("lcduiavkon", "qtn_options_");
       
   139    		return iRes.format(key).toString();
       
   140     }
       
   141     
       
   142     return SWT.getMessage(key);
       
   143   }
       
   144   
       
   145 }
   169 }