# HG changeset patch # User Omair Majid # Date 1390351864 18000 # Node ID 8f2dd0dbdb87f9f1e3bccdf1ec7051ba2aa2075f # Parent 67d58773e96ed8b4653d0502f68306d9164fc3e7 Externalize strings diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/BundleInformationExtractor.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/BundleInformationExtractor.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/BundleInformationExtractor.java Tue Jan 21 19:51:04 2014 -0500 @@ -14,8 +14,8 @@ try (JarInputStream in = new JarInputStream(new FileInputStream(path))) { Attributes attr = in.getManifest().getMainAttributes(); - String name = attr.getValue("Bundle-SymbolicName"); - String version = attr.getValue("Bundle-Version"); + String name = attr.getValue("Bundle-SymbolicName"); //$NON-NLS-1$ + String version = attr.getValue("Bundle-Version"); //$NON-NLS-1$ return new Bundle(name, version); } diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/Messages.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/Messages.java Tue Jan 21 19:51:04 2014 -0500 @@ -0,0 +1,71 @@ +package com.redhat.thermostat.tools.eclipse.plugin; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + + private static final String BUNDLE_NAME = "com.redhat.thermostat.tools.eclipse.plugin.messages"; //$NON-NLS-1$ + + public static String BaseMasterDetailsBlock_add; + public static String BaseMasterDetailsBlock_remove; + public static String CommandEditPage_addButton; + public static String CommandEditPage_basicsSectionTitle; + public static String CommandEditPage_bundlesToLoadsectionTitle; + public static String CommandEditPage_cliCheckTitle; + public static String CommandEditPage_commandDetailsSectionTitle; + public static String CommandEditPage_descriptionLabel; + public static String CommandEditPage_environmentsTitle; + public static String CommandEditPage_nameLabel; + public static String CommandEditPage_removeButton; + public static String CommandEditPage_shellCheckTitle; + public static String CommandEditPage_usageLabel; + public static String CommandsMasterDetailsBlock_title; + public static String CommandsPage_title; + public static String ExtensionEditPage_addBundle; + public static String ExtensionEditPage_bundlesSectionTitle; + public static String ExtensionEditPage_extensionSectionTitle; + public static String ExtensionEditPage_removeBundle; + public static String ExtensionsMasterDetailsBlock_title; + public static String ExtensionsPage_title; + public static String NewBundleDialog_findOnDisk; + public static String NewBundleDialog_fromJarSectionTitle; + public static String NewBundleDialog_manualSectionTitle; + public static String NewBundleDialog_message; + public static String NewBundleDialog_pathLabel; + public static String NewBundleDialog_symbolicNameLabel; + public static String NewBundleDialog_title; + public static String NewBundleDialog_versionLabel; + public static String NewNameDialog_message; + public static String NewNameDialog_nameLabel; + public static String NewNameDialog_title; + public static String OverviewPage_bundlesAndExtensionsOverviewForm; + public static String OverviewPage_commandsAndExtensionSectionTitle; + public static String OverviewPage_formTitle; + public static String OverviewPage_generalInformationSectionTitle; + public static String OverviewPage_thermostatOverviewForm; + public static String OverviewPage_title; + public static String PluginModelReaderWriter_errorLoadingModel; + public static String PluginModelReaderWriter_errorSavingFile; + public static String PluginXmlCreationWizard_containerDoesNotExist; + public static String PluginXmlCreationWizard_creatingFile; + public static String PluginXmlCreationWizard_error; + public static String PluginXmlCreationWizard_openingFileForEditing; + public static String PluginXmlCreationWizard_windowTitle; + public static String PluginXmlProjectSelectionPage_selectFileContainer; + public static String PluginXmlProjectSelectionPage_browse; + public static String PluginXmlProjectSelectionPage_description; + public static String PluginXmlProjectSelectionPage_fileContainerMustBeSpecified; + public static String PluginXmlProjectSelectionPage_fileContainerMustExist; + public static String PluginXmlProjectSelectionPage_projectMustBeWritable; + public static String PluginXmlProjectSelectionPage_projectNameLabel; + public static String PluginXmlProjectSelectionPage_title; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + // this is a utility class not meant to be initialized + } +} diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/BaseMasterDetailsBlock.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/BaseMasterDetailsBlock.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/BaseMasterDetailsBlock.java Tue Jan 21 19:51:04 2014 -0500 @@ -25,6 +25,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.ui.forms.widgets.Section; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.model.Plugin; public abstract class BaseMasterDetailsBlock extends MasterDetailsBlock { @@ -82,7 +83,7 @@ buttons.setLayout(new GridLayout(1, false)); GridData buttonLayoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); - Button add = toolkit.createButton(buttons, "Add", SWT.NONE); + Button add = toolkit.createButton(buttons, Messages.BaseMasterDetailsBlock_add, SWT.NONE); add.setLayoutData(buttonLayoutData); add.addSelectionListener(new SelectionAdapter() { @Override @@ -95,7 +96,7 @@ }); - Button remove = toolkit.createButton(buttons, "Remove", SWT.NONE); + Button remove = toolkit.createButton(buttons, Messages.BaseMasterDetailsBlock_remove, SWT.NONE); remove.setLayoutData(buttonLayoutData); remove.addSelectionListener(new SelectionAdapter() { @Override diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandEditPage.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandEditPage.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandEditPage.java Tue Jan 21 19:51:04 2014 -0500 @@ -31,6 +31,7 @@ import org.eclipse.ui.forms.widgets.TableWrapData; import org.eclipse.ui.forms.widgets.TableWrapLayout; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.model.Bundle; import com.redhat.thermostat.tools.eclipse.plugin.model.Command; import com.redhat.thermostat.tools.eclipse.plugin.model.Environments; @@ -150,7 +151,7 @@ section.setLayoutData(tableData); - section.setText("Command details"); + section.setText(Messages.CommandEditPage_commandDetailsSectionTitle); Composite sectionContents = toolkit.createComposite(section); section.setClient(sectionContents); @@ -165,30 +166,30 @@ private void createBasicSection(Composite sectionContents) { Section basics = toolkit.createSection(sectionContents, Section.TITLE_BAR); basics.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - basics.setText("Basics"); + basics.setText(Messages.CommandEditPage_basicsSectionTitle); Composite basicContents = toolkit.createComposite(basics); basics.setClient(basicContents); basicContents.setLayout(new GridLayout(2, false)); - toolkit.createLabel(basicContents, "Name:"); - commandName = toolkit.createText(basicContents, ""); + toolkit.createLabel(basicContents, Messages.CommandEditPage_nameLabel); + commandName = toolkit.createText(basicContents, ""); //$NON-NLS-1$ commandName.setEditable(false); commandName.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); - toolkit.createLabel(basicContents, "Usage:"); - commandUsage = toolkit.createText(basicContents, ""); + toolkit.createLabel(basicContents, Messages.CommandEditPage_usageLabel); + commandUsage = toolkit.createText(basicContents, ""); //$NON-NLS-1$ commandUsage.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); - toolkit.createLabel(basicContents, "Description:"); - commandDescription = toolkit.createText(basicContents, ""); + toolkit.createLabel(basicContents, Messages.CommandEditPage_descriptionLabel); + commandDescription = toolkit.createText(basicContents, ""); //$NON-NLS-1$ commandDescription.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); - toolkit.createLabel(basicContents, "Environments"); + toolkit.createLabel(basicContents, Messages.CommandEditPage_environmentsTitle); Composite environmentsComposite = toolkit.createComposite(basicContents); environmentsComposite.setLayout(new RowLayout()); - cli = toolkit.createButton(environmentsComposite, "CLI", SWT.CHECK); - shell = toolkit.createButton(environmentsComposite, "Shell", SWT.CHECK); + cli = toolkit.createButton(environmentsComposite, Messages.CommandEditPage_cliCheckTitle, SWT.CHECK); + shell = toolkit.createButton(environmentsComposite, Messages.CommandEditPage_shellCheckTitle, SWT.CHECK); } private void createArgumentsAndOptionsSection(Composite sectionContents) { @@ -198,7 +199,7 @@ private void createBundlesSection(final Composite sectionContents) { Section bundles = toolkit.createSection(sectionContents, Section.TITLE_BAR); bundles.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - bundles.setText("Bundles to load"); + bundles.setText(Messages.CommandEditPage_bundlesToLoadsectionTitle); Composite bundleContents = toolkit.createComposite(bundles); bundles.setClient(bundleContents); @@ -213,7 +214,7 @@ Composite buttonComposite = toolkit.createComposite(bundleContents); buttonComposite.setLayout(new GridLayout(1, false)); - Button add = toolkit.createButton(buttonComposite, "Add", SWT.NONE); + Button add = toolkit.createButton(buttonComposite, Messages.CommandEditPage_addButton, SWT.NONE); add.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); add.addSelectionListener(new SelectionAdapter() { @Override @@ -226,7 +227,7 @@ } }); - Button remove = toolkit.createButton(buttonComposite, "Remove", SWT.NONE); + Button remove = toolkit.createButton(buttonComposite, Messages.CommandEditPage_removeButton, SWT.NONE); remove.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); remove.addSelectionListener(new SelectionAdapter() { @Override @@ -242,31 +243,31 @@ DataBindingContext bindingContext = new DataBindingContext(); IObservableValue nameWidgetValue = WidgetProperties.text(SWT.Modify).observe(commandName); - IObservableValue nameModelValue = BeanProperties.value(Command.class, "name").observe(commandModel); + IObservableValue nameModelValue = BeanProperties.value(Command.class, "name").observe(commandModel); //$NON-NLS-1$ bindingContext.bindValue(nameWidgetValue, nameModelValue); IObservableValue usageWidgetValue = WidgetProperties.text(SWT.Modify).observe(commandUsage); - IObservableValue usageModelValue = BeanProperties.value(Command.class, "usage").observe(commandModel); + IObservableValue usageModelValue = BeanProperties.value(Command.class, "usage").observe(commandModel); //$NON-NLS-1$ bindingContext.bindValue(usageWidgetValue, usageModelValue); IObservableValue descriptionWidgetValue = WidgetProperties.text(SWT.Modify).observe(commandDescription); - IObservableValue descriptionModelValue = BeanProperties.value(Command.class, "description").observe(commandModel); + IObservableValue descriptionModelValue = BeanProperties.value(Command.class, "description").observe(commandModel); //$NON-NLS-1$ bindingContext.bindValue(descriptionWidgetValue, descriptionModelValue); - IObservableValue environmentsModelValue = BeanProperties.value(Command.class, "environments").observe(commandModel); + IObservableValue environmentsModelValue = BeanProperties.value(Command.class, "environments").observe(commandModel); //$NON-NLS-1$ IObservableValue cliWidgetValue = WidgetProperties.selection().observe(cli); - IObservableValue cliModelValue = BeanProperties.value(Environments.class, "cli").observeDetail(environmentsModelValue); + IObservableValue cliModelValue = BeanProperties.value(Environments.class, "cli").observeDetail(environmentsModelValue); //$NON-NLS-1$ bindingContext.bindValue(cliWidgetValue, cliModelValue); IObservableValue shellWidgetValue = WidgetProperties.selection().observe(shell); - IObservableValue shellModelValue = BeanProperties.value(Environments.class, "shell").observeDetail(environmentsModelValue); + IObservableValue shellModelValue = BeanProperties.value(Environments.class, "shell").observeDetail(environmentsModelValue); //$NON-NLS-1$ bindingContext.bindValue(shellWidgetValue, shellModelValue); ObservableListContentProvider listContentProvider = new ObservableListContentProvider(); bundlesTableViewer.setContentProvider(listContentProvider); - IObservableList bundlesModel = BeanProperties.list(Command.class, "bundles").observe(commandModel); + IObservableList bundlesModel = BeanProperties.list(Command.class, "bundles").observe(commandModel); //$NON-NLS-1$ bundlesTableViewer.setInput(bundlesModel); return bindingContext; diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandsMasterDetailsBlock.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandsMasterDetailsBlock.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandsMasterDetailsBlock.java Tue Jan 21 19:51:04 2014 -0500 @@ -5,6 +5,7 @@ import org.eclipse.ui.forms.DetailsPart; import org.eclipse.ui.forms.editor.FormPage; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.model.Command; import com.redhat.thermostat.tools.eclipse.plugin.model.Plugin; @@ -29,7 +30,7 @@ @Override String getSectionTitle() { - return "Commands provided by the plugin"; + return Messages.CommandsMasterDetailsBlock_title; } @Override diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandsPage.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandsPage.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/CommandsPage.java Tue Jan 21 19:51:04 2014 -0500 @@ -6,12 +6,13 @@ import org.eclipse.ui.forms.widgets.ScrolledForm; import org.eclipse.ui.forms.widgets.TableWrapLayout; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.model.Plugin; public class CommandsPage extends FormPage { - static final String ID = "com.redhat.thermostat.tools.eclipse.plugin.editor.CommandsPage"; - static final String TITLE = "Commands"; + static final String ID = "com.redhat.thermostat.tools.eclipse.plugin.editor.CommandsPage"; //$NON-NLS-1$ + static final String TITLE = Messages.CommandsPage_title; private Plugin model; @@ -25,7 +26,7 @@ protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); - form.setText("Commands"); + form.setText(Messages.CommandsPage_title); form.getBody().setLayout(new TableWrapLayout()); CommandsMasterDetailsBlock masterAndDetails = new CommandsMasterDetailsBlock(this); diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionEditPage.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionEditPage.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionEditPage.java Tue Jan 21 19:51:04 2014 -0500 @@ -27,6 +27,7 @@ import org.eclipse.ui.forms.widgets.TableWrapData; import org.eclipse.ui.forms.widgets.TableWrapLayout; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.model.Bundle; import com.redhat.thermostat.tools.eclipse.plugin.model.Extension; import com.redhat.thermostat.tools.eclipse.plugin.model.Plugin; @@ -134,7 +135,7 @@ section.setLayoutData(tableData); - section.setText("Extension details"); + section.setText(Messages.ExtensionEditPage_extensionSectionTitle); Composite sectionContents = toolkit.createComposite(section); section.setClient(sectionContents); @@ -147,7 +148,7 @@ private void createBundlesSection(final Composite sectionContents) { Section bundles = toolkit.createSection(sectionContents, Section.TITLE_BAR); bundles.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - bundles.setText("Bundles to load"); + bundles.setText(Messages.ExtensionEditPage_bundlesSectionTitle); Composite bundleContents = toolkit.createComposite(bundles); bundles.setClient(bundleContents); @@ -161,7 +162,7 @@ Composite buttonComposite = toolkit.createComposite(bundleContents); buttonComposite.setLayout(new GridLayout(1, false)); - Button add = toolkit.createButton(buttonComposite, "Add", SWT.NONE); + Button add = toolkit.createButton(buttonComposite, Messages.ExtensionEditPage_addBundle, SWT.NONE); add.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); add.addSelectionListener(new SelectionAdapter() { @Override @@ -175,7 +176,7 @@ } }); - Button remove = toolkit.createButton(buttonComposite, "Remove", SWT.NONE); + Button remove = toolkit.createButton(buttonComposite, Messages.ExtensionEditPage_removeBundle, SWT.NONE); remove.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); remove.addSelectionListener(new SelectionAdapter() { @Override @@ -194,7 +195,7 @@ ObservableListContentProvider listContentProvider = new ObservableListContentProvider(); bundlesTableViewer.setContentProvider(listContentProvider); - IObservableList bundlesModel = BeanProperties.list(Extension.class, "bundles").observe(extensionModel); + IObservableList bundlesModel = BeanProperties.list(Extension.class, "bundles").observe(extensionModel); //$NON-NLS-1$ bundlesTableViewer.setInput(bundlesModel); return bindingContext; diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionsMasterDetailsBlock.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionsMasterDetailsBlock.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionsMasterDetailsBlock.java Tue Jan 21 19:51:04 2014 -0500 @@ -4,6 +4,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.forms.DetailsPart; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.model.Extension; import com.redhat.thermostat.tools.eclipse.plugin.model.Plugin; @@ -28,7 +29,7 @@ @Override String getSectionTitle() { - return "Commands extended by the plugin"; + return Messages.ExtensionsMasterDetailsBlock_title; } @Override diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionsPage.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionsPage.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/ExtensionsPage.java Tue Jan 21 19:51:04 2014 -0500 @@ -6,13 +6,14 @@ import org.eclipse.ui.forms.editor.FormPage; import org.eclipse.ui.forms.widgets.ScrolledForm; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.model.Plugin; public class ExtensionsPage extends FormPage { - static final String ID = "com.redhat.thermostat.tools.eclipse.plugin.editor.ExtensionsPage"; - static final String TITLE = "Extensions"; + static final String ID = "com.redhat.thermostat.tools.eclipse.plugin.editor.ExtensionsPage"; //$NON-NLS-1$ + static final String TITLE = Messages.ExtensionsPage_title; private Plugin model; @@ -25,7 +26,7 @@ @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); - form.setText("Extensions"); + form.setText(Messages.ExtensionsPage_title); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.makeColumnsEqualWidth = true; diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/MultiPageEditor.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/MultiPageEditor.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/MultiPageEditor.java Tue Jan 21 19:51:04 2014 -0500 @@ -47,7 +47,7 @@ @Override public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException { if (!(editorInput instanceof IFileEditorInput)) - throw new PartInitException("Invalid Input: Must be IFileEditorInput"); + throw new PartInitException("Invalid Input: Must be IFileEditorInput"); //$NON-NLS-1$ super.init(site, editorInput); try { @@ -138,7 +138,7 @@ @Override public void doSaveAs() { - throw new AssertionError("SaveAs is not allowed"); + throw new AssertionError("SaveAs is not allowed"); //$NON-NLS-1$ } private void updateSourceFromModel() { diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewBundleDialog.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewBundleDialog.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewBundleDialog.java Tue Jan 21 19:51:04 2014 -0500 @@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.Text; import com.redhat.thermostat.tools.eclipse.plugin.BundleInformationExtractor; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; import com.redhat.thermostat.tools.eclipse.plugin.model.Bundle; /** @@ -44,8 +45,8 @@ public void create() { super.create(); - setTitle("Add a new new bundle"); - setMessage("Use this bundle with this plugin"); + setTitle(Messages.NewBundleDialog_title); + setMessage(Messages.NewBundleDialog_message); } @Override @@ -74,11 +75,11 @@ } }); manualSelectionButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); - manualSelectionButton.setText("Specify Manually"); + manualSelectionButton.setText(Messages.NewBundleDialog_manualSectionTitle); Label nameLabel = new Label(container, SWT.None); nameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); - nameLabel.setText("Symbolic Name:"); + nameLabel.setText(Messages.NewBundleDialog_symbolicNameLabel); nameText = new Text(container, SWT.None); GridData nameTextLayoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); nameTextLayoutData.horizontalSpan = 2; @@ -86,7 +87,7 @@ Label versionLabel = new Label(container, SWT.None); versionLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); - versionLabel.setText("Version:"); + versionLabel.setText(Messages.NewBundleDialog_versionLabel); versionText = new Text(container, SWT.None); GridData versionTextLayoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); versionTextLayoutData.horizontalSpan = 2; @@ -104,24 +105,24 @@ } }); fromJarButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); - fromJarButton.setText("Extract from Jar/Bundle on disk"); + fromJarButton.setText(Messages.NewBundleDialog_fromJarSectionTitle); Label locationLabel = new Label(container, SWT.NONE); locationLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); - locationLabel.setText("Location:"); + locationLabel.setText(Messages.NewBundleDialog_pathLabel); fileLocationText = new Text(container, SWT.BORDER); fileLocationText.setEnabled(false); fileLocationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); btnFromFile = new Button(container, SWT.NONE); - btnFromFile.setText("..."); + btnFromFile.setText(Messages.NewBundleDialog_findOnDisk); btnFromFile.setEnabled(false); btnFromFile.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog dialog = new FileDialog(getShell(), SWT.OPEN); - dialog.setFilterExtensions(new String[] { "*.jar" }); + dialog.setFilterExtensions(new String[] { "*.jar" }); //$NON-NLS-1$ String result = dialog.open(); if (result != null) { fileLocationText.setText(result); diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewNameDialog.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewNameDialog.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewNameDialog.java Tue Jan 21 19:51:04 2014 -0500 @@ -10,6 +10,8 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; + /** Asks the name for a new command/extension */ public class NewNameDialog extends TitleAreaDialog { @@ -25,8 +27,8 @@ public void create() { super.create(); - setTitle("Enter the name for the new command"); - setMessage("This is the command users will use to trigger your plugin"); + setTitle(Messages.NewNameDialog_title); + setMessage(Messages.NewNameDialog_message); } @Override @@ -39,7 +41,7 @@ container.setLayout(new GridLayout(2, false)); Label label = new Label(container, SWT.None); - label.setText("Name:"); + label.setText(Messages.NewNameDialog_nameLabel); nameText = new Text(container, SWT.None); nameText.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/OverviewPage.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/OverviewPage.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/OverviewPage.java Tue Jan 21 19:51:04 2014 -0500 @@ -3,6 +3,7 @@ import java.net.MalformedURLException; import java.net.URL; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; @@ -17,10 +18,12 @@ import org.eclipse.ui.forms.widgets.Section; import org.eclipse.ui.forms.widgets.TableWrapLayout; +import com.redhat.thermostat.tools.eclipse.plugin.Messages; + public class OverviewPage extends FormPage { - static final String ID = "com.redhat.thermostat.tools.eclipse.plugin.editor.OverviewPage"; - static final String TITLE = "Overview"; + static final String ID = "com.redhat.thermostat.tools.eclipse.plugin.editor.OverviewPage"; //$NON-NLS-1$ + static final String TITLE = Messages.OverviewPage_title; private String pluginName; @@ -33,7 +36,7 @@ @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); - form.setText("Overview: " + pluginName); + form.setText(NLS.bind(Messages.OverviewPage_formTitle, pluginName)); TableWrapLayout layout = new TableWrapLayout(); form.getBody().setLayout(layout); @@ -46,18 +49,14 @@ private void createOverviewSection(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); Section section = toolkit.createSection(parent, Section.TITLE_BAR); - section.setText("General Information"); + section.setText(Messages.OverviewPage_generalInformationSectionTitle); Composite sectionData = toolkit.createComposite(section); sectionData.setLayout(new TableWrapLayout()); FormText helpText = toolkit.createFormText(sectionData, false); - String onlineHelp = "
" - + "

