# HG changeset patch # User Omair Majid # Date 1395853572 14400 # Node ID f425cf9c32e8c84ec6de4cf884ba2b1256251c0e # Parent a0c68ec373052bdd319d95c43c57a6582ba41e8c Externalize strings in project wizard diff -r a0c68ec37305 -r f425cf9c32e8 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/Messages.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/Messages.java Wed Mar 26 10:23:30 2014 -0400 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/Messages.java Wed Mar 26 13:06:12 2014 -0400 @@ -77,6 +77,16 @@ public static String PluginXmlProjectSelectionPage_projectMustBeWritable; public static String PluginXmlProjectSelectionPage_projectNameLabel; public static String PluginXmlProjectSelectionPage_title; + public static String ThermostatProjectCreationWizard_dialogTitle; + public static String ThermostatProjectCreationWizardPage_artifactIdLabel; + public static String ThermostatProjectCreationWizardPage_groupIdLabel; + public static String ThermostatProjectCreationWizardPage_packagePrefixLabel; + public static String ThermostatProjectCreationWizardPage_thermostatVersionErrorMessage; + public static String ThermostatProjectCreationWizardPage_thermostatVersionLabel; + public static String ThermostatProjectCreationWizardPage_versionErrorMessage; + public static String ThermostatProjectCreationWizardPage_versionLabel; + public static String ThermostatProjectCreationWizardPage_wizardDescription; + public static String ThermostatProjectCreationWizardPage_wizardTitle; static { // initialize resource bundle diff -r a0c68ec37305 -r f425cf9c32e8 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/messages.properties --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/messages.properties Wed Mar 26 10:23:30 2014 -0400 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/messages.properties Wed Mar 26 13:06:12 2014 -0400 @@ -69,3 +69,13 @@ PluginXmlProjectSelectionPage_projectMustBeWritable=Project must be writable PluginXmlProjectSelectionPage_projectNameLabel=&Project: PluginXmlProjectSelectionPage_title=Thermostat Wizard +ThermostatProjectCreationWizard_dialogTitle=Create New Thermostat Plugin +ThermostatProjectCreationWizardPage_artifactIdLabel=Artifact Id +ThermostatProjectCreationWizardPage_groupIdLabel=Group Id +ThermostatProjectCreationWizardPage_packagePrefixLabel=Package Prefix +ThermostatProjectCreationWizardPage_thermostatVersionErrorMessage=Thermostat Version must not be empty +ThermostatProjectCreationWizardPage_thermostatVersionLabel=Thermostat Version +ThermostatProjectCreationWizardPage_versionErrorMessage=Version must not be empty +ThermostatProjectCreationWizardPage_versionLabel=Version +ThermostatProjectCreationWizardPage_wizardDescription=This wizard creates a new Thermostat Plugin. +ThermostatProjectCreationWizardPage_wizardTitle=Thermostat projects Wizard diff -r a0c68ec37305 -r f425cf9c32e8 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/PluginXmlCreator.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/PluginXmlCreator.java Wed Mar 26 10:23:30 2014 -0400 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/PluginXmlCreator.java Wed Mar 26 13:06:12 2014 -0400 @@ -61,9 +61,9 @@ private InputStream getInitialContentStream() { String contents = "\n" //$NON-NLS-1$ - + "\n" //$NON-NLS-1$ $NON-NLS-2$ + + " xsi:schemaLocation=\"" + SchemaConstants.getSchemaLocation() + "\">\n" //$NON-NLS-1$ //$NON-NLS-2$ + ""; //$NON-NLS-1$ return new ByteArrayInputStream(contents.getBytes()); diff -r a0c68ec37305 -r f425cf9c32e8 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ThermostatProjectCreationWizard.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ThermostatProjectCreationWizard.java Wed Mar 26 10:23:30 2014 -0400 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ThermostatProjectCreationWizard.java Wed Mar 26 13:06:12 2014 -0400 @@ -10,6 +10,7 @@ import org.eclipse.ui.IWorkbench; import com.redhat.thermostat.tools.eclipse.plugin.Activator; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.wizards.ThermostatProjectCreationWizardPage.ProjectModel; public class ThermostatProjectCreationWizard extends Wizard implements INewWizard { @@ -18,7 +19,7 @@ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { - setWindowTitle("Create New Thermostat Plugin"); + setWindowTitle(Messages.ThermostatProjectCreationWizard_dialogTitle); setNeedsProgressMonitor(true); } @@ -53,7 +54,7 @@ try { creator.create(); } catch (IOException e) { - throw new CoreException(new Status(Status.ERROR, Activator.PLUGIN_ID, "Error creating project", e)); + throw new CoreException(new Status(Status.ERROR, Activator.PLUGIN_ID, "Error creating project", e)); //$NON-NLS-1$ } } diff -r a0c68ec37305 -r f425cf9c32e8 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ThermostatProjectCreationWizardPage.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ThermostatProjectCreationWizardPage.java Wed Mar 26 10:23:30 2014 -0400 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ThermostatProjectCreationWizardPage.java Wed Mar 26 13:06:12 2014 -0400 @@ -15,6 +15,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.Validators; public class ThermostatProjectCreationWizardPage extends WizardPage { @@ -23,9 +24,9 @@ private DataBindingContext context; public ThermostatProjectCreationWizardPage() { - super("wizardPage"); - setTitle("Thermostat Wizard"); - setDescription("This wizard creates a new Thermostat Plugin."); + super("wizardPage"); //$NON-NLS-1$ + setTitle(Messages.ThermostatProjectCreationWizardPage_wizardTitle); + setDescription(Messages.ThermostatProjectCreationWizardPage_wizardDescription); } @Override @@ -36,20 +37,20 @@ context = new DataBindingContext(); - createLabelAndInputField(container, "&Group Id:", "groupId", - new Validators.ValidIdRequired("Group Id")); + createLabelAndInputField(container, Messages.ThermostatProjectCreationWizardPage_groupIdLabel, "groupId", //$NON-NLS-1$ + new Validators.ValidIdRequired(Messages.ThermostatProjectCreationWizardPage_groupIdLabel)); - createLabelAndInputField(container, "&Artifact Id:", "artifactId", - new Validators.ValidIdRequired("Artifact Id")); + createLabelAndInputField(container, Messages.ThermostatProjectCreationWizardPage_artifactIdLabel, "artifactId", //$NON-NLS-1$ + new Validators.ValidIdRequired(Messages.ThermostatProjectCreationWizardPage_artifactIdLabel)); - createLabelAndInputField(container, "&Version:", "version", - new Validators.NonEmptyStringRequired("Version must not be empty")); + createLabelAndInputField(container, Messages.ThermostatProjectCreationWizardPage_versionLabel, "version", //$NON-NLS-1$ + new Validators.NonEmptyStringRequired(Messages.ThermostatProjectCreationWizardPage_versionErrorMessage)); - createLabelAndInputField(container, "&Package Prefix:", "packageName", + createLabelAndInputField(container, Messages.ThermostatProjectCreationWizardPage_packagePrefixLabel, "packageName", //$NON-NLS-1$ new Validators.PackageNameRequired()); - createLabelAndInputField(container, "&Thermostat Version:", "thermostatVersion", - new Validators.NonEmptyStringRequired("Thermostat Version must not be empty")); + createLabelAndInputField(container, Messages.ThermostatProjectCreationWizardPage_thermostatVersionLabel, "thermostatVersion", //$NON-NLS-1$ + new Validators.NonEmptyStringRequired(Messages.ThermostatProjectCreationWizardPage_thermostatVersionErrorMessage)); setControl(container);