Revision 4afd9d97
Added by Alexander Oppermann over 9 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java | ||
---|---|---|
16 | 16 |
import java.util.Set; |
17 | 17 |
import java.util.UUID; |
18 | 18 |
|
19 |
import org.eclipse.jface.dialogs.Dialog; |
|
20 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
19 |
import org.apache.commons.lang.StringUtils; |
|
21 | 20 |
import org.eclipse.jface.preference.IPreferenceStore; |
22 | 21 |
import org.eclipse.swt.widgets.Shell; |
22 |
import org.eclipse.ui.PlatformUI; |
|
23 | 23 |
|
24 | 24 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeConfigurator; |
25 | 25 |
import eu.etaxonomy.cdm.api.service.IFeatureTreeService; |
... | ... | |
43 | 43 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
44 | 44 |
import eu.etaxonomy.taxeditor.model.NomenclaturalCodeHelper; |
45 | 45 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
46 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
|
46 | 47 |
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin; |
48 |
import eu.etaxonomy.taxeditor.ui.dialog.DefaultLanguageDialog; |
|
47 | 49 |
|
48 | 50 |
/** |
49 | 51 |
* <p> |
... | ... | |
107 | 109 |
return null; |
108 | 110 |
} |
109 | 111 |
|
112 |
public static String getPreferredDefaultLangugae(){ |
|
113 |
String preferredLanguage = getPreferenceStore().getString(DEFAULT_LANGUAGE_EDITOR); |
|
114 |
if(StringUtils.isNotEmpty(preferredLanguage) && StringUtils.isNotBlank(preferredLanguage)){ |
|
115 |
return preferredLanguage; |
|
116 |
} |
|
117 |
return null; |
|
118 |
} |
|
119 |
|
|
110 | 120 |
/** |
111 | 121 |
* Get the match strategy for the given class that was stored in preferences |
112 | 122 |
* or the default strategy if it was not stored in preferences |
... | ... | |
378 | 388 |
*/ |
379 | 389 |
public static void checkNomenclaturalCode() { |
380 | 390 |
// First time Editor is opened, no nomenclatural code has been set |
381 |
|
|
382 |
|
|
391 |
|
|
392 |
|
|
383 | 393 |
if (PreferencesUtil.getPreferredNomenclaturalCode() == null) { |
384 | 394 |
PreferencesUtil.setPreferredNomenclaturalCode(NomenclaturalCode.ICNAFP); |
385 | 395 |
/* |
... | ... | |
406 | 416 |
} |
407 | 417 |
} |
408 | 418 |
|
419 |
public static void checkDefaultLanguage(){ |
|
420 |
if(PreferencesUtil.getPreferredDefaultLangugae() == null){ |
|
421 |
Shell shell = StoreUtil.getShell(); |
|
422 |
int open = new DefaultLanguageDialog(shell).open(); |
|
423 |
if(open == 0){//FIXME:window performed ok. Find variable for it |
|
424 |
PlatformUI.getWorkbench().restart(); |
|
425 |
} |
|
426 |
}else{ |
|
427 |
//TODO:In case of a reinstall, the config.ini will be overwritten |
|
428 |
// here you create config.ini with the stored key from preferences |
|
429 |
} |
|
430 |
} |
|
431 |
|
|
409 | 432 |
/** |
410 | 433 |
* <p> |
411 | 434 |
* getMapServiceAccessPoint |
Also available in: Unified diff
Added Default Language Selection for the TaxonomicEditor to fix #4358