Project

General

Profile

« Previous | Next » 

Revision d0c85dbc

Added by Ben Stöver over 7 years ago

Strings in ExportSingleReadAlignmentWizardPage externalized and translated.

View differences:

eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizardPage.java
38 38
import org.eclipse.swt.widgets.Label;
39 39
import org.eclipse.swt.widgets.Text;
40 40

  
41
import eu.etaxonomy.taxeditor.molecular.Messages;
42

  
41 43

  
42 44

  
43 45
/**
......
58 60
     * Create the wizard.
59 61
     */
60 62
    public ExportSingleReadAlignmentWizardPage() {
61
        super("SingleReadSequencesExport");  //TODO Which pageName should be used here? Any conventions?
62
        setTitle("Sequence export");  //TODO multi language
63
        setDescription("Defines which sequences of the single read alignment shall be exported.");  //TODO multi language
63
        super("SingleReadSequencesExport");  //TODO Which pageName should be used here? Any conventions? //$NON-NLS-1$
64
        setTitle(Messages.wizardExportAlignmentTitle);
65
        setDescription(Messages.wizardExportAlignmentDescription);
64 66
    }
65 67

  
66 68

  
......
83 85
        FormData fd_exportSingleReadsCB = new FormData();
84 86
        fd_exportSingleReadsCB.left = new FormAttachment(0, 10);
85 87
        exportSingleReadsCB.setLayoutData(fd_exportSingleReadsCB);
86
        exportSingleReadsCB.setText("Export single reads");
88
        exportSingleReadsCB.setText(Messages.wizardExportAlignmentExportSingleReads);
87 89
        final ISWTObservableValue exportSingleReadsObservable = SWTObservables.observeSelection(exportSingleReadsCB);
88 90
        dbc.bindValue(exportSingleReadsObservable, getWizard().getModel().getExportSingleReadsObservable());
89 91
        exportSingleReadsCB.setSelection(false);
......
101 103
        fd_exportConsensusSequenceCB.top = new FormAttachment(exportSingleReadsCB, 6);
102 104
        fd_exportConsensusSequenceCB.left = new FormAttachment(0, 10);
103 105
        exportConsensusSequenceCB.setLayoutData(fd_exportConsensusSequenceCB);
104
        exportConsensusSequenceCB.setText("Export consensus sequence");
106
        exportConsensusSequenceCB.setText(Messages.wizardExportAlignmentExportConsensusSeqLabel);
105 107
        final ISWTObservableValue exportConsensusSequenceObservable = SWTObservables.observeSelection(exportConsensusSequenceCB);
106 108
        dbc.bindValue(exportConsensusSequenceObservable, getWizard().getModel().getExportConsensusSequenceObservable());
107 109
        exportConsensusSequenceCB.setSelection(false);
......
116 118
        consensusSequenceLabelTextField.setLayoutData(fd_consensusSequenceNameTextField);
117 119
        final ISWTObservableValue consensusSequenceLabelObservable = SWTObservables.observeText(consensusSequenceLabelTextField, SWT.Modify);
118 120
        dbc.bindValue(consensusSequenceLabelObservable, getWizard().getModel().getConsensusSequenceLabelObservable());
119
        consensusSequenceLabelTextField.setText("ConsensusSequence");  // Must happen after the component has been bound to the model.
121
        consensusSequenceLabelTextField.setText("ConsensusSequence");  // Must happen after the component has been bound to the model. //$NON-NLS-1$
120 122

  
121 123
        Label lblFormat = new Label(container, SWT.NONE);
122 124
        FormData fd_lblFormat = new FormData();
123 125
        fd_lblFormat.top = new FormAttachment(consensusSequenceLabelTextField, 36);
124 126
        fd_lblFormat.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
125 127
        lblFormat.setLayoutData(fd_lblFormat);
126
        lblFormat.setText("Select the export format:");  //TODO multi language
128
        lblFormat.setText(Messages.wizardExportAlignmentExportFormatLabel);
127 129

  
128 130
        Label lblSelectTheData = new Label(container, SWT.NONE);
129 131
        fd_exportSingleReadsCB.top = new FormAttachment(lblSelectTheData, 6);
......
131 133
        fd_lblSelectTheData.left = new FormAttachment(0, 10);
132 134
        fd_lblSelectTheData.top = new FormAttachment(0, 10);
133 135
        lblSelectTheData.setLayoutData(fd_lblSelectTheData);
134
        lblSelectTheData.setText("Select the data to export:");  //TODO multi language
136
        lblSelectTheData.setText(Messages.wizardExportAlignmentDataLabel);
135 137

  
136 138
        Label lblSelectTheExport = new Label(container, SWT.NONE);
137 139
        FormData fd_lblSelectTheExport = new FormData();
138 140
        fd_lblSelectTheExport.top = new FormAttachment(lblFormat, 57);
139 141
        fd_lblSelectTheExport.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
