Author: akazakov
Date: 2009-04-02 11:07:42 -0400 (Thu, 02 Apr 2009)
New Revision: 14460
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditorMessages.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditorMessages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4044
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2009-04-02
15:07:32 UTC (rev 14459)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2009-04-02
15:07:42 UTC (rev 14460)
@@ -269,7 +269,7 @@
textEditor = createTextEditor();
try {
int index = addPage((IEditorPart)textEditor, getEditorInput());
- setPageText(index, "Source");
+ setPageText(index, ObjectMultiPageEditorMessages.PAGES_EDITOR_SOURCE_TAB);
textEditor.setObject(object);
textEditor.addFocusListener(new TextFocusListener());
outline.addSelectionChangedListener(new OutlineSelectionListener());
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditorMessages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditorMessages.java 2009-04-02
15:07:32 UTC (rev 14459)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditorMessages.java 2009-04-02
15:07:42 UTC (rev 14460)
@@ -10,27 +10,36 @@
******************************************************************************/
package org.jboss.tools.common.editor;
+import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+
/**
* @author Jeremy
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
*/
public class ObjectMultiPageEditorMessages {
- private static ResourceBundle bundle = ResourceBundle
- .getBundle("org.jboss.tools.common.editor.ObjectMultiPageEditorMessages");
//$NON-NLS-1$
+ private static final String BUNDLE_NAME =
"org.jboss.tools.common.editor.ObjectMultiPageEditorMessages"; //$NON-NLS-1$
- private ObjectMultiPageEditorMessages() {}
+ private static ResourceBundle fResourceBundle;
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, ObjectMultiPageEditorMessages.class);
+ }
- public static String getString( String key ) {
+ public static String PAGES_EDITOR_SOURCE_TAB;
+
+ public static ResourceBundle getResourceBundle() {
try {
- return bundle.getString( key );
- } catch ( MissingResourceException e ) {
- return "!!!" + key + "!!!"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (fResourceBundle == null)
+ fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault());
}
+ catch (MissingResourceException x) {
+ ModelUIPlugin.getPluginLog().logError(x);
+ fResourceBundle = null;
+ }
+ return fResourceBundle;
}
-
-}
+}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditorMessages.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditorMessages.properties 2009-04-02
15:07:32 UTC (rev 14459)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditorMessages.properties 2009-04-02
15:07:42 UTC (rev 14460)
@@ -1,2 +1,3 @@
Editor.error.activated.outofsync.title=File Changed
Editor.error.activated.outofsync.message=The file has been changed on the file system. Do
you want to load the changes?
+PAGES_EDITOR_SOURCE_TAB=Source
\ No newline at end of file