Author: scabanovich
Date: 2009-04-03 09:46:40 -0400 (Fri, 03 Apr 2009)
New Revision: 14493
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/FavoritesClassController.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/Messages.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/messages.properties
Log:
JBIDE-4044
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/FavoritesClassController.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/FavoritesClassController.java 2009-04-03
11:51:51 UTC (rev 14492)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/FavoritesClassController.java 2009-04-03
13:46:40 UTC (rev 14493)
@@ -28,7 +28,6 @@
public class FavoritesClassController {
private static final String FAVORITES_CLASSES_LIST =
"JavaFavoritesFieldEditor.classes";
- private static final String DEFAULT_CLASSES_LIST =
"FavoritesClassController.defaultClasses";
private static final Image CLASS_ICON =
JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CLASS);
@@ -36,7 +35,7 @@
ArrayList<String> list = new ArrayList<String>();
String classesList =
ModelUIPlugin.getDefault().getPreferenceStore().getString(FAVORITES_CLASSES_LIST);
if ((classesList==null)||(classesList.length()==0)) {
- classesList = Messages.getString(DEFAULT_CLASSES_LIST);
+ classesList = Messages.FavoritesClassController_defaultClasses;
}
StringTokenizer st = new StringTokenizer(classesList,",");
while (st.hasMoreTokens()) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/Messages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/Messages.java 2009-04-03
11:51:51 UTC (rev 14492)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/Messages.java 2009-04-03
13:46:40 UTC (rev 14493)
@@ -10,28 +10,16 @@
******************************************************************************/
package org.jboss.tools.common.core.jdt;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
-public class Messages {
+public class Messages extends NLS {
- private static final String RESOURCE_BUNDLE =
"org.jboss.tools.common.core.jdt.messages";
+ private static final String BUNDLE_NAME =
"org.jboss.tools.common.core.jdt.messages";
- private static ResourceBundle resourceBundle =
ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private Messages() {
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
- public static String getString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "%" + key + "%";
- }
- }
-
- public static ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
+ public static String FavoritesClassController_defaultClasses;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/messages.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/messages.properties 2009-04-03
11:51:51 UTC (rev 14492)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/messages.properties 2009-04-03
13:46:40 UTC (rev 14493)
@@ -1,4 +1,4 @@
# START NON-TRANSLATABLE
# comment
-FavoritesClassController.defaultClasses =
+FavoritesClassController_defaultClasses =
# END NON-TRANSLATABLE
Show replies by date