Author: vrubezhny
Date: 2009-04-07 08:46:52 -0400 (Tue, 07 Apr 2009)
New Revision: 14552
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractImplementationsPreferencesPage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractPagesPreferencesPage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/Messages.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/preferences.properties
Log:
JBIDE-4044 Review unused strings as reported by "Find Broken Externalized
Strings"
The Messages resource bundle is redeveloped using NLS.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractImplementationsPreferencesPage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractImplementationsPreferencesPage.java 2009-04-07
12:46:38 UTC (rev 14551)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractImplementationsPreferencesPage.java 2009-04-07
12:46:52 UTC (rev 14552)
@@ -127,10 +127,10 @@
heightHint = convertVerticalDLUsToPixels(14 /*IDialogConstants.BUTTON_HEIGHT*/);
widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- addButtonImpl = createButton(impl,
Messages.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
+ addButtonImpl = createButton(impl, Messages.ImplementationsPreferencesPage_Add);
//$NON-NLS-1$
if (errorMessage != null) addButtonImpl.setEnabled(false);
- removeButtonImpl = createButton(impl,
Messages.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
+ removeButtonImpl = createButton(impl, Messages.ImplementationsPreferencesPage_Remove);
//$NON-NLS-1$
removeButtonImpl.setEnabled(false);
// TabFolder
@@ -139,10 +139,10 @@
tabbedComposite.setLayoutData(gridDataTab);
TabItem librariesTab = new TabItem(tabbedComposite,SWT.NULL);
- librariesTab.setText(Messages.getString("ImplementationsPreferencesPage.Library.Sets"));
//$NON-NLS-1$
+ librariesTab.setText(Messages.ImplementationsPreferencesPage_Library_Sets);
//$NON-NLS-1$
TabItem projectTab = new TabItem(tabbedComposite,SWT.NULL);
- projectTab.setText(Messages.getString("ImplementationsPreferencesPage.Project.Templates"));
//$NON-NLS-1$
+ projectTab.setText(Messages.ImplementationsPreferencesPage_Project_Templates);
//$NON-NLS-1$
// listLibraries
Composite entryLibraries = new Composite(tabbedComposite, SWT.NULL);
@@ -156,10 +156,10 @@
listLibraries.setLayoutData(gridDataListLibraries);
- addButtonLibraries = createButton(entryLibraries,
Messages.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
+ addButtonLibraries = createButton(entryLibraries,
Messages.ImplementationsPreferencesPage_Add); //$NON-NLS-1$
addButtonLibraries.setEnabled(false);
- removeButtonLibraries = createButton(entryLibraries,
Messages.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
+ removeButtonLibraries = createButton(entryLibraries,
Messages.ImplementationsPreferencesPage_Remove); //$NON-NLS-1$
removeButtonLibraries.setEnabled(false);
librariesTab.setControl(entryLibraries);
@@ -176,23 +176,21 @@
listProject.setLayoutData(gridDataListProject);
- addButtonProject = createButton(entryProject,
Messages.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
+ addButtonProject = createButton(entryProject,
Messages.ImplementationsPreferencesPage_Add); //$NON-NLS-1$
addButtonProject.setEnabled(false);
- editButtonProject = createButton(entryProject,
Messages.getString("ImplementationsPreferencesPage.Edit")); //$NON-NLS-1$
+ editButtonProject = createButton(entryProject,
Messages.ImplementationsPreferencesPage_Edit); //$NON-NLS-1$
editButtonProject.setEnabled(false);
- upButtonProject = createButton(entryProject, Messages
- .getString("ImplementationsPreferencesPage.Up")); //$NON-NLS-1$
+ upButtonProject = createButton(entryProject,
Messages.ImplementationsPreferencesPage_Up); //$NON-NLS-1$
upButtonProject.setEnabled(false);
GridData d = (GridData)upButtonProject.getLayoutData();
d.verticalIndent = 5;
- downButtonProject = createButton(entryProject, Messages
- .getString("ImplementationsPreferencesPage.Down")); //$NON-NLS-1$
+ downButtonProject = createButton(entryProject,
Messages.ImplementationsPreferencesPage_Down); //$NON-NLS-1$
downButtonProject.setEnabled(false);
- removeButtonProject = createButton(entryProject,
Messages.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
+ removeButtonProject = createButton(entryProject,
Messages.ImplementationsPreferencesPage_Remove); //$NON-NLS-1$
removeButtonProject.setEnabled(false);
d = (GridData)removeButtonProject.getLayoutData();
d.verticalIndent = 5;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractPagesPreferencesPage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractPagesPreferencesPage.java 2009-04-07
12:46:38 UTC (rev 14551)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractPagesPreferencesPage.java 2009-04-07
12:46:52 UTC (rev 14552)
@@ -83,7 +83,7 @@
String[] pageLabels = new String[pages == null ? 0 : pages.length];
for (int i = 0; pageLabels != null && i < pageLabels.length; i++) {
pageLabels[i] = pages[i];
- if (pages[i].equals(defaultPage)) pageLabels[i] += " " +
Messages.getString("AbstractPagesPreferencePage.3");
+ if (pages[i].equals(defaultPage)) pageLabels[i] += " " +
Messages.AbstractPagesPreferencePage_3;
}
return pageLabels;
}
@@ -115,14 +115,14 @@
listPages.setLayoutData(gridDataList);
addButtonPages = new Button(entryPage, SWT.PUSH);
- addButtonPages.setText(Messages.getString("AbstractPagesPreferencePage.0"));
+ addButtonPages.setText(Messages.AbstractPagesPreferencePage_0);
GridData gridDataAddButton = new GridData(GridData.HORIZONTAL_ALIGN_END);
gridDataAddButton.widthHint = widthHint;
gridDataAddButton.heightHint=heightHint;
addButtonPages.setLayoutData(gridDataAddButton);
removeButton = new Button(entryPage, SWT.PUSH);
- removeButton.setText(Messages.getString("AbstractPagesPreferencePage.1"));
+ removeButton.setText(Messages.AbstractPagesPreferencePage_1);
GridData gridDataRemoveButton = new GridData(GridData.HORIZONTAL_ALIGN_END);
gridDataRemoveButton.widthHint = widthHint;
gridDataRemoveButton.heightHint=heightHint;
@@ -133,7 +133,7 @@
if (isSetDefaultAllowed()) {
setDefaultButton = new Button(entryPage, SWT.PUSH);
- setDefaultButton.setText(Messages.getString("AbstractPagesPreferencePage.2"));
+ setDefaultButton.setText(Messages.AbstractPagesPreferencePage_2);
GridData gridDataSetDefaultButton = new GridData(GridData.HORIZONTAL_ALIGN_END);
gridDataSetDefaultButton.widthHint = widthHint;
gridDataSetDefaultButton.heightHint=heightHint;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java 2009-04-07
12:46:38 UTC (rev 14551)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java 2009-04-07
12:46:52 UTC (rev 14552)
@@ -76,7 +76,7 @@
listLib.setLayoutData(gridDataList);
Button addButtonLib = new Button(entryLib, SWT.PUSH);
- addButtonLib.setText(Messages.getString("LibrarySetsPreferencePage.0"));
+ addButtonLib.setText(Messages.LibrarySetsPreferencePage_0);
//addButtonLib.setText("Add");
GridData gridDataAddButton = new GridData(GridData.BEGINNING);
gridDataAddButton.widthHint = widthHint;
@@ -84,7 +84,7 @@
addButtonLib.setLayoutData(gridDataAddButton);
removeButtonLib = new Button(entryLib, SWT.PUSH);
- removeButtonLib.setText(Messages.getString("LibrarySetsPreferencePage.1"));
+ removeButtonLib.setText(Messages.LibrarySetsPreferencePage_1);
GridData gridDataRemoveButton = new GridData(GridData.BEGINNING);
gridDataRemoveButton.widthHint = widthHint;
gridDataRemoveButton.heightHint = heightHint;
@@ -93,7 +93,7 @@
removeButtonLib.setEnabled(false);
Label jarsIncludedLabel = new Label(entryLib, SWT.NONE);
- jarsIncludedLabel.setText(Messages.getString("LibrarySetsPreferencePage.jarsIncluded"));
+ jarsIncludedLabel.setText(Messages.LibrarySetsPreferencePage_jarsIncluded);
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
jarsIncludedLabel.setLayoutData(data);
@@ -110,7 +110,7 @@
listLibJar.setLayoutData(gridDatalistLibJar);
addButtonLibJar = new Button(entryLib, SWT.PUSH);
- addButtonLibJar.setText(Messages.getString("LibrarySetsPreferencePage.0"));
+ addButtonLibJar.setText(Messages.LibrarySetsPreferencePage_0);
GridData gridDataAddButtonLibJar = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridDataAddButtonLibJar.widthHint = widthHint;
gridDataAddButtonLibJar.heightHint = heightHint;
@@ -118,7 +118,7 @@
addButtonLibJar.setEnabled(false);
removeButtonLibJar = new Button(entryLib, SWT.PUSH);
- removeButtonLibJar.setText(Messages.getString("LibrarySetsPreferencePage.1"));
+ removeButtonLibJar.setText(Messages.LibrarySetsPreferencePage_1);
GridData gridDataRemoveButtonLibJar = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridDataRemoveButtonLibJar.widthHint = widthHint;
gridDataRemoveButtonLibJar.heightHint = heightHint;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/Messages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/Messages.java 2009-04-07
12:46:38 UTC (rev 14551)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/Messages.java 2009-04-07
12:46:52 UTC (rev 14552)
@@ -1,22 +1,30 @@
package org.jboss.tools.jst.web.ui.internal.preferences;
-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 BUNDLE_NAME =
"org.jboss.tools.jst.web.ui.internal.preferences.preferences"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ public static String LibrarySetsPreferencePage_0;
+ public static String LibrarySetsPreferencePage_1;
+ public static String AbstractPagesPreferencePage_0;
+ public static String AbstractPagesPreferencePage_1;
+ public static String AbstractPagesPreferencePage_2;
+ public static String AbstractPagesPreferencePage_3;
+ public static String LibrarySetsPreferencePage_jarsIncluded;
+ public static String ImplementationsPreferencesPage_Add;
+ public static String ImplementationsPreferencesPage_Edit;
+ public static String ImplementationsPreferencesPage_Remove;
+ public static String ImplementationsPreferencesPage_Up;
+ public static String ImplementationsPreferencesPage_Down;
+ public static String ImplementationsPreferencesPage_Library_Sets;
+ public static String ImplementationsPreferencesPage_Project_Templates;
private Messages() {
}
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
+
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/preferences.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/preferences.properties 2009-04-07
12:46:38 UTC (rev 14551)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/preferences.properties 2009-04-07
12:46:52 UTC (rev 14552)
@@ -1,18 +1,15 @@
# PD (PREFERENCE DESCRIPTION)
-LIBRARY_SETS_PD=Here you can modify what libraries get included in the project file
systems for new Struts projects. You can modify this specifically for different versions
of the Servlet and Struts technologies that might be used with a project.
-LibrarySetsPreferencePage.0=Add
-LibrarySetsPreferencePage.1=Remove
-LibrarySetsPreferencePage.2=Add
-LibrarySetsPreferencePage.3=Remove
-AbstractPagesPreferencePage.0=Add
-AbstractPagesPreferencePage.1=Remove
-AbstractPagesPreferencePage.2=Set Default
-AbstractPagesPreferencePage.3= [default]
-LibrarySetsPreferencePage.jarsIncluded=Jars Included\:
-ImplementationsPreferencesPage.Add=Add
-ImplementationsPreferencesPage.Edit=Edit
-ImplementationsPreferencesPage.Remove=Remove
-ImplementationsPreferencesPage.Up=Up
-ImplementationsPreferencesPage.Down=Down
-ImplementationsPreferencesPage.Library.Sets=Library Sets
-ImplementationsPreferencesPage.Project.Templates=Project Templates
\ No newline at end of file
+LibrarySetsPreferencePage_0=Add
+LibrarySetsPreferencePage_1=Remove
+AbstractPagesPreferencePage_0=Add
+AbstractPagesPreferencePage_1=Remove
+AbstractPagesPreferencePage_2=Set Default
+AbstractPagesPreferencePage_3= [default]
+LibrarySetsPreferencePage_jarsIncluded=Jars Included\:
+ImplementationsPreferencesPage_Add=Add
+ImplementationsPreferencesPage_Edit=Edit
+ImplementationsPreferencesPage_Remove=Remove
+ImplementationsPreferencesPage_Up=Up
+ImplementationsPreferencesPage_Down=Down
+ImplementationsPreferencesPage_Library_Sets=Library Sets
+ImplementationsPreferencesPage_Project_Templates=Project Templates
\ No newline at end of file