140 142
        lblSelectTheExport.setLayoutData(fd_lblSelectTheExport);
141
        lblSelectTheExport.setText("Select the export destination:");  //TODO multi language
143
        lblSelectTheExport.setText(Messages.wizardExportAlignmentDestinationLabel);
142 144

  
143 145
        Label lblAlignmentFile = new Label(container, SWT.NONE);
144 146
        FormData fd_lblAlignmentFile = new FormData();
145 147
        fd_lblAlignmentFile.top = new FormAttachment(lblSelectTheExport, 9);
146 148
        fd_lblAlignmentFile.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
147 149
        lblAlignmentFile.setLayoutData(fd_lblAlignmentFile);
148
        lblAlignmentFile.setText("Alignment file:");  //TODO multi language
150
        lblAlignmentFile.setText(Messages.wizardExportAlignmentFileLabel);
149 151

  
150 152
        fileTextField = new Text(container, SWT.BORDER);
151 153
        FormData fd_text = new FormData();
......
161 163
            @Override
162 164
            public void widgetSelected(SelectionEvent e) {
163 165
                FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
164
                dialog.setText("Export to");  //TODO multi language
166
                dialog.setText(Messages.wizardExportAlignmentFileDialogTitle);
165 167
                ContentExtensionFileFilter filter = getSelectedFormat().createFileFilter(TestStrategy.EXTENSION);
166 168
                dialog.setFilterExtensions(new String[]{filter.getExtensionsAsString()});
167 169
                dialog.setFilterNames(new String[]{filter.getDescription()});
......
177 179
        fd_btnBrowse.top = new FormAttachment(fileTextField, 13);
178 180
        fd_btnBrowse.right = new FormAttachment(100, -10);
179 181
        btnBrowse.setLayoutData(fd_btnBrowse);
180
        btnBrowse.setText("Browse...");
182
        btnBrowse.setText(Messages.wizardExportAlignmentBrowseButton);
181 183

  
182 184
        formatComboBox = new Combo(container, SWT.READ_ONLY);
183 185
        for (JPhyloIOFormatInfo formatInfo : ExportSingleReadAlignmentWizardModel.FORMAT_NAMES_TO_INFO_MAP.values()) {
......
201 203
            }
202 204
        });
203 205
        FormData fd_btnNewButton = new FormData();
204
        fd_btnNewButton.left = new FormAttachment(btnBrowse, -217, SWT.LEFT);
206
        fd_btnNewButton.left = new FormAttachment(btnBrowse, -276, SWT.LEFT);
205 207
        fd_btnNewButton.right = new FormAttachment(btnBrowse, -6);
206 208
        fd_btnNewButton.bottom = new FormAttachment(fileTextField, 43, SWT.BOTTOM);
207 209
        fd_btnNewButton.top = new FormAttachment(fileTextField, 13);
208 210
        appendExtensionButton.setLayoutData(fd_btnNewButton);
209
        appendExtensionButton.setText("Append default extension");  //TODO multi language
211
        appendExtensionButton.setText(Messages.wizardExportAlignmentAppendExtensionButton);
210 212

  
211 213
        dbc.addValidationStatusProvider(new MultiValidator() {
212 214
            @Override
......
216 218
                boolean exportReads = (Boolean)exportSingleReadsObservable.getValue();
217 219

  
218 220
                if (!exportConsensus && !exportReads) {
219
                    return ValidationStatus.error("Either single reads or the consensus sequence have to be selected for export.");  //TODO multi language
221
                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorNothingToExport);
220 222
                }
221 223
                else if (exportConsensus && ((label == null) || label.isEmpty())) {
222
                    return ValidationStatus.error("The consensus sequence label must not be empty.");  //TODO multi language
224
                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorMissingSeqLabel);
223 225
                }
224 226

  
225 227
                String fileName = (String)fileNameObservable.getValue();
226 228
                if ((fileName == null) || fileName.isEmpty()) {
227
                    return ValidationStatus.error("The file name must not be empty.");  //TODO multi language
229
                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorMissingFileName);
228 230
                }
229 231
                else if (!getSelectedFormat().createFileFilter(TestStrategy.EXTENSION).accept(new File(fileName))) {
230
                    return ValidationStatus.warning("The file name does have a valid extension for the selected format.");  //TODO multi language
232
                    return ValidationStatus.warning(Messages.wizardExportAlignmentwarningMissingExtension);
231 233
                }
232 234
                else if (fileName.charAt(0) == ExtensionFileFilter.EXTENSION_SEPARATOR) {
233
                    return ValidationStatus.warning("File starting with '" + ExtensionFileFilter.EXTENSION_SEPARATOR +
234
                            "' are not supported on all operating systems.");  //TODO multi language
235
                    return ValidationStatus.warning(Messages.wizardExportAlignmentWarningFileNameStartsDot);
235 236
                }
236 237
                else {
237 238
                    return ValidationStatus.ok();

Also available in: Unified diff