this.isShowSpecimenRelatedIssues = Boolean.valueOf(showSpecimenPref.getValue());
this.allowOverrideShowSpecimenRelatedIssues = showSpecimenPref.isAllowOverride();
}else{
- showSpecimenPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(true));
- this.isShowSpecimenRelatedIssues = true;
+ //showSpecimenPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(true));
+// this.isShowSpecimenRelatedIssues = true;
this.allowOverrideShowSpecimenRelatedIssues = true;
}
this.isShowCollectingAreaInGeneralSection = Boolean.valueOf(isShowCollectingAreaInGeneralSectionPref.getValue());
this.allowOverrideShowCollectingAreaInGeneralSection = isShowCollectingAreaInGeneralSectionPref.isAllowOverride();
}else{
- this.isShowCollectingAreaInGeneralSection = (Boolean) PreferencePredicate.ShowCollectingAreasInGeneralSection.getDefaultValue();
+// this.isShowCollectingAreaInGeneralSection = (Boolean) PreferencePredicate.ShowCollectingAreasInGeneralSection.getDefaultValue();
this.allowOverrideShowCollectingAreaInGeneralSection = true;
}
this.isDeterminationOnlyForFieldUnits = Boolean.valueOf(isDeterminationOnlyForFieldUnitsPref.getValue());
this.allowOverrideDeterminationOnlyForFieldUnits = isDeterminationOnlyForFieldUnitsPref.isAllowOverride();
}else{
- this.isDeterminationOnlyForFieldUnits =(Boolean)PreferencePredicate.DeterminationOnlyForFieldUnits.getDefaultValue();
+// this.isDeterminationOnlyForFieldUnits =(Boolean)PreferencePredicate.DeterminationOnlyForFieldUnits.getDefaultValue();
this.allowOverrideDeterminationOnlyForFieldUnits = true;
}
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonAssociations);
this.isShowTaxonAssociation = Boolean.valueOf(isShowTaxonAssociationPref.getValue());
this.allowOverrideShowTaxonAssociation = isShowTaxonAssociationPref.isAllowOverride();
}else{
- this.isShowTaxonAssociation = (Boolean)PreferencePredicate.ShowTaxonAssociations.getDefaultValue();
+// this.isShowTaxonAssociation = (Boolean)PreferencePredicate.ShowTaxonAssociations.getDefaultValue();
this.allowOverrideShowTaxonAssociation = true;
}
this.isShowLifeForm = Boolean.valueOf(isShowLifeFormPref.getValue());
this.allowOverrideShowLifeForm = isShowLifeFormPref.isAllowOverride();
} else{
- this.isShowLifeForm = (Boolean)PreferencePredicate.ShowLifeForm.getDefaultValue();
+// this.isShowLifeForm = (Boolean)PreferencePredicate.ShowLifeForm.getDefaultValue();
this.allowOverrideShowLifeForm = true;
}
@Override
public boolean performOk() {
- if (showSpecimenPref == null){
+ if (!isApply()){
return true;
}
ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration();
if (controller != null){
IPreferenceService service = controller.getPreferenceService();
+ CdmPreference pref;
+ if (isShowCollectingAreaInGeneralSection == null){
+ service.remove(CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowCollectingAreasInGeneralSection));
+ }else{
+ pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowCollectingAreasInGeneralSection, Boolean.toString(this.isShowCollectingAreaInGeneralSection));
+ pref.setAllowOverride(allowOverrideShowCollectingAreaInGeneralSection);
+ service.set(pref);
+ }
+ if (isShowSpecimenRelatedIssues == null){
+ service.remove(CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowSpecimen));
+ }else{
+ pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(this.isShowSpecimenRelatedIssues));
+ pref.setAllowOverride(allowOverrideShowSpecimenRelatedIssues);
+ service.set(pref);
+ }
- CdmPreference pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowCollectingAreasInGeneralSection, Boolean.toString(this.isShowCollectingAreaInGeneralSection));
- pref.setAllowOverride(allowOverrideShowCollectingAreaInGeneralSection);
- service.set(pref);
- pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(this.isShowSpecimenRelatedIssues));
- pref.setAllowOverride(allowOverrideShowSpecimenRelatedIssues);
- service.set(pref);
-
- pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.DeterminationOnlyForFieldUnits, Boolean.toString(this.isDeterminationOnlyForFieldUnits));
- pref.setAllowOverride(allowOverrideDeterminationOnlyForFieldUnits);
- service.set(pref);
-
- pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowTaxonAssociations, Boolean.toString(this.isShowTaxonAssociation));
- pref.setAllowOverride(allowOverrideShowTaxonAssociation);
- service.set(pref);
-
- pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowLifeForm, Boolean.toString(this.isShowLifeForm));
- pref.setAllowOverride(allowOverrideShowLifeForm);
- service.set(pref);
+ if (isDeterminationOnlyForFieldUnits == null){
+ service.remove(CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.DeterminationOnlyForFieldUnits));
+ }else{
+ pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.DeterminationOnlyForFieldUnits, Boolean.toString(this.isDeterminationOnlyForFieldUnits));
+ pref.setAllowOverride(allowOverrideDeterminationOnlyForFieldUnits);
+ service.set(pref);
+ }
+ if (isShowTaxonAssociation == null){
+ service.remove(CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonAssociations));
+ }else{
+ pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowTaxonAssociations, Boolean.toString(this.isShowTaxonAssociation));
+ pref.setAllowOverride(allowOverrideShowTaxonAssociation);
+ service.set(pref);
+ }
+ if (isShowLifeForm == null){
+ service.remove(CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowLifeForm));
+ }else{
+ pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowLifeForm, Boolean.toString(this.isShowLifeForm));
+ pref.setAllowOverride(allowOverrideShowLifeForm);
+ service.set(pref);
+ }
PreferencesUtil.updateDBPreferences();