Project

General

Profile

« Previous | Next » 

Revision 2a41b80d

Added by Katja Luther about 7 years ago

externalize strings for admin menu

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java
59 59
    private Combo nomenclaturalCodeCombo;
60 60
    private Label nomenclaturalCodeLabel;
61 61

  
62
//    private UriWithLabelElement nomenclaturalCodeCombo;
63
//    private Label nomenclaturalCodeLabel;
64

  
62 65
    String[][] labelAndValues;
63 66

  
64 67
    /*
......
113 116
        if (composite == null){
114 117
            composite = parent;
115 118
        }
116
       composite = addTab("Name Details View Configuration");
119
       composite = addTab(Messages.DatabasePreferencesPage_details_view_configuration);
117 120
//        TabItem tbtmNameDetailsConfiguration = new TabItem(tabFolder, SWT.NONE);
118 121
//        Composite c2 = new Composite(tabFolder, SWT.BORDER);
119 122
//        c2.setLayout(new GridLayout(1, true));
......
126 129

  
127 130
       isSimpleDetailsViewActivated= PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION);
128 131
       final Button activateCheckButton = new Button(composite, SWT.CHECK);
129
       activateCheckButton.setText("Show only a simple name details view");
132
       activateCheckButton.setText(Messages.DatabasePreferencesPage_show_only_simple_details_view);
130 133
       activateCheckButton.setSelection(isSimpleDetailsViewActivated);
131 134
       activateCheckButton.addSelectionListener(new SelectionAdapter(){
132 135
       @Override
......
149 152

  
150 153
       final Button showTaxon = new Button(child, SWT.CHECK);
151 154
       boolean isShowTaxon = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON);
152
       showTaxon.setText("Show taxon of the name");
155
       showTaxon.setText(Messages.DatabasePreferencesPage_show_taxon);
153 156
       showTaxon.setSelection(isShowTaxon);
154 157
       showTaxon.addSelectionListener(new SelectionAdapter(){
155 158
            @Override
......
161 164

  
162 165
       final Button showLsid = new Button(child, SWT.CHECK);
163 166
       boolean isShowLSID = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID);
164
       showLsid.setText("Show Lsid of the name");
167
       showLsid.setText(Messages.DatabasePreferencesPage_show_lsid);
165 168
       showLsid.setSelection(isShowLSID);
166 169
       showLsid.addSelectionListener(new SelectionAdapter(){
167 170
            @Override
......
173 176

  
174 177
       final Button showNomenclaturalCode = new Button(child, SWT.CHECK);
175 178
       boolean isShowNomenclaturalCode = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE);
176
       showNomenclaturalCode.setText("Show the nomenclatural code");
179
       showNomenclaturalCode.setText(Messages.DatabasePreferencesPage_show_nomenclatural_code);
177 180
       showNomenclaturalCode.setSelection(isShowNomenclaturalCode);
178 181
       showNomenclaturalCode.addSelectionListener(new SelectionAdapter(){
179 182
            @Override
......
185 188

  
186 189
       final Button showNameCache = new Button(child, SWT.CHECK);
187 190
       boolean isShowNameCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE);
188
       showNameCache.setText("Show nameCache of the name (only the scientific name without the author and year)");
191
       showNameCache.setText(Messages.DatabasePreferencesPage_show_namecache);
189 192
       showNameCache.setSelection(isShowNomenclaturalCode);
190 193
       showNameCache.addSelectionListener(new SelectionAdapter(){
191 194
            @Override
......
196 199
        });
197 200
       final Button showAppendedPhrase = new Button(child, SWT.CHECK);
198 201
       boolean isShowAppendedPhrase = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE);
199
       showAppendedPhrase.setText("Show appended phrase");
202
       showAppendedPhrase.setText(Messages.DatabasePreferencesPage_show_appended_phrase);
200 203
       showAppendedPhrase.setSelection(isShowAppendedPhrase);
201 204
       showAppendedPhrase.addSelectionListener(new SelectionAdapter(){
202 205
            @Override
......
208 211

  
209 212
       final Button showRank = new Button(child, SWT.CHECK);
210 213
       boolean isShowRank = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK);
211
       showRank.setText("Show rank of the name");
214
       showRank.setText(Messages.DatabasePreferencesPage_show_rank);
212 215
       showRank.setSelection(isShowRank);
213 216
       showRank.addSelectionListener(new SelectionAdapter(){
214 217
            @Override
......
219 222
        });
220 223
       final Button showEpithets = new Button(child, SWT.CHECK);
221 224
       boolean isShowEpithets = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS);
222
       showEpithets.setText("Show atomised epithets");
225
       showEpithets.setText(Messages.DatabasePreferencesPage_show_atomised_epithets);
223 226
       showEpithets.setSelection(isShowEpithets);
224 227
       showEpithets.addSelectionListener(new SelectionAdapter(){
225 228
            @Override
......
228 231
                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, isShowEpithets);
229 232
             }
230 233
        });
234
       final Button showAuthorshipCache = new Button(child, SWT.CHECK);
235
       boolean isShowAuthorshipCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE);
236
       showAuthorshipCache.setText(Messages.DatabasePreferencesPage_show_authorship_cache);
237
       showAuthorshipCache.setSelection(isShowAuthorshipCache);
238
       showAuthorshipCache.addSelectionListener(new SelectionAdapter(){
239
            @Override
240
            public void widgetSelected(SelectionEvent e) {
241
                boolean isShowAuthorshipCache = showAuthorshipCache.getSelection();
242
                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE, isShowAuthorshipCache);
243
             }
244
        });
245

  
231 246
       final Button showAuthorship = new Button(child, SWT.CHECK);
232 247
       boolean isShowAuthorship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP);
233
       showAuthorship.setText("Show authorship section");
248
       showAuthorship.setText(Messages.DatabasePreferencesPage_show_author_section);
234 249
       showAuthorship.setSelection(isShowAuthorship);
235 250
       showAuthorship.addSelectionListener(new SelectionAdapter(){
236 251
            @Override
......
242 257

  
243 258
       final Button showNomenclaturalRef = new Button(child, SWT.CHECK);
244 259
       boolean isShowNomenclaturalRef = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE);
245
       showNomenclaturalRef.setText("Show nomenclatural reference section");
260
       showNomenclaturalRef.setText(Messages.DatabasePreferencesPage_Show_nomenclatural_Ref);
246 261
       showNomenclaturalRef.setSelection(isShowNomenclaturalRef);
247 262
       showNomenclaturalRef.addSelectionListener(new SelectionAdapter(){
248 263
            @Override
......
254 269

  
255 270
       final Button showNomenclaturalStatus = new Button(child, SWT.CHECK);
256 271
       boolean isShowNomenclaturalStatus = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS);
257
       showNomenclaturalStatus.setText("Show nomenclatural status section");
272
       showNomenclaturalStatus.setText(Messages.DatabasePreferencesPage_Show_nomenclaturalStatus);
258 273
       showNomenclaturalStatus.setSelection(isShowNomenclaturalStatus);
259 274
       showNomenclaturalStatus.addSelectionListener(new SelectionAdapter(){
260 275
            @Override
......
266 281

  
267 282
       final Button showProtologue = new Button(child, SWT.CHECK);
268 283
       boolean isShowProtologue = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE);
269
       showProtologue.setText("Show protologue section");
284
       showProtologue.setText(Messages.DatabasePreferencesPage_Show_Protologue);
270 285
       showProtologue.setSelection(isShowProtologue);
271 286
       showProtologue.addSelectionListener(new SelectionAdapter(){
272 287
            @Override
......
278 293

  
279 294
       final Button showTypeDesignation = new Button(child, SWT.CHECK);
280 295
       boolean isShowTypeDesignation = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION);
281
       showTypeDesignation.setText("Show name type designation section");
296
       showTypeDesignation.setText(Messages.DatabasePreferencesPage_Show_Type_designation);
282 297
       showTypeDesignation.setSelection(isShowTypeDesignation);
283 298
       showTypeDesignation.addSelectionListener(new SelectionAdapter(){
284 299
            @Override
......
291 306

  
292 307
       final Button showNameRelationship = new Button(child, SWT.CHECK);
293 308
       boolean isShowNameRelationship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP);
294
       showNameRelationship.setText("Show name relationship section");
309
       showNameRelationship.setText(Messages.DatabasePreferencesPage_Show_NameRelations);
295 310
       showNameRelationship.setSelection(isShowNameRelationship);
296 311
       showNameRelationship.addSelectionListener(new SelectionAdapter(){
297 312
            @Override
......
361 376
    }
362 377

  
363 378
    public void createNomenclaturalCodeTab(Composite parent){
364
       composite = addTab("Nomenclatural Code");
379
       composite = addTab(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
365 380
       nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
366 381
      List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
367 382
              .getSupportedCodes();
......
394 409

  
395 410
        final Button useLocalPreference = new Button(composite, SWT.CHECK);
396 411
        boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY);
397
        useLocalPreference.setText("allow to use local preference");
412
        useLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
398 413
        useLocalPreference.setSelection(isUseLocalPreference);
399 414
        useLocalPreference.addSelectionListener(new SelectionAdapter(){
400 415
             @Override
......
409 424

  
410 425
}
411 426

  
427
    public void createBiocaseProviderTab(Composite parent){
428
        composite = addTab(Messages.DatabasePreferencesPage_Biocase_Provider);
429
        nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
430
       List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
431
               .getSupportedCodes();
432
        for (NomenclaturalCode code: supportedCodes) {
433
            nomenclaturalCodeCombo.add(NomenclaturalCodeHelper
434
                    .getDescription(code));
435

  
436
        }
437
        getLabelAndValues();
438
        //get the actual nomenclatural code and set it as selection: doGetPreferenceStore().getString(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY);
439
        nomenclaturalCodeCombo.addSelectionListener(new SelectionAdapter() {
440
            @Override
441
         public void widgetSelected(SelectionEvent evt) {
442

  
443
                String name = nomenclaturalCodeCombo.getText();
444
                String selectedPreferenceKey = null;
445
                for (String[] labelAndValue: labelAndValues){
446
                    if (labelAndValue[0].equals(name)){
447
                        selectedPreferenceKey = labelAndValue[1];
448
                    }
449
                }
450

  
451

  
452
                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY, selectedPreferenceKey);
453

  
454
            }
455
        });
456
        nomenclaturalCodeLabel = new Label(composite, SWT.READ_ONLY);
457

  
458

  
459
         final Button useLocalPreference = new Button(composite, SWT.CHECK);
460
         boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY);
461
         useLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
462
         useLocalPreference.setSelection(isUseLocalPreference);
463
         useLocalPreference.addSelectionListener(new SelectionAdapter(){
464
              @Override
465
              public void widgetSelected(SelectionEvent e) {
466
                  boolean isUseLocalPreference = useLocalPreference.getSelection();
467
                  PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY, isUseLocalPreference);
468
               }
469
          });
470

  
471

  
472

  
473

  
474
 }
475

  
412 476

  
413 477
    public void createSpecimenOrObservationTab(Composite parent){
414
        composite = addTab("Specimen or Observation");
478
        composite = addTab(Messages.DatabasePreferencesPage_Specimen_Or_Observation);
415 479

  
416 480
        final Button showCollectingAreaInGeneralSectionButton = new Button(composite, SWT.CHECK);
417 481
        boolean isShowCollectingAreaInGeneralSection = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION);

Also available in: Unified diff