--- /dev/null
+/**
+ * Copyright (C) 2016 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.molecular;
+
+
+import org.eclipse.osgi.util.NLS;
+
+
+
+/**
+ * Messages and texts for the molecular plugin.
+ *
+ * @author Ben Stöver
+ * @date 17.11.2016
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$
+ public static String wizardExportAlignmentAppendExtensionButton;
+ public static String wizardExportAlignmentBrowseButton;
+ public static String wizardExportAlignmentDataLabel;
+ public static String wizardExportAlignmentDescription;
+ public static String wizardExportAlignmentDestinationLabel;
+ public static String wizardExportAlignmentErrorMissingFileName;
+ public static String wizardExportAlignmentErrorMissingSeqLabel;
+ public static String wizardExportAlignmentErrorNothingToExport;
+ public static String wizardExportAlignmentExportConsensusSeqLabel;
+ public static String wizardExportAlignmentExportFormatLabel;
+ public static String wizardExportAlignmentExportSingleReads;
+ public static String wizardExportAlignmentFileDialogTitle;
+ public static String wizardExportAlignmentFileLabel;
+ public static String wizardExportAlignmentTitle;
+ public static String wizardExportAlignmentWarningFileNameStartsDot;
+ public static String wizardExportAlignmentwarningMissingExtension;
+
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {}
+}
import org.eclipse.swt.widgets.Label;\r
import org.eclipse.swt.widgets.Text;\r
\r
+import eu.etaxonomy.taxeditor.molecular.Messages;\r
+\r
\r
\r
/**\r
* Create the wizard.\r
*/\r
public ExportSingleReadAlignmentWizardPage() {\r
- super("SingleReadSequencesExport"); //TODO Which pageName should be used here? Any conventions?\r
- setTitle("Sequence export"); //TODO multi language\r
- setDescription("Defines which sequences of the single read alignment shall be exported."); //TODO multi language\r
+ super("SingleReadSequencesExport"); //TODO Which pageName should be used here? Any conventions? //$NON-NLS-1$\r
+ setTitle(Messages.wizardExportAlignmentTitle);\r
+ setDescription(Messages.wizardExportAlignmentDescription);\r
}\r
\r
\r
FormData fd_exportSingleReadsCB = new FormData();\r
fd_exportSingleReadsCB.left = new FormAttachment(0, 10);\r
exportSingleReadsCB.setLayoutData(fd_exportSingleReadsCB);\r
- exportSingleReadsCB.setText("Export single reads");\r
+ exportSingleReadsCB.setText(Messages.wizardExportAlignmentExportSingleReads);\r
final ISWTObservableValue exportSingleReadsObservable = SWTObservables.observeSelection(exportSingleReadsCB);\r
dbc.bindValue(exportSingleReadsObservable, getWizard().getModel().getExportSingleReadsObservable());\r
exportSingleReadsCB.setSelection(false);\r
fd_exportConsensusSequenceCB.top = new FormAttachment(exportSingleReadsCB, 6);\r
fd_exportConsensusSequenceCB.left = new FormAttachment(0, 10);\r
exportConsensusSequenceCB.setLayoutData(fd_exportConsensusSequenceCB);\r
- exportConsensusSequenceCB.setText("Export consensus sequence");\r
+ exportConsensusSequenceCB.setText(Messages.wizardExportAlignmentExportConsensusSeqLabel);\r
final ISWTObservableValue exportConsensusSequenceObservable = SWTObservables.observeSelection(exportConsensusSequenceCB);\r
dbc.bindValue(exportConsensusSequenceObservable, getWizard().getModel().getExportConsensusSequenceObservable());\r
exportConsensusSequenceCB.setSelection(false);\r
consensusSequenceLabelTextField.setLayoutData(fd_consensusSequenceNameTextField);\r
final ISWTObservableValue consensusSequenceLabelObservable = SWTObservables.observeText(consensusSequenceLabelTextField, SWT.Modify);\r
dbc.bindValue(consensusSequenceLabelObservable, getWizard().getModel().getConsensusSequenceLabelObservable());\r
- consensusSequenceLabelTextField.setText("ConsensusSequence"); // Must happen after the component has been bound to the model.\r
+ consensusSequenceLabelTextField.setText("ConsensusSequence"); // Must happen after the component has been bound to the model. //$NON-NLS-1$\r
\r
Label lblFormat = new Label(container, SWT.NONE);\r
FormData fd_lblFormat = new FormData();\r
fd_lblFormat.top = new FormAttachment(consensusSequenceLabelTextField, 36);\r
fd_lblFormat.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);\r
lblFormat.setLayoutData(fd_lblFormat);\r
- lblFormat.setText("Select the export format:"); //TODO multi language\r
+ lblFormat.setText(Messages.wizardExportAlignmentExportFormatLabel);\r
\r
Label lblSelectTheData = new Label(container, SWT.NONE);\r
fd_exportSingleReadsCB.top = new FormAttachment(lblSelectTheData, 6);\r
fd_lblSelectTheData.left = new FormAttachment(0, 10);\r
fd_lblSelectTheData.top = new FormAttachment(0, 10);\r
lblSelectTheData.setLayoutData(fd_lblSelectTheData);\r
- lblSelectTheData.setText("Select the data to export:"); //TODO multi language\r
+ lblSelectTheData.setText(Messages.wizardExportAlignmentDataLabel);\r
\r
Label lblSelectTheExport = new Label(container, SWT.NONE);\r
FormData fd_lblSelectTheExport = new FormData();\r
fd_lblSelectTheExport.top = new FormAttachment(lblFormat, 57);\r
fd_lblSelectTheExport.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);\r
lblSelectTheExport.setLayoutData(fd_lblSelectTheExport);\r
- lblSelectTheExport.setText("Select the export destination:"); //TODO multi language\r
+ lblSelectTheExport.setText(Messages.wizardExportAlignmentDestinationLabel);\r
\r
Label lblAlignmentFile = new Label(container, SWT.NONE);\r
FormData fd_lblAlignmentFile = new FormData();\r
fd_lblAlignmentFile.top = new FormAttachment(lblSelectTheExport, 9);\r
fd_lblAlignmentFile.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);\r
lblAlignmentFile.setLayoutData(fd_lblAlignmentFile);\r
- lblAlignmentFile.setText("Alignment file:"); //TODO multi language\r
+ lblAlignmentFile.setText(Messages.wizardExportAlignmentFileLabel);\r
\r
fileTextField = new Text(container, SWT.BORDER);\r
FormData fd_text = new FormData();\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);\r
- dialog.setText("Export to"); //TODO multi language\r
+ dialog.setText(Messages.wizardExportAlignmentFileDialogTitle);\r
ContentExtensionFileFilter filter = getSelectedFormat().createFileFilter(TestStrategy.EXTENSION);\r
dialog.setFilterExtensions(new String[]{filter.getExtensionsAsString()});\r
dialog.setFilterNames(new String[]{filter.getDescription()});\r
fd_btnBrowse.top = new FormAttachment(fileTextField, 13);\r
fd_btnBrowse.right = new FormAttachment(100, -10);\r
btnBrowse.setLayoutData(fd_btnBrowse);\r
- btnBrowse.setText("Browse...");\r
+ btnBrowse.setText(Messages.wizardExportAlignmentBrowseButton);\r
\r
formatComboBox = new Combo(container, SWT.READ_ONLY);\r
for (JPhyloIOFormatInfo formatInfo : ExportSingleReadAlignmentWizardModel.FORMAT_NAMES_TO_INFO_MAP.values()) {\r
}\r
});\r
FormData fd_btnNewButton = new FormData();\r
- fd_btnNewButton.left = new FormAttachment(btnBrowse, -217, SWT.LEFT);\r
+ fd_btnNewButton.left = new FormAttachment(btnBrowse, -276, SWT.LEFT);\r
fd_btnNewButton.right = new FormAttachment(btnBrowse, -6);\r
fd_btnNewButton.bottom = new FormAttachment(fileTextField, 43, SWT.BOTTOM);\r
fd_btnNewButton.top = new FormAttachment(fileTextField, 13);\r
appendExtensionButton.setLayoutData(fd_btnNewButton);\r
- appendExtensionButton.setText("Append default extension"); //TODO multi language\r
+ appendExtensionButton.setText(Messages.wizardExportAlignmentAppendExtensionButton);\r
\r
dbc.addValidationStatusProvider(new MultiValidator() {\r
@Override\r
boolean exportReads = (Boolean)exportSingleReadsObservable.getValue();\r
\r
if (!exportConsensus && !exportReads) {\r
- return ValidationStatus.error("Either single reads or the consensus sequence have to be selected for export."); //TODO multi language\r
+ return ValidationStatus.error(Messages.wizardExportAlignmentErrorNothingToExport);\r
}\r
else if (exportConsensus && ((label == null) || label.isEmpty())) {\r
- return ValidationStatus.error("The consensus sequence label must not be empty."); //TODO multi language\r
+ return ValidationStatus.error(Messages.wizardExportAlignmentErrorMissingSeqLabel);\r
}\r
\r
String fileName = (String)fileNameObservable.getValue();\r
if ((fileName == null) || fileName.isEmpty()) {\r
- return ValidationStatus.error("The file name must not be empty."); //TODO multi language\r
+ return ValidationStatus.error(Messages.wizardExportAlignmentErrorMissingFileName);\r
}\r
else if (!getSelectedFormat().createFileFilter(TestStrategy.EXTENSION).accept(new File(fileName))) {\r
- return ValidationStatus.warning("The file name does have a valid extension for the selected format."); //TODO multi language\r
+ return ValidationStatus.warning(Messages.wizardExportAlignmentwarningMissingExtension);\r
}\r
else if (fileName.charAt(0) == ExtensionFileFilter.EXTENSION_SEPARATOR) {\r
- return ValidationStatus.warning("File starting with '" + ExtensionFileFilter.EXTENSION_SEPARATOR +\r
- "' are not supported on all operating systems."); //TODO multi language\r
+ return ValidationStatus.warning(Messages.wizardExportAlignmentWarningFileNameStartsDot);\r
}\r
else {\r
return ValidationStatus.ok();\r