|
1 /* |
|
2 * Copyright (c) 2008 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 com.nokia.mj.impl.security.utils; |
|
19 |
|
20 import com.nokia.mj.impl.utils.LocalizedTextProvider; |
|
21 import com.nokia.mj.impl.utils.ResourceLoader; |
|
22 |
|
23 public class SecurityPermissionTexts extends LocalizedTextProvider |
|
24 { |
|
25 /** Singleton instance of SecurityPermissionTexts. */ |
|
26 private static SecurityPermissionTexts self = null; |
|
27 /** ResourceLoader for fetching localised texts. */ |
|
28 private static ResourceLoader iRes = null; |
|
29 |
|
30 // identifiers for the security permission texts |
|
31 public static final String CALL_CONTROL = "call_control"; |
|
32 public static final String NET_ACCESS = "net_access"; |
|
33 public static final String LOW_LEVEL_NET_ACCESS = "low_level_net_access"; |
|
34 public static final String MESSAGING = "messaging"; |
|
35 public static final String RESTRICTED_MESSAGING = "restricted_messaging"; |
|
36 public static final String APP_AUTO_INVOCAT = "app_auto_invocat"; |
|
37 public static final String LOCAL_CONN = "local_conn"; |
|
38 public static final String MM_RECORD = "mm_record"; |
|
39 public static final String READ_DATA = "read_data"; |
|
40 public static final String WRITE_DATA = "write_data"; |
|
41 public static final String LOCATION = "location"; |
|
42 public static final String LANDMARKS = "landmarks"; |
|
43 public static final String AUTH = "auth"; |
|
44 public static final String BROADCAST = "broadcast"; |
|
45 |
|
46 /** |
|
47 * Creates an instance of the SecurityPermissionTexts |
|
48 * |
|
49 * @return An instance of SecurityPermissionTexts |
|
50 */ |
|
51 public static SecurityPermissionTexts getInstance() |
|
52 { |
|
53 if (self == null) |
|
54 { |
|
55 self = new SecurityPermissionTexts(); |
|
56 } |
|
57 return self; |
|
58 } |
|
59 |
|
60 /** |
|
61 * Constructor |
|
62 */ |
|
63 private SecurityPermissionTexts() |
|
64 { |
|
65 } |
|
66 |
|
67 /** |
|
68 * Returns the localized texts. |
|
69 * |
|
70 * @param aTextId id for the localized text (one of the pre-defined |
|
71 * constants) |
|
72 * @param aTextParams parameters for the localized text |
|
73 * @return the localized text associated with the provided |
|
74 * identifier and parameters |
|
75 */ |
|
76 public String getText(String aTextId, Object[] aTextParams) |
|
77 { |
|
78 if (iRes == null) |
|
79 { |
|
80 iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_perm_"); |
|
81 } |
|
82 return iRes.format(aTextId, aTextParams); |
|
83 } |
|
84 } |