import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.service.IPreferenceService;
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
import eu.etaxonomy.taxeditor.l10n.Messages;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
-import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
/**
if (pref == null){
return true;
}
- ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration();
- if(controller!=null){
- IPreferenceService service = controller.getPreferenceService();
+ PreferencesUtil.updateDBPreferences();
- CdmPreference pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.CommonNameAreaVocabularies);
- if(pref==null){
- pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.CommonNameAreaVocabularies, "");
- }
- pref.setAllowOverride(allowOverride);
- service.set(pref);
-
- PreferencesUtil.updateDBPreferences();
- }
return true;
}
import org.eclipse.swt.widgets.Composite;
import eu.etaxonomy.taxeditor.l10n.Messages;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
// NameDetailsConfigurator config = PreferencesUtil.setPreferredNameDetailsConfiguration(local)
final Button allowLocalPreference = new Button(this, SWT.CHECK);
- boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS);
- allowLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
- allowLocalPreference.setSelection(isUseLocalPreference);
- allowLocalPreference.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isUseLocalPreference = allowLocalPreference.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS, isUseLocalPreference);
- }
- });
+// boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS);
+// allowLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
+// allowLocalPreference.setSelection(isUseLocalPreference);
+// allowLocalPreference.addSelectionListener(new SelectionAdapter(){
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// boolean isUseLocalPreference = allowLocalPreference.getSelection();
+// PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS, isUseLocalPreference);
+// }
+// });
isSimpleDetailsViewActivated= config.isSimpleDetailsViewActivated();
AbcdImportPreference_allow_override_tooltip=It is allowed to change this preference locally.
AbcdImportProvider_description=Configure the default list of biocase provider for the specimen search
-AvailableAreaVocabulariesPage_PAGE_DESCRIPTION=In order to see or modify the %s of taxa,\nyou have to select the vocabularies to select the available areas from.
+AvailableAreaVocabulariesPage_PAGE_DESCRIPTION=Select vocabularies to select the available areas from.
AvailableAreaVocabulariesPage_PAGE_TITLE=Select Vocabularies for %s
AvailableDistributionPage_CHECK_MESSAGE=Please check at least one item
AvailableDistributionPage_PAGE_DESCRIPTION=In order to see and modify distribution status of taxa\nyou have to select the areas which you like to see/modify.
AvailableDistributionPage_PAGE_TITLE=Select areas for Distribution Editor
-AvailableDistributionStatusPage_PAGE_DESCRIPTION=To modify the distribution status for taxa in a given area\nyou may preselect the available status list.
+AvailableDistributionStatusPage_PAGE_DESCRIPTION=Choose available status in distribution editor.\nIf no status is selected all status are available.
AvailableDistributionStatusPage_PAGE_TITLE=Select Distribution Status
AvailableDistributionStatusWizard_PAGE_TITLE=Available Distribution Status
AvailableDistributionStatusWizard_WINDOW_TITLE=Distribution Status Selection
AbcdImportPreference_allow_override_tooltip=Es dürfen lokale Änderungen an den Präferenzen vorgenommen werden.
AbcdImportProvider_description=Konfiguration einer Liste von Biocase Providern für die Specimen Suche
-AvailableAreaVocabulariesPage_PAGE_DESCRIPTION=Um %s von Taxa anzuzeigen oder zu bearbeiten,\nmuss das Vokabular ausgewählt werden, von dem die Gebiete ausgewählt werden sollen.
+AvailableAreaVocabulariesPage_PAGE_DESCRIPTION=Auswahl der Vokabulare, aus denen die Gebiete für %s ausgewählt werden sollen.
AvailableAreaVocabulariesPage_PAGE_TITLE=Vokabular für %s auswählen
AvailableDistributionPage_CHECK_MESSAGE=Bitte wählen Sie mindestens einen Eintrag aus
AvailableDistributionPage_PAGE_DESCRIPTION=Um den Verbreitungsstatus von Taxa anzuzeigen und zu bearbeiten,\n muss das Gebiet ausgewählt werden, dass angezeigt/bearbeitet werden soll.
AvailableDistributionPage_PAGE_TITLE=Auswahl der zur Verf\u00FCgung stehenden Gebiete für den Verbreitungs-Editor
-AvailableDistributionStatusPage_PAGE_DESCRIPTION=Um den Verbreitungsstatus für Taxa in einem bestimmten Gebiet zu bearbeiten,\nkönnen Sie die Liste der verfügbare Status auswählen.
+AvailableDistributionStatusPage_PAGE_DESCRIPTION=Auswahl der im Verbreitungseditor zu Verf\u00FCgung stehenden Status.\nWenn kein Status ausgewählt ist, werden alle Status angezeigt.
AvailableDistributionStatusPage_PAGE_TITLE=Verbreitungsstatus auswählen
AvailableDistributionStatusWizard_PAGE_TITLE=Verfügbare Verbreitungsstatus
AvailableDistributionStatusWizard_WINDOW_TITLE=Verbreitungsstatus auswählen
return null;
}
- setBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS, preference.isAllowOverride());
+ // setBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS, preference.isAllowOverride());
value = preference.getValue();
config.setAllowOverride(preference.isAllowOverride());
//the preference value is build like this:
//Name Details
NameDetailsConfigurator config = getPreferredNameDetailsConfiguration(false);
- if (config != null ){
- if (!getBooleanValue(OVERRIDE_NAME_DETAILS) || !getBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS)){
- setPreferredNameDetailsConfiguration(config, false);
- }
- }
+// if (config != null ){
+// if (!getBooleanValue(OVERRIDE_NAME_DETAILS) || !getBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS)){
+// setPreferredNameDetailsConfiguration(config, false);
+// }
+// }
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
import eu.etaxonomy.taxeditor.preference.CdmPreferenceCache;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
}
private static UUID[] createVocabularyUuidList() {
- String preselectedVocString = PreferencesUtil.getStringValue(IPreferenceKeys.COMMON_NAME_AREA_VOCABULARIES);
+ String preselectedVocString = PreferencesUtil.getStringValue(PreferencePredicate.CommonNameAreaVocabularies.getKey());
if (StringUtils.isBlank(preselectedVocString)){
return null;
}
import java.util.List;
import java.util.UUID;
-import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.Dialog;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.metadata.CdmPreference;
-import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
selectedVocabularies = new ArrayList<TermVocabulary>();
this.preferenceID = preferenceId;
- if (preselectedVocabularyUuids == null || preselectedVocabularyUuids.length == 0){
- preselectedVocabularyUuids = createVocabularyUuidList();
- }
- if (preselectedVocabularyUuids != null){
+
+ if (preselectedVocabularyUuids != null && preselectedVocabularyUuids.length > 0){
for(int i=0;i<preselectedVocabularyUuids.length;i++){
TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
selectedVocabularies.add(preselectedVocabulary);
}
+ }else{
+ selectedVocabularies = createSelectedVocabularies();
}
-
- selectedVocabularies = createSelectedVocabularies();
-
}
protected List<TermVocabulary> createSelectedVocabularies() {
return tempSelectedVocabularies;
}
- private static UUID[] createVocabularyUuidList() {
- String preselectedVocString = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
- if (StringUtils.isBlank(preselectedVocString)){
- return null;
- }
- String[] preselectedVocArray = preselectedVocString.split(";");
- UUID[] uuidList = new UUID[preselectedVocArray.length];
- int i = 0;
- for (String uuidString: preselectedVocArray){
- uuidList[i]= UUID.fromString(uuidString);
- i++;
- }
- return uuidList;
- }
+// private static UUID[] createVocabularyUuidList() {
+// String preselectedVocString = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
+// if (StringUtils.isBlank(preselectedVocString)){
+// return null;
+// }
+// String[] preselectedVocArray = preselectedVocString.split(";");
+// UUID[] uuidList = new UUID[preselectedVocArray.length];
+// int i = 0;
+// for (String uuidString: preselectedVocArray){
+// uuidList[i]= UUID.fromString(uuidString);
+// i++;
+// }
+// return uuidList;
+// }
private String getPrefKey(TermVocabulary vocabulary){
private List<TermVocabulary> getAvailableVocabularies(){
vocabularies = new ArrayList();
CdmPreferenceCache cache = CdmPreferenceCache.instance();
- CdmPreference pref = cache.get(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
- if (pref != null && !pref.isAllowOverride()){
- UUID[] preselectedVocabularyUuids = createVocabularyUuidList();
-
- for(int i=0;i<preselectedVocabularyUuids.length;i++){
- TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
- vocabularies.add(preselectedVocabulary);
- }
- }else{
+// CdmPreference pref = cache.get(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
+// if (pref != null && !pref.isAllowOverride()){
+// UUID[] preselectedVocabularyUuids = createVocabularyUuidList();
+//
+// for(int i=0;i<preselectedVocabularyUuids.length;i++){
+// TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
+// vocabularies.add(preselectedVocabulary);
+// }
+// }else{
vocabularies = CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null);
- }
+// }
//List<TermVocabulary> vocabularies = CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null);
return vocabularies;
}
}
private void createTaxonSections(RootElement parent) {
- NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
+ NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration();
ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
getSectionStyle(ParsingMessagesSection.class, true));
if (!config.isSimpleDetailsViewActivated()){