javauis/lcdui_qt/src_j2me/javax/microedition/lcdui/OpenLcduiLocalization.java
branchRCL_3
changeset 65 ae942d28ec0e
equal deleted inserted replaced
60:6c158198356e 65:ae942d28ec0e
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 package javax.microedition.lcdui;
       
    19 
       
    20 import com.nokia.mj.impl.utils.ResourceLoader;
       
    21 import org.eclipse.swt.SWT;
       
    22 
       
    23 final class OpenLcduiLocalization
       
    24 {
       
    25 
       
    26     private static ResourceLoader iRes;
       
    27 
       
    28     public static String getMessage(String key)
       
    29     {
       
    30 
       
    31         if(key == null) throw new IllegalArgumentException(
       
    32                 MsgRepository.TEXT_EXCEPTION_TXT_IS_NULL);
       
    33 
       
    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);
       
   167     }
       
   168 
       
   169 }