Author: sflanigan
Date: 2009-04-07 20:21:47 -0400 (Tue, 07 Apr 2009)
New Revision: 14580
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/messages.properties
Log:
JBIDE-3557 Externalise English strings - converted some Eclipse message bundles to
new-style, replaced concatenated strings with NLS.bind() calls, tidied up some of the
English wording.
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -58,7 +58,7 @@
// TODO will modify soon
if(true){
Shell shell = context.getShell();
- MessageDialog.openWarning(shell,
Messages.getString("Java2XMLAnalyzer.Warning"),
Messages.getString("Java2XMLAnalyzer.CantGenerateConfig")); //$NON-NLS-1$
//$NON-NLS-2$
+ MessageDialog.openWarning(shell, Messages.Java2XMLAnalyzer_Warning,
Messages.Java2XMLAnalyzer_CantGenerateConfig);
return;
}
@@ -77,7 +77,7 @@
}
if (root == null)
- throw new
SmooksAnalyzerException(Messages.getString("Java2XMLAnalyzer.CantFindRoot"));
//$NON-NLS-1$
+ throw new SmooksAnalyzerException(Messages.Java2XMLAnalyzer_CantFindRoot);
Document document = DocumentHelper.createDocument();
Element rootElement = generateXMLContents(rootModel, root);
document.setRootElement(rootElement);
@@ -156,7 +156,7 @@
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType, Object sourceObject,
Object targetObject) {
- throw new
RuntimeException(Messages.getString("Java2XMLAnalyzer.DontSupportJ2X"));
//$NON-NLS-1$
+ throw new RuntimeException(Messages.Java2XMLAnalyzer_DontSupportJ2X);
}
protected String getTheJavaBeanString(JavaBeanModel currentModel) {
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Messages.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Messages.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -1,22 +1,21 @@
package org.jboss.tools.smooks.java2xml.analyzer;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
-public class Messages {
- private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.java2xml.analyzer.messages"; //$NON-NLS-1$
+public final class Messages extends NLS {
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.java2xml.analyzer.messages";//$NON-NLS-1$
private Messages() {
+ // Do not instantiate
}
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
+ public static String Java2XMLAnalyzer_CantFindRoot;
+ public static String Java2XMLAnalyzer_CantGenerateConfig;
+ public static String Java2XMLAnalyzer_DontSupportJ2X;
+ public static String Java2XMLAnalyzer_Warning;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
-}
+}
\ No newline at end of file
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/messages.properties 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/messages.properties 2009-04-08
00:21:47 UTC (rev 14580)
@@ -1,4 +1,4 @@
-Java2XMLAnalyzer.CantFindRoot=Can not find the root element
-Java2XMLAnalyzer.CantGenerateConfig=Java2XML is not supported currently.
-Java2XMLAnalyzer.DontSupportJ2X=The Smooks editor currently does not support parsing
Java2XML configuration files.
-Java2XMLAnalyzer.Warning=Warning
+Java2XMLAnalyzer_CantFindRoot=Can not find the root element
+Java2XMLAnalyzer_CantGenerateConfig=Java2XML is not supported currently.
+Java2XMLAnalyzer_DontSupportJ2X=The Smooks editor currently does not support parsing
Java2XML configuration files.
+Java2XMLAnalyzer_Warning=Warning
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -29,6 +29,7 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
import org.jboss.tools.smooks.analyzer.IMappingAnalyzer;
@@ -507,10 +508,8 @@
boolean connectAuto = MessageDialog
.openQuestion(
displayParent,
- Messages
- .getString("JavaBeanAnalyzer.ConnectionQuestion"), //$NON-NLS-1$
- Messages
- .getString("JavaBeanAnalyzer.ConnectRootQuestion")); //$NON-NLS-1$
+ Messages.JavaBeanAnalyzer_ConnectionQuestion, //$NON-NLS-1$
+ Messages.JavaBeanAnalyzer_ConnectRootQuestion); //$NON-NLS-1$
if (connectAuto) {
// connect root model
LineConnectionModel connectionModel = new LineConnectionModel();
@@ -968,8 +967,7 @@
model = new JavaBeanModel(null, rootClassName);
model.setRootClassModel(true);
model
- .setError(Messages
- .getString("JavaBeanAnalyzer.ClassNotExist") + rootClassName);
//$NON-NLS-1$
+ .setError(NLS.bind(Messages.JavaBeanAnalyzer_ClassNotExist, rootClassName));
model.setProperties(new ArrayList());
isError = true;
}
@@ -1236,7 +1234,7 @@
+ "\" from \"" + parentModel.getName() + "\"
model");
model = new JavaBeanModel(null, property);
parentModel.addProperty(model);
- model.setError(Messages.getString("JavaBeanAnalyzer.DontExist"));
//$NON-NLS-1$
+ model.setError(Messages.JavaBeanAnalyzer_DoesNotExist);
}
if (isSelectorIsUsed(selector))
return;
@@ -1368,8 +1366,7 @@
// something wrong
if (model == null) {
model = new JavaBeanModel(null, referenceSelector);
- model.setError(Messages
- .getString("JavaBeanAnalyzer.DontExist")); //$NON-NLS-1$
+ model.setError(Messages.JavaBeanAnalyzer_DoesNotExist); //$NON-NLS-1$
model.setProperties(new ArrayList());
setCollectionsInstanceClassName(model, resourceConfig);
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -53,7 +53,7 @@
@Override
public void execute() throws Exception {
SmooksConfigurationFileGenerateContext context = getContext();
- if(context == null) throw new
RuntimeException(Messages.getString("JavaModelConnectionResolveCommand.SmooksContextIsNull"));
//$NON-NLS-1$
+ if(context == null) throw new
RuntimeException(Messages.JavaModelConnectionResolveCommand_SmooksContextIsNull);
if(sourceModel != null && targetModel != null){
LineConnectionModel connectionModel = new LineConnectionModel();
connectionModel
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Messages.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Messages.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -1,22 +1,22 @@
package org.jboss.tools.smooks.javabean.analyzer;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
-public class Messages {
- private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.javabean.analyzer.messages"; //$NON-NLS-1$
+public final class Messages extends NLS {
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.javabean.analyzer.messages";//$NON-NLS-1$
private Messages() {
+ // Do not instantiate
}
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
+ public static String JavaBeanAnalyzer_ClassNotExist;
+ public static String JavaBeanAnalyzer_ConnectionQuestion;
+ public static String JavaBeanAnalyzer_ConnectRootQuestion;
+ public static String JavaBeanAnalyzer_DoesNotExist;
+ public static String JavaModelConnectionResolveCommand_SmooksContextIsNull;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
-}
+}
\ No newline at end of file
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/messages.properties 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/messages.properties 2009-04-08
00:21:47 UTC (rev 14580)
@@ -1,5 +1,5 @@
-JavaBeanAnalyzer.ClassNotExist=Can not find the class :
-JavaBeanAnalyzer.ConnectionQuestion=Root Node Connection
-JavaBeanAnalyzer.ConnectRootQuestion=To ensure a correct mapping, the root nodes should
be connected.\nDo you want to connect them now?
-JavaBeanAnalyzer.DontExist=Do not exist
-JavaModelConnectionResolveCommand.SmooksContextIsNull=Smooks generated context is NULL
+JavaBeanAnalyzer_ClassNotExist=Can not find the class : {0}
+JavaBeanAnalyzer_ConnectionQuestion=Root Node Connection
+JavaBeanAnalyzer_ConnectRootQuestion=To ensure a correct mapping, the root nodes should
be connected.\nDo you want to connect them now?
+JavaBeanAnalyzer_DoesNotExist=Does not exist
+JavaModelConnectionResolveCommand_SmooksContextIsNull=Smooks generated context is NULL
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -23,6 +23,7 @@
import java.util.List;
import java.util.Properties;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.smooks.analyzer.IValidatable;
import org.jboss.tools.smooks.javabean.uitils.JavaPropertyUtils;
import org.jboss.tools.smooks.ui.IXMLStructuredObject;
@@ -475,11 +476,14 @@
* @see java.lang.Object#toString()
*/
public String toString() {
- StringBuffer buffer = new StringBuffer(Messages
- .getString("JavaBeanModel.JavaBeanName") + name); //$NON-NLS-1$
+ StringBuilder buffer = new StringBuilder();
if (beanClass != null)
- buffer
- .append(Messages.getString("JavaBeanModel.ClassIs") +
this.beanClass.getName()); //$NON-NLS-1$
+ buffer.append(NLS.bind(
+ Messages.JavaBeanModel_JavaBeanDetails, name, this.beanClass.getName()));
+ else
+ buffer.append(NLS.bind(
+ Messages.JavaBeanModel_JavaBeanName, name));
+
if (this.properties != null) {
buffer.append("\n"); //$NON-NLS-1$
for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/Messages.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/Messages.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -1,22 +1,19 @@
package org.jboss.tools.smooks.javabean.model;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
-public class Messages {
- private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.javabean.model.messages"; //$NON-NLS-1$
+public final class Messages extends NLS {
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.javabean.model.messages";//$NON-NLS-1$
private Messages() {
+ // Do not instantiate
}
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
+ public static String JavaBeanModel_JavaBeanName;
+ public static String JavaBeanModel_JavaBeanDetails;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
-}
+}
\ No newline at end of file
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/messages.properties 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/messages.properties 2009-04-08
00:21:47 UTC (rev 14580)
@@ -1,2 +1,2 @@
-JavaBeanModel.ClassIs=;Class :
-JavaBeanModel.JavaBeanName=JavaBean Name :
+JavaBeanModel_JavaBeanName=JavaBean Name : {0}
+JavaBeanModel_JavaBeanDetails=JavaBean Name : {0};Class : {1}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -52,8 +52,8 @@
super("beansearchwizardpage"); //$NON-NLS-1$
this.project = selection;
setPageComplete(true);
- setTitle(Messages.getString("JavaBeanConfigWizardPage.JavaBeanSelectionDialogTitle"));
//$NON-NLS-1$
- setDescription(Messages.getString("JavaBeanConfigWizardPage.JavaBeanSelectionDialogDesc"));
//$NON-NLS-1$
+ setTitle(Messages.JavaBeanConfigWizardPage_JavaBeanSelectionDialogTitle);
+ setDescription(Messages.JavaBeanConfigWizardPage_JavaBeanSelectionDialogDesc);
}
protected void initilize() {
@@ -82,7 +82,7 @@
protected void updatePage() {
String error = null;
if (project == null) {
- error =
Messages.getString("JavaBeanConfigWizardPage.JavaBeanSelectionDialogErrorMsg");
//$NON-NLS-1$
+ error = Messages.JavaBeanConfigWizardPage_JavaBeanSelectionDialogErrorMsg;
}
setPageComplete(error == null);
this.setErrorMessage(error);
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -90,8 +90,7 @@
// ProgressMonitorDialog(parent.getShell());
if (this.runnableContext == null)
throw new Exception(
- Messages
- .getString("JavaBeanModelLoadComposite.InitRunnableContextException"));
//$NON-NLS-1$
+ Messages.JavaBeanModelLoadComposite_InitRunnableContextException);
}
if (project != null) {
@@ -134,8 +133,7 @@
com.setLayout(layout);
Label classLabel = new Label(com, SWT.NULL);
- classLabel.setText(Messages
- .getString("JavaBeanModelLoadComposite.ClassNameText")); //$NON-NLS-1$
+ classLabel.setText(Messages.JavaBeanModelLoadComposite_ClassNameText);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
classLabel.setLayoutData(gd);
@@ -272,10 +270,8 @@
scope,
IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES,
false);
- dialog.setMessage(Messages
- .getString("JavaBeanModelLoadComposite.SourceJavaBean")); //$NON-NLS-1$
- dialog.setTitle(Messages
- .getString("JavaBeanModelLoadComposite.SearchJavaType")); //$NON-NLS-1$
+ dialog.setMessage(Messages.JavaBeanModelLoadComposite_SourceJavaBean);
+ dialog.setTitle(Messages.JavaBeanModelLoadComposite_SearchJavaType);
if (dialog.open() == Window.OK) {
Object[] results = dialog.getResult();
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -87,8 +87,7 @@
.getWidgetFactory();
Section section = createRootSection(factory, parent);
- section.setText(Messages
- .getString("JavaBeanPropertiesSection.JavaBeanProperties")); //$NON-NLS-1$
+ section.setText(Messages.JavaBeanPropertiesSection_JavaBeanProperties);
Composite controlComposite = factory.createComposite(section);
section.setClient(controlComposite);
GridLayout gl = new GridLayout();
@@ -96,8 +95,7 @@
controlComposite.setLayout(gl);
- factory.createLabel(controlComposite, Messages
- .getString("JavaBeanPropertiesSection.TargetInstanceClass")).setVisible(false);
//$NON-NLS-1$
+ factory.createLabel(controlComposite,
Messages.JavaBeanPropertiesSection_TargetInstanceClass).setVisible(false);
instanceClassComposite = factory.createComposite(controlComposite);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -112,8 +110,7 @@
instanceClassText.setLayoutData(gd);
instanceClassComposite.setVisible(false);
- Button button1 = factory.createButton(instanceClassComposite, Messages
- .getString("JavaBeanPropertiesSection.Browse"), //$NON-NLS-1$
+ Button button1 = factory.createButton(instanceClassComposite,
Messages.JavaBeanPropertiesSection_Browse,
SWT.NONE);
button1.addSelectionListener(new SelectionAdapter() {
@@ -124,8 +121,7 @@
});
- factory.createLabel(controlComposite, Messages
- .getString("JavaBeanPropertiesSection.MappingType")); //$NON-NLS-1$
+ factory.createLabel(controlComposite, Messages.JavaBeanPropertiesSection_MappingType);
typeComposite = factory.createComposite(controlComposite);
gd = new GridData(GridData.FILL_HORIZONTAL);
typeComposite.setLayoutData(gd);
@@ -157,8 +153,7 @@
GridLayout buttonLayout = new GridLayout();
buttonLayout.numColumns = 2;
buttonCom.setLayout(buttonLayout);
- Button button3 = factory.createButton(buttonCom, Messages
- .getString("JavaBeanPropertiesSection.ClassBrowse"), //$NON-NLS-1$
+ Button button3 = factory.createButton(buttonCom,
Messages.JavaBeanPropertiesSection_ClassBrowse,
SWT.NONE);
button3.addSelectionListener(new SelectionAdapter() {
@@ -169,8 +164,7 @@
});
- Button button2 = factory.createButton(buttonCom, Messages
- .getString("JavaBeanPropertiesSection.CustomTypeBrowse"), //$NON-NLS-1$
+ Button button2 = factory.createButton(buttonCom,
Messages.JavaBeanPropertiesSection_CustomTypeBrowse,
SWT.NONE);
button2.addSelectionListener(new SelectionAdapter() {
@@ -229,8 +223,7 @@
MessageDialog
.openError(
this.getPart().getSite().getShell(),
- Messages
- .getString("JavaBeanPropertiesSection.ErrorMessageTitle"),
Messages.getString("JavaBeanPropertiesSection.TypeDialogErrorMessage"));
//$NON-NLS-1$ //$NON-NLS-2$
+ Messages.JavaBeanPropertiesSection_ErrorMessageTitle,
Messages.JavaBeanPropertiesSection_TypeDialogErrorMessage);
return;
}
// TODO should modify the scope to inculde the required projects
@@ -242,10 +235,8 @@
SmooksUIActivator.getDefault().getWorkbench()
.getActiveWorkbenchWindow(), scope,
IJavaElementSearchConstants.CONSIDER_CLASSES, false);
- dialog.setMessage(Messages
- .getString("JavaBeanPropertiesSection.JavaType")); //$NON-NLS-1$
- dialog.setTitle(Messages
- .getString("JavaBeanPropertiesSection.SearchJavaType")); //$NON-NLS-1$
+ dialog.setMessage(Messages.JavaBeanPropertiesSection_JavaType);
+ dialog.setTitle(Messages.JavaBeanPropertiesSection_SearchJavaType);
if (dialog.open() == Window.OK) {
Object[] results = dialog.getResult();
@@ -387,8 +378,7 @@
return null;
for (int i = 0; i < properties.length; i++) {
PropertyModel pro = (PropertyModel) properties[i];
- if (Messages
- .getString("JavaBeanPropertiesSection.TypePropertyName").equalsIgnoreCase(pro.getName()))
{ //$NON-NLS-1$
+ if
(Messages.JavaBeanPropertiesSection_TypePropertyName.equalsIgnoreCase(pro.getName())) {
Object value = pro.getValue();
if(value != null){
return value.toString();
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/Messages.java 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/Messages.java 2009-04-08
00:21:47 UTC (rev 14580)
@@ -1,22 +1,36 @@
package org.jboss.tools.smooks.javabean.ui;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
-public class Messages {
- private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.javabean.ui.messages"; //$NON-NLS-1$
+public final class Messages extends NLS {
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.javabean.ui.messages";//$NON-NLS-1$
private Messages() {
+ // Do not instantiate
}
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
+ public static String JavaBeanConfigWizardPage_JavaBeanSelectionDialogDesc;
+ public static String JavaBeanConfigWizardPage_JavaBeanSelectionDialogErrorMsg;
+ public static String JavaBeanConfigWizardPage_JavaBeanSelectionDialogTitle;
+// public static String JavaBeanModelLoadComposite_Browse;
+ public static String JavaBeanModelLoadComposite_ClassNameText;
+ public static String JavaBeanModelLoadComposite_InitRunnableContextException;
+ public static String JavaBeanModelLoadComposite_SearchJavaType;
+ public static String JavaBeanModelLoadComposite_SourceJavaBean;
+ public static String JavaBeanPropertiesSection_Browse;
+ public static String JavaBeanPropertiesSection_ClassBrowse;
+ public static String JavaBeanPropertiesSection_CustomTypeBrowse;
+ public static String JavaBeanPropertiesSection_ErrorMessageTitle;
+ public static String JavaBeanPropertiesSection_JavaBeanProperties;
+ public static String JavaBeanPropertiesSection_JavaType;
+ public static String JavaBeanPropertiesSection_MappingType;
+ public static String JavaBeanPropertiesSection_SearchJavaType;
+ public static String JavaBeanPropertiesSection_TargetInstanceClass;
+ public static String JavaBeanPropertiesSection_TypeDialogErrorMessage;
+ public static String JavaBeanPropertiesSection_TypePropertyName;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
-}
+}
\ No newline at end of file
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/messages.properties 2009-04-07
22:13:49 UTC (rev 14579)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/messages.properties 2009-04-08
00:21:47 UTC (rev 14580)
@@ -1,19 +1,23 @@
-JavaBeanConfigWizardPage.JavaBeanSelectionDialogDesc=Select the JavaBean class
-JavaBeanConfigWizardPage.JavaBeanSelectionDialogErrorMsg=Please select a Java project.
-JavaBeanConfigWizardPage.JavaBeanSelectionDialogTitle=JavaBean Class selection page
-JavaBeanModelLoadComposite.Browse=Browse...
-JavaBeanModelLoadComposite.ClassNameText=JavaBean Model List \:
-JavaBeanModelLoadComposite.InitRunnableContextException=Unable to init IRunnableContext
-JavaBeanModelLoadComposite.SearchJavaType=Search Java Type
-JavaBeanModelLoadComposite.SourceJavaBean=Source Java Bean:
-JavaBeanPropertiesSection.Browse=Browse
-JavaBeanPropertiesSection.ClassBrowse=Browse class
-JavaBeanPropertiesSection.CustomTypeBrowse=Browse custom type
-JavaBeanPropertiesSection.ErrorMessageTitle=Error
-JavaBeanPropertiesSection.JavaBeanProperties=JavaBean Properties
-JavaBeanPropertiesSection.JavaType=Java Type:
-JavaBeanPropertiesSection.MappingType=Mapping Type \:
-JavaBeanPropertiesSection.SearchJavaType=Search Java Type
-JavaBeanPropertiesSection.TargetInstanceClass=Target instance class name \:
-JavaBeanPropertiesSection.TypeDialogErrorMessage=Unable to open type selection dialog
-JavaBeanPropertiesSection.TypePropertyName=type
+JavaBeanConfigWizardPage_JavaBeanSelectionDialogDesc=Select the JavaBean class
+JavaBeanConfigWizardPage_JavaBeanSelectionDialogErrorMsg=Please select a Java project.
+JavaBeanConfigWizardPage_JavaBeanSelectionDialogTitle=JavaBean Class selection page
+# START NON-TRANSLATABLE
+#JavaBeanModelLoadComposite_Browse=Browse...
+# END NON-TRANSLATABLE
+JavaBeanModelLoadComposite_ClassNameText=JavaBean Model List \:
+JavaBeanModelLoadComposite_InitRunnableContextException=Unable to init IRunnableContext
+JavaBeanModelLoadComposite_SearchJavaType=Search Java Type
+JavaBeanModelLoadComposite_SourceJavaBean=Source Java Bean:
+JavaBeanPropertiesSection_Browse=Browse
+JavaBeanPropertiesSection_ClassBrowse=Browse class
+JavaBeanPropertiesSection_CustomTypeBrowse=Browse custom type
+JavaBeanPropertiesSection_ErrorMessageTitle=Error
+JavaBeanPropertiesSection_JavaBeanProperties=JavaBean Properties
+JavaBeanPropertiesSection_JavaType=Java Type:
+JavaBeanPropertiesSection_MappingType=Mapping Type \:
+JavaBeanPropertiesSection_SearchJavaType=Search Java Type
+JavaBeanPropertiesSection_TargetInstanceClass=Target instance class name \:
+JavaBeanPropertiesSection_TypeDialogErrorMessage=Unable to open type selection dialog
+# START NON-TRANSLATABLE
+JavaBeanPropertiesSection_TypePropertyName=type
+# END NON-TRANSLATABLE