For more information about thermostat see " - + "the homepage. " - + "Additional information about plugins is available " - + "here." - + "

" - + "
"; + String onlineHelp = NLS.bind(Messages.OverviewPage_thermostatOverviewForm, + "http://icedtea.classpath.org/thermostat", //$NON-NLS-1$ + "http://icedtea.classpath.org/wiki/Thermostat/ExtensionTutorial"); //$NON-NLS-1$ helpText.setText(onlineHelp, true, false); helpText.addHyperlinkListener(new HyperlinkAdapter() { @Override @@ -77,18 +76,15 @@ private void createEditCommandsAndExtensionsSection(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); Section section = toolkit.createSection(parent, Section.TITLE_BAR); - section.setText("Commands and Extensions"); + section.setText(Messages.OverviewPage_commandsAndExtensionSectionTitle); Composite sectionData = toolkit.createComposite(section); sectionData.setLayout(new TableWrapLayout()); FormText commandAndExtensionsForm = toolkit.createFormText(sectionData, false); - String formContents = "" - + "
" - + "

Plugins provide new commands or extend existing ones.

" - + "
  • Commands: declares new commands provided by this plugin
  • " - + "
  • Extensions: declares which commands provided by other plugins or thermostat itself should be extended
  • " - + "
    "; + String formContents = NLS.bind(Messages.OverviewPage_bundlesAndExtensionsOverviewForm, + "commands", //$NON-NLS-1$ + "extensions"); //$NON-NLS-1$ commandAndExtensionsForm.setText(formContents, true, false); commandAndExtensionsForm.addHyperlinkListener(new HyperlinkAdapter() { @@ -97,10 +93,10 @@ String href = (String) e.getHref(); String id = null; switch(href) { - case "commands": + case "commands": //$NON-NLS-1$ id = CommandsPage.ID; break; - case "extensions": + case "extensions": //$NON-NLS-1$ id = ExtensionsPage.ID; break; } diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/messages.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/messages.properties Tue Jan 21 19:51:04 2014 -0500 @@ -0,0 +1,53 @@ +BaseMasterDetailsBlock_add=Add +BaseMasterDetailsBlock_remove=Remove +CommandEditPage_addButton=Add +CommandEditPage_basicsSectionTitle=Basics +CommandEditPage_bundlesToLoadsectionTitle=Bundles to load +CommandEditPage_cliCheckTitle=CLI +CommandEditPage_commandDetailsSectionTitle=Command details +CommandEditPage_descriptionLabel=Description: +CommandEditPage_environmentsTitle=Environments +CommandEditPage_nameLabel=Name: +CommandEditPage_removeButton=Remove +CommandEditPage_shellCheckTitle=Shell +CommandEditPage_usageLabel=Usage: +CommandsMasterDetailsBlock_title=Commands provided by the plugin +CommandsPage_title=Commands +ExtensionEditPage_addBundle=Add +ExtensionEditPage_bundlesSectionTitle=Bundles to load +ExtensionEditPage_extensionSectionTitle=Extension details +ExtensionEditPage_removeBundle=Remove +ExtensionsMasterDetailsBlock_title=Commands extended by the plugin +ExtensionsPage_title=Extensions +NewBundleDialog_findOnDisk=... +NewBundleDialog_fromJarSectionTitle=Extract from Jar/Bundle on disk +NewBundleDialog_manualSectionTitle=Specify Manually +NewBundleDialog_message=Use this bundle with this plugin +NewBundleDialog_pathLabel=Location: +NewBundleDialog_symbolicNameLabel=Symbolic Name: +NewBundleDialog_title=Add a new new bundle +NewBundleDialog_versionLabel=Version: +NewNameDialog_message=This is the command users will use to trigger your plugin +NewNameDialog_nameLabel=Name: +NewNameDialog_title=Enter the name for the new command +OverviewPage_bundlesAndExtensionsOverviewForm =

    Plugins provide new commands or extend existing ones.

  • Commands: declares new commands provided by this plugin
  • Extensions: declares which commands provided by other plugins or thermostat itself should be extended
  • +OverviewPage_commandsAndExtensionSectionTitle=Commands and Extensions +OverviewPage_formTitle=Overview: {0} +OverviewPage_generalInformationSectionTitle=General Information +OverviewPage_thermostatOverviewForm =

    For more information about thermostat see the homepage. Additional information about plugins is available here.

    +OverviewPage_title=Overview +PluginModelReaderWriter_errorLoadingModel=Unable to load model +PluginModelReaderWriter_errorSavingFile=Error saving file +PluginXmlCreationWizard_containerDoesNotExist=Container {0} does not exist. +PluginXmlCreationWizard_creatingFile=Creating {0} +PluginXmlCreationWizard_error=Error +PluginXmlCreationWizard_openingFileForEditing=Opening file for editing... +PluginXmlCreationWizard_windowTitle=Create Themrostat Plugin +PluginXmlProjectSelectionPage_selectFileContainer=Select new file container +PluginXmlProjectSelectionPage_browse=Browse... +PluginXmlProjectSelectionPage_description=This wizard creates a new Thermostat Plugin. +PluginXmlProjectSelectionPage_fileContainerMustBeSpecified=File container must be specified +PluginXmlProjectSelectionPage_fileContainerMustExist=File container must exist +PluginXmlProjectSelectionPage_projectMustBeWritable=Project must be writable +PluginXmlProjectSelectionPage_projectNameLabel=&Project: +PluginXmlProjectSelectionPage_title=Thermostat Wizard diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/model/Bundle.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/model/Bundle.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/model/Bundle.java Tue Jan 21 19:51:04 2014 -0500 @@ -40,7 +40,7 @@ } public String toString() { - return this.name + " (" + this.version + ")"; + return this.name + " (" + this.version + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } @Override diff -r 67d58773e96e -r 8f2dd0dbdb87 com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/model/Command.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/model/Command.java Tue Jan 21 10:27:17 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/model/Command.java Tue Jan 21 19:51:04 2014 -0500 @@ -46,7 +46,7 @@ } public void setName(String name) { - firePropertyChange("name", this.name, this.name = name); + firePropertyChange("name", this.name, this.name = name); //$NON-NLS-1$ } @XmlElement(name="description") @@ -55,7 +55,7 @@ } public void setDescription(String description) { - firePropertyChange("description", this.description, this.description = description); + firePropertyChange("description", this.description, this.description = description); //$NON-NLS-1$ } @XmlElement(name="usage") @@ -64,7 +64,7 @@ } public void setUsage(String usage) { - firePropertyChange("usage", this.usage, this.usage = usage); + firePropertyChange("usage", this.usage, this.usage = usage); //$NON-NLS-1$ } @XmlElementWrapper(name="arguments") @@ -74,17 +74,17 @@ } public void setArguments(List arguments) { - firePropertyChange("arguments", this.arguments, this.arguments = arguments); + firePropertyChange("arguments", this.arguments, this.arguments = arguments); //$NON-NLS-1$ } public void addArgument(String argument) { this.arguments.add(argument); - firePropertyChange("arguments", null, this.arguments); + firePropertyChange("arguments", null, this.arguments); //$NON-NLS-1$ } public void removeArgument(String argument) { this.arguments.remove(argument); - firePropertyChange("arguments", null, this.arguments); + firePropertyChange("arguments", null, this.arguments); //$NON-NLS-1$ } @XmlElementWrapper(name="options") @@ -94,7 +94,7 @@ } public void setOptions(List