Author: DartPeng
Date: 2009-11-29 08:31:29 -0500 (Sun, 29 Nov 2009)
New Revision: 18914
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/ValueDecodeParamSection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/model/AbstractSmooksGraphicalModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java
Log:
JBIDE-5155
Externalize strings in Smooks Config Editor Code
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -0,0 +1,18 @@
+package org.jboss.tools.smooks.configuration.wizards;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.configuration.wizards.messages"; //$NON-NLS-1$
+ public static String SmooksConfigurationFileNewWizard_0;
+ public static String SmooksConfigurationFileNewWizard_ErrorDialogTitle;
+ public static String SmooksConfigurationFileNewWizard_PageName;
+ public static String SmooksConfigurationFileNewWizard_VersionPageName;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-11-29
13:18:14 UTC (rev 18913)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -48,7 +48,7 @@
public SmooksConfigurationFileNewWizard() {
super();
setNeedsProgressMonitor(true);
- setDefaultPageImageDescriptor(SmooksConfigurationActivator.getImageDescriptor("icons/smooks-wiz.gif"));
+ setDefaultPageImageDescriptor(SmooksConfigurationActivator.getImageDescriptor(Messages.SmooksConfigurationFileNewWizard_0));
}
/**
@@ -56,11 +56,11 @@
*/
public void addPages() {
- containerSelectionPage = new SmooksFileContainerSelectionPage("Smooks
Configuration File",
+ containerSelectionPage = new
SmooksFileContainerSelectionPage(Messages.SmooksConfigurationFileNewWizard_PageName,
(IStructuredSelection) selection);
addPage(containerSelectionPage);
- versionSelectionPage = new SmooksVersionSelectionPage("Smooks Version
Selection");
+ versionSelectionPage = new
SmooksVersionSelectionPage(Messages.SmooksConfigurationFileNewWizard_VersionPageName);
addPage(versionSelectionPage);
}
@@ -89,7 +89,7 @@
return false;
} catch (InvocationTargetException e) {
Throwable realException = e.getTargetException();
- MessageDialog.openError(getShell(), "Error", realException.getMessage());
+ MessageDialog.openError(getShell(),
Messages.SmooksConfigurationFileNewWizard_ErrorDialogTitle, realException.getMessage());
return false;
}
return true;
@@ -104,7 +104,7 @@
private void doFinish(IPath containerPath, String fileName, IProgressMonitor monitor,
String version)
throws CoreException {
// create a sample file
- monitor.beginTask("Creating " + fileName, 2);
+ monitor.beginTask("Creating " + fileName, 2); //$NON-NLS-1$
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IResource resource = root.findMember(containerPath);
IContainer container = null;
@@ -112,7 +112,7 @@
container = (IContainer) resource;
}
if (container == null)
- throwCoreException("Container \"" + containerPath.toPortableString() +
"\" does not exist.");
+ throwCoreException("Container \"" + containerPath.toPortableString() +
"\" does not exist."); //$NON-NLS-1$ //$NON-NLS-2$
final IFile configFile = container.getFile(new Path(fileName));
// String extFileName = fileName + ".ext";
// final IFile extFile = container.getFile(new Path(extFileName));
@@ -131,7 +131,7 @@
SmooksConfigurationActivator.getDefault().log(e);
}
monitor.worked(1);
- monitor.setTaskName("Opening file with Smooks Editor.");
+ monitor.setTaskName("Opening file with Smooks Editor."); //$NON-NLS-1$
final String fversion = version;
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
@@ -166,14 +166,14 @@
public static InputStream createExtContentStream(String version, String inputType) {
String typeContents = null;
if (inputType != null) {
- typeContents = "inputType = \"" + inputType + "\"";
+ typeContents = "inputType = \"" + inputType + "\"";
//$NON-NLS-1$ //$NON-NLS-2$
}
- String contents = "";
+ String contents = ""; //$NON-NLS-1$
if (typeContents == null) {
- contents = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"; // + " <smooks-graphics-ext
platformVersion = \""
+ contents = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"; // + " <smooks-graphics-ext
platformVersion = \"" //$NON-NLS-1$
// + version + "\"
xmlns=\"http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.x...;
} else {
- contents = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n";// + " <smooks-graphics-ext
platformVersion = \""
+ contents = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n";// + " <smooks-graphics-ext
platformVersion = \"" //$NON-NLS-1$
// + version + "\" " + typeContents
// + "
xmlns=\"http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.x...;
}
@@ -186,7 +186,7 @@
*/
private InputStream openContentStream(String version) {
- String contents = "";
+ String contents = ""; //$NON-NLS-1$
if (SmooksConstants.VERSION_1_1.equals(version)) {
contents = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
+ "<smooks-resource-list
xmlns=\"http://www.milyn.org/xsd/smooks-1.1.xsd\">\n"// xmlns:graph =
\"http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd\">\n"//$NON-NLS-1$
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties 2009-11-29
13:31:29 UTC (rev 18914)
@@ -0,0 +1,4 @@
+SmooksConfigurationFileNewWizard_0=icons/smooks-wiz.gif
+SmooksConfigurationFileNewWizard_ErrorDialogTitle=Error
+SmooksConfigurationFileNewWizard_PageName=Smooks Configuration File
+SmooksConfigurationFileNewWizard_VersionPageName=Smooks Version Selection
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -0,0 +1,20 @@
+package org.jboss.tools.smooks.editor.propertySections;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.editor.propertySections.messages"; //$NON-NLS-1$
+ public static String ValueDecodeParamSection_DeleteButtonText;
+ public static String ValueDecodeParamSection_NewParamButtonText;
+ public static String ValueDecodeParamSection_NullText;
+ public static String ValueDecodeParamSection_ParamNameColumnText;
+ public static String ValueDecodeParamSection_ParamValueColumnText;
+ public static String ValueDecodeParamSection_SectionTitle;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/ValueDecodeParamSection.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/ValueDecodeParamSection.java 2009-11-29
13:18:14 UTC (rev 18913)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/ValueDecodeParamSection.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -82,7 +82,7 @@
TabbedPropertySheetWidgetFactory factory =
aTabbedPropertySheetPage.getWidgetFactory();
Section section = createRootSection(factory, parent);
- section.setText("Decode Parameters");
+ section.setText(Messages.ValueDecodeParamSection_SectionTitle);
controlComposite = factory.createComposite(section, SWT.NONE);
@@ -153,13 +153,13 @@
if (obj instanceof DecodeParamType) {
String name = ((DecodeParamType) obj).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
if (obj instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
obj).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
@@ -168,13 +168,13 @@
if (obj instanceof DecodeParamType) {
String value = ((DecodeParamType) obj).getValue();
if (value == null)
- value = "";
+ value = ""; //$NON-NLS-1$
return value;
}
if (obj instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
obj).getValue();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
@@ -188,14 +188,14 @@
TableColumn nameColumn = new TableColumn(paramterViewer.getTable(), SWT.NONE);
nameColumn.setWidth(150);
- nameColumn.setText("Name");
+ nameColumn.setText(Messages.ValueDecodeParamSection_ParamNameColumnText);
TableColumn valueColumn = new TableColumn(paramterViewer.getTable(), SWT.NONE);
valueColumn.setWidth(150);
- valueColumn.setText("Value");
+ valueColumn.setText(Messages.ValueDecodeParamSection_ParamValueColumnText);
paramterViewer.setCellEditors(new CellEditor[] { new
TextCellEditor(paramterViewer.getTable()),
new TextCellEditor(paramterViewer.getTable()) });
- paramterViewer.setColumnProperties(new String[] { "name", "value"
});
+ paramterViewer.setColumnProperties(new String[] { "name", "value"
}); //$NON-NLS-1$ //$NON-NLS-2$
paramterViewer.setCellModifier(new ICellModifier() {
@@ -206,7 +206,7 @@
if (element == null)
return;
EStructuralFeature feature = null;
- if (property.equals("name")) {
+ if (property.equals("name")) { //$NON-NLS-1$
if (element instanceof DecodeParamType) {
feature = JavabeanPackage.Literals.DECODE_PARAM_TYPE__NAME;
}
@@ -214,7 +214,7 @@
feature = Javabean12Package.Literals.DECODE_PARAM_TYPE__NAME;
}
}
- if (property.equals("value")) {
+ if (property.equals("value")) { //$NON-NLS-1$
if (element instanceof DecodeParamType) {
feature = JavabeanPackage.Literals.DECODE_PARAM_TYPE__VALUE;
}
@@ -233,31 +233,31 @@
public Object getValue(Object element, String property) {
element = AdapterFactoryEditingDomain.unwrap(element);
- if (property.equals("name")) {
+ if (property.equals("name")) { //$NON-NLS-1$
if (element instanceof DecodeParamType) {
String name = ((DecodeParamType) element).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
if (element instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
element).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
- if (property.equals("value")) {
+ if (property.equals("value")) { //$NON-NLS-1$
if (element instanceof DecodeParamType) {
String value = ((DecodeParamType) element).getValue();
if (value == null)
- value = "";
+ value = ""; //$NON-NLS-1$
return value;
}
if (element instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String value = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
element).getValue();
if (value == null)
- value = "";
+ value = ""; //$NON-NLS-1$
return value;
}
}
@@ -279,7 +279,7 @@
GridLayout gl2 = new GridLayout();
buttonComposite.setLayout(gl2);
- Button newRuleButton = factory.createButton(buttonComposite, "New Parameter",
SWT.NONE);
+ Button newRuleButton = factory.createButton(buttonComposite,
Messages.ValueDecodeParamSection_NewParamButtonText, SWT.NONE);
newRuleButton.addSelectionListener(new SelectionAdapter() {
/*
@@ -299,14 +299,14 @@
return;
if (element instanceof ValueType) {
model = JavabeanFactory.eINSTANCE.createDecodeParamType();
- ((DecodeParamType) model).setName("<null>");
- ((DecodeParamType) model).setValue("<null>");
+ ((DecodeParamType) model).setName(Messages.ValueDecodeParamSection_NullText);
+ ((DecodeParamType) model).setValue(Messages.ValueDecodeParamSection_NullText);
feature = JavabeanPackage.Literals.VALUE_TYPE__DECODE_PARAM;
}
if (element instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
model = Javabean12Factory.eINSTANCE.createDecodeParamType();
- ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
model).setName("<null>");
- ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
model).setValue("<null>");
+ ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
model).setName(Messages.ValueDecodeParamSection_NullText);
+ ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
model).setValue(Messages.ValueDecodeParamSection_NullText);
feature = Javabean12Package.Literals.VALUE_TYPE__DECODE_PARAM;
}
if (model != null && feature != null && element != null) {
@@ -320,7 +320,7 @@
}
});
- Button deleteRuleButton = factory.createButton(buttonComposite, "Delete",
SWT.NONE);
+ Button deleteRuleButton = factory.createButton(buttonComposite,
Messages.ValueDecodeParamSection_DeleteButtonText, SWT.NONE);
deleteRuleButton.addSelectionListener(new SelectionAdapter() {
/*
@@ -425,13 +425,13 @@
if (obj instanceof DecodeParamType) {
String name = ((DecodeParamType) obj).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
if (obj instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
obj).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
@@ -440,17 +440,17 @@
if (obj instanceof DecodeParamType) {
String value = ((DecodeParamType) obj).getValue();
if (value == null)
- value = "";
+ value = ""; //$NON-NLS-1$
return value;
}
if (obj instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType)
obj).getValue();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
- return "";
+ return ""; //$NON-NLS-1$
}
}
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties 2009-11-29
13:31:29 UTC (rev 18914)
@@ -0,0 +1,6 @@
+ValueDecodeParamSection_DeleteButtonText=Delete
+ValueDecodeParamSection_NewParamButtonText=New Parameter
+ValueDecodeParamSection_NullText=<null>
+ValueDecodeParamSection_ParamNameColumnText=Name
+ValueDecodeParamSection_ParamValueColumnText=Value
+ValueDecodeParamSection_SectionTitle=Decode Parameters
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/model/AbstractSmooksGraphicalModel.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/model/AbstractSmooksGraphicalModel.java 2009-11-29
13:18:14 UTC (rev 18913)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/model/AbstractSmooksGraphicalModel.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -33,29 +33,29 @@
private List<String> messages = null;
- public static final String PRO_ADD_CHILD = "_pro_add_child";
+ public static final String PRO_ADD_CHILD = "_pro_add_child"; //$NON-NLS-1$
- public static final String PRO_MOVE_CHILD = "_pro_move_child";
+ public static final String PRO_MOVE_CHILD = "_pro_move_child"; //$NON-NLS-1$
- public static final String PRO_REMOVE_CHILD = "_pro_remove_child";
+ public static final String PRO_REMOVE_CHILD = "_pro_remove_child";
//$NON-NLS-1$
- public static final String PRO_ADD_SOURCE_CONNECTION =
"_pro_add_source_connected";
+ public static final String PRO_ADD_SOURCE_CONNECTION =
"_pro_add_source_connected"; //$NON-NLS-1$
- public static final String PRO_SEVERITY_CHANGED = "_pro_severity_changed";
+ public static final String PRO_SEVERITY_CHANGED = "_pro_severity_changed";
//$NON-NLS-1$
- public static final String PRO_ADD_TARGET_CONNECTION =
"_pro_add_target_connected";
+ public static final String PRO_ADD_TARGET_CONNECTION =
"_pro_add_target_connected"; //$NON-NLS-1$
- public static final String PRO_REMOVE_SOURCE_CONNECTION =
"_pro_remove_source_connected";
+ public static final String PRO_REMOVE_SOURCE_CONNECTION =
"_pro_remove_source_connected"; //$NON-NLS-1$
- public static final String PRO_REMOVE_TARGET_CONNECTION =
"_pro_remove_target_connected";
+ public static final String PRO_REMOVE_TARGET_CONNECTION =
"_pro_remove_target_connected"; //$NON-NLS-1$
- public static final String PRO_TEXT_CHANGED = "_pro_text_changed";
+ public static final String PRO_TEXT_CHANGED = "_pro_text_changed";
//$NON-NLS-1$
- public static final String PRO_FORCE_VISUAL_CHANGED =
"_pro_force_text_changed";
+ public static final String PRO_FORCE_VISUAL_CHANGED =
"_pro_force_text_changed"; //$NON-NLS-1$
- public static final String PRO_FORCE_CHIDLREN_CHANGED =
"_pro_force_children_changed";
+ public static final String PRO_FORCE_CHIDLREN_CHANGED =
"_pro_force_children_changed"; //$NON-NLS-1$
- public static final String PRO_FORCE_CONNECTION_CHANGED =
"_pro_force_connection_changed";
+ public static final String PRO_FORCE_CONNECTION_CHANGED =
"_pro_force_connection_changed"; //$NON-NLS-1$
protected Object data = null;
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java 2009-11-29
13:18:14 UTC (rev 18913)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -53,8 +53,8 @@
public FreemarkerCSVCreationWizardPage(String pageName) {
super(pageName);
- this.setTitle("CSV Template Configuration");
- this.setDescription("Configurate CSV Template");
+ this.setTitle(Messages.FreemarkerCSVCreationWizardPage_WizardTitle);
+ this.setDescription(Messages.FreemarkerCSVCreationWizardPage_WizardDes);
}
/**
@@ -96,14 +96,14 @@
mainComposite.setLayout(layout);
Label seperatorLabel = new Label(mainComposite, SWT.NONE);
- seperatorLabel.setText("Seperator Character : ");
+ seperatorLabel.setText(Messages.FreemarkerCSVCreationWizardPage_SeperatorCharLabel);
seperatorText = new Text(mainComposite, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
seperatorText.setLayoutData(gd);
seperatorText.setTextLimit(1);
Label quoteLabel = new Label(mainComposite, SWT.NONE);
- quoteLabel.setText("Quote Character : ");
+ quoteLabel.setText(Messages.FreemarkerCSVCreationWizardPage_QuoteCharLabel);
quoteText = new Text(mainComposite, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
quoteText.setLayoutData(gd);
@@ -115,7 +115,7 @@
gd.heightHint = 200;
gd.horizontalSpan = 2;
Group fieldsComposite = new Group(mainComposite, SWT.NONE);
- fieldsComposite.setText("Fields");
+ fieldsComposite.setText(Messages.FreemarkerCSVCreationWizardPage_FieldsGroupText);
fieldsComposite.setLayoutData(gd);
GridLayout gl = new GridLayout();
gl.numColumns = 2;
@@ -137,7 +137,7 @@
fieldsViewer.setCellEditors(new CellEditor[] { fieldCellEditor });
- fieldsViewer.setColumnProperties(new String[] { "field" });
+ fieldsViewer.setColumnProperties(new String[] { "field" }); //$NON-NLS-1$
fieldsViewer.setCellModifier(new ICellModifier() {
@@ -149,7 +149,7 @@
if (el == null)
return;
if (el instanceof FieldText && value instanceof String) {
- if (property.equals("field")) {
+ if (property.equals("field")) { //$NON-NLS-1$
if (value.toString().equals(((FieldText) el).getText())) {
return;
}
@@ -162,7 +162,7 @@
public Object getValue(Object element, String property) {
if (element instanceof FieldText) {
- if (property.equals("field")) {
+ if (property.equals("field")) { //$NON-NLS-1$
return ((FieldText) element).getText();
}
}
@@ -172,7 +172,7 @@
public boolean canModify(Object element, String property) {
if (element instanceof FieldText) {
- if (property.equals("field")) {
+ if (property.equals("field")) { //$NON-NLS-1$
return true;
}
}
@@ -180,7 +180,7 @@
}
});
if (fields == null) {
- fields = "";
+ fields = ""; //$NON-NLS-1$
}
fillFieldsList(fields);
fieldsViewer.setInput(fieldsList);
@@ -197,18 +197,18 @@
final Button addButton = new Button(buttonComposite, SWT.NONE);
addButton.setLayoutData(gd);
- addButton.setText("Add Field");
+ addButton.setText(Messages.FreemarkerCSVCreationWizardPage_AddFieldButtonText);
final Button removeButton = new Button(buttonComposite, SWT.NONE);
removeButton.setLayoutData(gd);
- removeButton.setText("Remove");
+ removeButton.setText(Messages.FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel);
addButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
addButton.setEnabled(false);
try {
- FieldText field = new FieldText("field");
+ FieldText field = new FieldText("field"); //$NON-NLS-1$
fieldsList.add(field);
fieldsViewer.refresh();
updatePage();
@@ -241,8 +241,8 @@
this.setControl(mainComposite);
- seperatorText.setText(",");
- quoteText.setText("\"");
+ seperatorText.setText(","); //$NON-NLS-1$
+ quoteText.setText("\""); //$NON-NLS-1$
seperatorText.addModifyListener(new ModifyListener() {
@@ -265,8 +265,8 @@
return;
String input = fieldsString.toString();
input = input.trim();
- if (input.indexOf(",") != -1) {
- String[] fields = input.split(",");
+ if (input.indexOf(",") != -1) { //$NON-NLS-1$
+ String[] fields = input.split(","); //$NON-NLS-1$
if (fields != null && fields.length > 0) {
for (int i = 0; i < fields.length; i++) {
String field = fields[i];
@@ -286,20 +286,20 @@
String seperator = seperatorText.getText();
String quote = quoteText.getText();
if (seperator == null || seperator.length() == 0) {
- error = "Seperator can't be null";
+ error = Messages.FreemarkerCSVCreationWizardPage_SeperatorEmptyErrorMessage;
}
if (quote == null || quote.length() == 0) {
- error = "Quote can't be null";
+ error = Messages.FreemarkerCSVCreationWizardPage_QuoteEmptyErrorMessage;
}
if (seperator != null && seperator.length() > 1) {
- error = "Seperator must be only one character";
+ error = "Seperator must be only one character"; //$NON-NLS-1$
}
if (quote != null && quote.length() > 1) {
- error = "Quote must be only one character";
+ error = "Quote must be only one character"; //$NON-NLS-1$
}
if (fieldsList.isEmpty()) {
- error = "Fields can't be null";
+ error = Messages.FreemarkerCSVCreationWizardPage_FieldEmptyErrorMessage;
}
this.setErrorMessage(error);
this.setPageComplete(error == null);
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -0,0 +1,24 @@
+package org.jboss.tools.smooks.graphical.wizard.freemarker;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.graphical.wizard.freemarker.messages"; //$NON-NLS-1$
+ public static String FreemarkerCSVCreationWizardPage_AddFieldButtonText;
+ public static String FreemarkerCSVCreationWizardPage_FieldEmptyErrorMessage;
+ public static String FreemarkerCSVCreationWizardPage_FieldsGroupText;
+ public static String FreemarkerCSVCreationWizardPage_QuoteCharLabel;
+ public static String FreemarkerCSVCreationWizardPage_QuoteEmptyErrorMessage;
+ public static String FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel;
+ public static String FreemarkerCSVCreationWizardPage_SeperatorCharLabel;
+ public static String FreemarkerCSVCreationWizardPage_SeperatorEmptyErrorMessage;
+ public static String FreemarkerCSVCreationWizardPage_WizardDes;
+ public static String FreemarkerCSVCreationWizardPage_WizardTitle;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties 2009-11-29
13:31:29 UTC (rev 18914)
@@ -0,0 +1,10 @@
+FreemarkerCSVCreationWizardPage_AddFieldButtonText=Add Field
+FreemarkerCSVCreationWizardPage_FieldEmptyErrorMessage=Fields can't be null
+FreemarkerCSVCreationWizardPage_FieldsGroupText=Fields
+FreemarkerCSVCreationWizardPage_QuoteCharLabel=Quote Character :
+FreemarkerCSVCreationWizardPage_QuoteEmptyErrorMessage=Quote can't be null
+FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel=Remove
+FreemarkerCSVCreationWizardPage_SeperatorCharLabel=Seperator Character :
+FreemarkerCSVCreationWizardPage_SeperatorEmptyErrorMessage=Seperator can't be null
+FreemarkerCSVCreationWizardPage_WizardDes=Configurate CSV Template
+FreemarkerCSVCreationWizardPage_WizardTitle=CSV Template Configuration
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java 2009-11-29
13:18:14 UTC (rev 18913)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -81,16 +81,16 @@
super(pageName, title, titleImage);
this.project = project;
this.exsitingBeanIDs = exsitingBeanIDs;
- this.setTitle("Java Bean Creation");
- this.setDescription("Create a Java Bean model");
+ this.setTitle(Messages.JavaBeanCreationWizardPage_WizardTitle);
+ this.setDescription(Messages.JavaBeanCreationWizardPage_WizardDes);
}
public JavaBeanCreationWizardPage(String pageName, IJavaProject project,
List<String> exsitingBeanIDs) {
super(pageName);
this.project = project;
this.exsitingBeanIDs = exsitingBeanIDs;
- this.setTitle("Java Bean Creation");
- this.setDescription("Create a Java Bean model");
+ this.setTitle(Messages.JavaBeanCreationWizardPage_WizardTitle);
+ this.setDescription(Messages.JavaBeanCreationWizardPage_WizardDes);
}
/**
@@ -248,7 +248,7 @@
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
Label beanTypeLabel = new Label(mainComposite, SWT.NONE);
- beanTypeLabel.setText("Bean Type :");
+ beanTypeLabel.setText(Messages.JavaBeanCreationWizardPage_BeanTypeLabel);
Composite composite = new Composite(mainComposite, SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -262,13 +262,13 @@
composite.setLayout(gl);
arrayButton = new Button(composite, SWT.CHECK);
- arrayButton.setText("Array");
+ arrayButton.setText(Messages.JavaBeanCreationWizardPage_ArrayButtonText);
final Button collectionButton = new Button(composite, SWT.CHECK);
- collectionButton.setText("Collection");
+ collectionButton.setText(Messages.JavaBeanCreationWizardPage_CollectionButtonLabel);
Label beanClassLabel = new Label(mainComposite, SWT.NONE);
- beanClassLabel.setText("Collection Class :");
+ beanClassLabel.setText(Messages.JavaBeanCreationWizardPage_CollectionClassLabel);
Composite beanClassComposite = new Composite(mainComposite, SWT.NONE);
GridLayout gl1 = new GridLayout();
@@ -300,7 +300,7 @@
beanClassComposite.setLayoutData(gd);
collectionClassBrowseButton = new Button(beanClassComposite, SWT.NONE);
- collectionClassBrowseButton.setText("Browse...");
+ collectionClassBrowseButton.setText(Messages.JavaBeanCreationWizardPage_BrowseButtonLabel);
collectionClassBrowseButton.addSelectionListener(new SelectionAdapter() {
/*
@@ -368,7 +368,7 @@
colllectionClassText.setEnabled(false);
}
updateWizardPageStatus();
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
}
});
@@ -378,8 +378,8 @@
}
protected void refreshJavaBeanModel() {
- if (beanClass == null || "".equals(beanClass.trim())) {
- viewer.setInput("");
+ if (beanClass == null || "".equals(beanClass.trim())) { //$NON-NLS-1$
+ viewer.setInput(""); //$NON-NLS-1$
} else {
try {
ProjectClassLoader loader = new ProjectClassLoader(project);
@@ -392,7 +392,7 @@
javaBeanModel = JavaBeanModelFactory.getJavaBeanModelWithLazyLoad(clazz);
javaBeanModel.setComponentClass(cclazz);
} else {
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
}
} else {
Class<?> clazz = loader.loadClass(beanClass);
@@ -409,19 +409,19 @@
viewer.setInput(javaBeanModel.getChildren());
viewer.setCheckedElements(javaBeanModel.getChildren().toArray());
} else {
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
}
} catch (JavaModelException e1) {
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
} catch (ClassNotFoundException e1) {
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
}
}
}
private void createBeanClassControls(Composite mainComposite) {
Label beanClassLabel = new Label(mainComposite, SWT.NONE);
- beanClassLabel.setText("Bean Class :");
+ beanClassLabel.setText(Messages.JavaBeanCreationWizardPage_BeanClassLabel);
Composite beanClassComposite = new Composite(mainComposite, SWT.NONE);
GridLayout gl = new GridLayout();
@@ -453,7 +453,7 @@
} else {
collectionClassBrowseButton.setEnabled(false);
colllectionClassText.setEnabled(false);
- colllectionClassText.setText("");
+ colllectionClassText.setText(""); //$NON-NLS-1$
}
refreshJavaBeanModel();
updateWizardPageStatus();
@@ -463,7 +463,7 @@
beanClassComposite.setLayoutData(gd);
Button javaTypeBrowseButton = new Button(beanClassComposite, SWT.NONE);
- javaTypeBrowseButton.setText("Browse...");
+ javaTypeBrowseButton.setText(Messages.JavaBeanCreationWizardPage_BrowseButtonLabel);
javaTypeBrowseButton.addSelectionListener(new SelectionAdapter() {
/*
@@ -499,7 +499,7 @@
private void createBeanIDControls(Composite mainComposite) {
Label beanIDLabel = new Label(mainComposite, SWT.NONE);
- beanIDLabel.setText("Bean ID :");
+ beanIDLabel.setText(Messages.JavaBeanCreationWizardPage_BeanIDLabel);
Text beanIDText = new Text(mainComposite, SWT.BORDER);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -517,21 +517,21 @@
protected void updateWizardPageStatus() {
String error = null;
- if (beanID == null || "".equals(beanID.trim())) {
- error = "Bean ID is empty";
+ if (beanID == null || "".equals(beanID.trim())) { //$NON-NLS-1$
+ error = Messages.JavaBeanCreationWizardPage_BeanIDEmptyErrorMessage;
} else {
if (exsitingBeanIDs != null) {
beanID = beanID.trim();
for (Iterator<?> iterator = exsitingBeanIDs.iterator(); iterator.hasNext();) {
String id = (String) iterator.next();
if (id.equals(beanID)) {
- error = "Bean ID '" + beanID + "' is duplicate";
+ error = Messages.JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage1 + beanID +
Messages.JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage2;
}
}
}
}
- if (beanClass == null || "".equals(beanClass.trim())) {
- error = "Bean Class is empty";
+ if (beanClass == null || "".equals(beanClass.trim())) { //$NON-NLS-1$
+ error = Messages.JavaBeanCreationWizardPage_BeanClassEmptyErrorMessage;
} else {
try {
beanClass = beanClass.trim();
@@ -540,13 +540,13 @@
} catch (JavaModelException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
- error = "Can't find the class \"" + beanClass +
"\"";
+ error = Messages.JavaBeanCreationWizardPage_CatFindClassErrorMessage1 + beanClass +
Messages.JavaBeanCreationWizardPage_27;
}
}
if (isCollection) {
- if (collectionClass == null || "".equals(collectionClass.trim())) {
- error = "Colletion component class is empty";
+ if (collectionClass == null || "".equals(collectionClass.trim())) {
//$NON-NLS-1$
+ error =
Messages.JavaBeanCreationWizardPage_CollectionComponentClassEmptyErrorMessage;
} else {
try {
ProjectClassLoader loader = new ProjectClassLoader(project);
@@ -554,7 +554,7 @@
} catch (JavaModelException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
- error = "Can't find the class \"" + beanClass;
+ error = Messages.JavaBeanCreationWizardPage_CatFindClassErrorMessage1 + beanClass;
}
}
}
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java 2009-11-29
13:31:29 UTC (rev 18914)
@@ -0,0 +1,30 @@
+package org.jboss.tools.smooks.graphical.wizards;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.smooks.graphical.wizards.messages"; //$NON-NLS-1$
+ public static String JavaBeanCreationWizardPage_27;
+ public static String JavaBeanCreationWizardPage_ArrayButtonText;
+ public static String JavaBeanCreationWizardPage_BeanClassEmptyErrorMessage;
+ public static String JavaBeanCreationWizardPage_BeanClassLabel;
+ public static String JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage1;
+ public static String JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage2;
+ public static String JavaBeanCreationWizardPage_BeanIDEmptyErrorMessage;
+ public static String JavaBeanCreationWizardPage_BeanIDLabel;
+ public static String JavaBeanCreationWizardPage_BeanTypeLabel;
+ public static String JavaBeanCreationWizardPage_BrowseButtonLabel;
+ public static String JavaBeanCreationWizardPage_CatFindClassErrorMessage1;
+ public static String JavaBeanCreationWizardPage_CollectionButtonLabel;
+ public static String JavaBeanCreationWizardPage_CollectionClassLabel;
+ public static String
JavaBeanCreationWizardPage_CollectionComponentClassEmptyErrorMessage;
+ public static String JavaBeanCreationWizardPage_WizardDes;
+ public static String JavaBeanCreationWizardPage_WizardTitle;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties 2009-11-29
13:31:29 UTC (rev 18914)
@@ -0,0 +1,16 @@
+JavaBeanCreationWizardPage_27="
+JavaBeanCreationWizardPage_ArrayButtonText=Array
+JavaBeanCreationWizardPage_BeanClassEmptyErrorMessage=Bean Class is empty
+JavaBeanCreationWizardPage_BeanClassLabel=Bean Class :
+JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage1=Bean ID '
+JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage2=' is duplicate
+JavaBeanCreationWizardPage_BeanIDEmptyErrorMessage=Bean ID is empty
+JavaBeanCreationWizardPage_BeanIDLabel=Bean ID :
+JavaBeanCreationWizardPage_BeanTypeLabel=Bean Type :
+JavaBeanCreationWizardPage_BrowseButtonLabel=Browse...
+JavaBeanCreationWizardPage_CatFindClassErrorMessage1=Can't find the class "
+JavaBeanCreationWizardPage_CollectionButtonLabel=Collection
+JavaBeanCreationWizardPage_CollectionClassLabel=Collection Class :
+JavaBeanCreationWizardPage_CollectionComponentClassEmptyErrorMessage=Colletion component
class is empty
+JavaBeanCreationWizardPage_WizardDes=Create a Java Bean model
+JavaBeanCreationWizardPage_WizardTitle=Java Bean Creation
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain