Author: sflanigan
Date: 2009-04-07 01:50:28 -0400 (Tue, 07 Apr 2009)
New Revision: 14534
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.properties
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
JBIDE-3557 Externalise English strings - converted JSPEditorMessages to new-style Eclipse
message bundle
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.java 2009-04-07
04:47:20 UTC (rev 14533)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.java 2009-04-07
05:50:28 UTC (rev 14534)
@@ -7,38 +7,35 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.jst.jsp.jspeditor;
-import java.util.MissingResourceException;
+
import java.util.ResourceBundle;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.eclipse.osgi.util.NLS;
-/**
- * @author Jeremy
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class JSPEditorMessages {
- private static final String RESOURCE_BUNDLE=
"org.jboss.tools.jst.jsp.jspeditor.JSPEditorMessages";//$NON-NLS-1$
+public final class JSPEditorMessages extends NLS {
- private static ResourceBundle fgResourceBundle=
ResourceBundle.getBundle(RESOURCE_BUNDLE);
+ private static final String BUNDLE_NAME =
"org.jboss.tools.jst.jsp.jspeditor.JSPEditorMessages";//$NON-NLS-1$
private JSPEditorMessages() {
+ // Do not instantiate
}
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- return "!!!" + key + "!!!";//$NON-NLS-2$ //$NON-NLS-1$
- }
+ public static String JSPMultiPageEditor_TabLabel_VisualSource;
+ public static String JSPMultiPageEditor_TabLabel_Source;
+ public static String JSPMultiPageEditor_TabLabel_Preview;
+ public static String JSPMultiPageEditor_ContextMenu_ShowInMenu;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, JSPEditorMessages.class);
}
-
+
+ /**
+ * @deprecated use the string fields of the NLS subclass
+ */
public static ResourceBundle getResourceBundle() {
- return fgResourceBundle;
+ return ResourceBundle.getBundle(BUNDLE_NAME);
}
-}
+}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.properties 2009-04-07
04:47:20 UTC (rev 14533)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.properties 2009-04-07
05:50:28 UTC (rev 14534)
@@ -1,9 +1,9 @@
# used in org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor
-JSPMultiPageEditor.TabLabel.VisualSource = Visual/Source
+JSPMultiPageEditor_TabLabel_VisualSource = Visual/Source
# apparently unused
#JSPMultiPageEditor.TabLabel.Visual = Visual
-JSPMultiPageEditor.TabLabel.Source = Source
-JSPMultiPageEditor.TabLabel.Preview = Preview
+JSPMultiPageEditor_TabLabel_Source = Source
+JSPMultiPageEditor_TabLabel_Preview = Preview
# org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.getShowInMenuLabel()
-JSPMultiPageEditor.ContextMenu.ShowInMenu = Show In
\ No newline at end of file
+JSPMultiPageEditor_ContextMenu_ShowInMenu = Show In
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2009-04-07
04:47:20 UTC (rev 14533)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2009-04-07
05:50:28 UTC (rev 14534)
@@ -465,8 +465,7 @@
try {
if(visualEditor!=null) {
visualSourceIndex = addPage(visualEditor, getEditorInput());
- setPageText(visualSourceIndex, JSPEditorMessages
- .getString("JSPMultiPageEditor.TabLabel.VisualSource")); //$NON-NLS-1$
+ setPageText(visualSourceIndex,
JSPEditorMessages.JSPMultiPageEditor_TabLabel_VisualSource); //$NON-NLS-1$
setPartName(visualEditor.getTitle());
}
} catch (PartInitException e) {
@@ -482,8 +481,7 @@
}*/
try {
- String sourceTabLabel = JSPEditorMessages.getString(
- "JSPMultiPageEditor.TabLabel.Source"); //$NON-NLS-1$
+ String sourceTabLabel = JSPEditorMessages.JSPMultiPageEditor_TabLabel_Source;
//$NON-NLS-1$
if(visualEditor!=null) {
sourceIndex = addPage(visualEditor, getEditorInput());
setPageText(sourceIndex, sourceTabLabel);
@@ -501,8 +499,7 @@
try {
if(visualEditor!=null) {
previewIndex = addPage(visualEditor, getEditorInput());
- setPageText(previewIndex, JSPEditorMessages
- .getString("JSPMultiPageEditor.TabLabel.Preview")); //$NON-NLS-1$
+ setPageText(previewIndex, JSPEditorMessages.JSPMultiPageEditor_TabLabel_Preview);
//$NON-NLS-1$
setPartName(visualEditor.getTitle());
}
} catch (PartInitException e) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-04-07
04:47:20 UTC (rev 14533)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-04-07
05:50:28 UTC (rev 14534)
@@ -1288,6 +1288,6 @@
}
private String getShowInMenuLabel() {
- return
JSPEditorMessages.getString("JSPMultiPageEditor.ContextMenu.ShowInMenu");
//$NON-NLS-1$
+ return JSPEditorMessages.JSPMultiPageEditor_ContextMenu_ShowInMenu;
}
}
Show replies by date