944 |
944 |
getPreferenceStore().setValue(CHECKLIST_SHOW_RANK, selection);
|
945 |
945 |
}
|
946 |
946 |
|
|
947 |
/**
|
|
948 |
* @param object
|
|
949 |
* @param b
|
|
950 |
* @return
|
|
951 |
*/
|
|
952 |
public static NameDetailsConfigurator setPreferredNameDetailsConfiguration( boolean local) {
|
|
953 |
NameDetailsConfigurator config = new NameDetailsConfigurator(true);
|
|
954 |
ICdmApplicationConfiguration controller;
|
|
955 |
controller = CdmStore.getCurrentApplicationConfiguration();
|
|
956 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.NameDetailsView);
|
|
957 |
CdmPreference preference = null;
|
|
958 |
if (controller == null){
|
|
959 |
return null;
|
|
960 |
}
|
|
961 |
preference = controller.getPreferenceService().find(key);
|
|
962 |
if (preference == null){
|
|
963 |
return null;
|
|
964 |
}
|
|
965 |
getPreferenceStore().setValue(ALLOW_OVERRIDE_NAMEDETAILS, preference.isAllowOverride());
|
|
966 |
|
|
967 |
//the preference value is build like this:
|
|
968 |
//<section1>:true;<section2>:false....
|
|
969 |
|
|
970 |
String value = preference.getValue();
|
|
971 |
String [] sections = value.split(";");
|
|
972 |
Map<String, Boolean> sectionMap = new HashMap<String, Boolean>();
|
|
973 |
String[] sectionValues;
|
|
974 |
for (String sectionValue: sections){
|
|
975 |
sectionValues = sectionValue.split(":");
|
|
976 |
sectionMap.put(sectionValues[0], Boolean.valueOf(sectionValues[1]));
|
|
977 |
}
|
|
978 |
|
|
979 |
|
|
980 |
|
|
981 |
getPreferenceStore().setValue(SHOW_SIMPLE_NAME_DETAILS_TAXON,
|
|
982 |
(sectionMap.get("taxon")));
|
|
983 |
config.setTaxonSectionActivated(sectionMap.get("taxon"));
|
|
984 |
|
|
985 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_LSID,
|
|
986 |
(sectionMap.get("lsid")));
|
|
987 |
config.setLSIDActivated(sectionMap.get("lsid"));
|
|
988 |
|
|
989 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE,
|
|
990 |
(sectionMap.get("nc")));
|
|
991 |
config.setNomenclaturalCodeActived(sectionMap.get("nc"));
|
|
992 |
|
|
993 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE,
|
|
994 |
(sectionMap.get("ap")));
|
|
995 |
config.setAppendedPhraseActivated(sectionMap.get("ap"));
|
|
996 |
|
|
997 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_RANK,
|
|
998 |
(sectionMap.get("rank")));
|
|
999 |
config.setRankActivated(sectionMap.get("rank"));
|
|
1000 |
|
|
1001 |
|
|
1002 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS,
|
|
1003 |
(sectionMap.get("atomisedEpithets")));
|
|
1004 |
config.setAtomisedEpithetsActivated(sectionMap.get("atomisedEpithets"));
|
|
1005 |
|
|
1006 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP,
|
|
1007 |
(sectionMap.get("author")));
|
|
1008 |
config.setAuthorshipSectionActivated(sectionMap.get("author"));
|
|
1009 |
|
|
1010 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE,
|
|
1011 |
(sectionMap.get("nomRef")));
|
|
1012 |
config.setNomenclaturalReferenceSectionActivated(sectionMap.get("nomRef"));
|
|
1013 |
|
|
1014 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS,
|
|
1015 |
(sectionMap.get("nomStat")));
|
|
1016 |
config.setNomenclaturalStatusSectionActivated(sectionMap.get("nomStat"));
|
|
1017 |
|
|
1018 |
|
|
1019 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE,
|
|
1020 |
(sectionMap.get("protologue")));
|
|
1021 |
config.setProtologueActivated(sectionMap.get("protologue"));
|
|
1022 |
|
|
1023 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION,
|
|
1024 |
(sectionMap.get("typeDes")));
|
|
1025 |
config.setTypeDesignationSectionActivated(sectionMap.get("typeDes"));
|
|
1026 |
|
|
1027 |
getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP,
|
|
1028 |
(sectionMap.get("nameRelation")));
|
|
1029 |
config.setNameRelationsSectionActivated(sectionMap.get("nameRelation"));
|
|
1030 |
|
|
1031 |
return config;
|
|
1032 |
}
|
|
1033 |
|
947 |
1034 |
}
|
missing changes