class="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
id="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
namespace="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
- properties="isShowExperimentalFeatures, isChecklistEditorEnabled, isShowIOMenuEnabled, isShowSpecimenMenuEnabled"
+ properties="isShowExperimentalFeatures, isChecklistEditorEnabled, isShowIOMenuEnabled, isShowSpecimenMenuEnabled, isShowSpecimenListMenuEnabled"
type="java.lang.Object">
</propertyTester>
<propertyTester
property="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester.isShowSpecimenMenuEnabled">
</test>
</definition>
+ <definition
+ id="isShowSpecimenListMenuEnabled">
+ <test
+ property="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester.isShowSpecimenListMenuEnabled">
+ </test>
+ </definition>
<definition
id="isModifiable">
<with
name="%page.name.105">
</page>
<page
- category="eu.etaxonomy.taxeditor.preference.DistributionGeneralPreference"
+ category="eu.etaxonomy.taxeditor.preference.UIPreferences"
class="eu.etaxonomy.taxeditor.preference.DistributionDetailsViewPreference"
id="eu.etaxonomy.taxeditor.preference.DistributionDetailsViewPreference"
name="%page.name.107">
id="eu.etaxonomy.taxeditor.store.checklist"
name="%page.name.21">
</page>
+ <page
+ category="eu.etaxonomy.taxeditor.store.UIAdminPreference"
+ class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.DistributionDetailsViewAdminPreference"
+ id="eu.etaxonomy.taxeditor.preference.DistributionDetailsViewPreference"
+ name="%page.name.107">
+ </page>
<page
category="eu.etaxonomy.taxeditor.store.Distribution"
class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.DistributionStatusAdminPreference"
protected Boolean isShowLifeForm;
protected boolean allowOverrideShowLifeForm;
protected boolean overrideShowLifeForm;
+ protected Boolean isShowListEditor;
+ protected boolean allowOverrideShowListEditor;
+ protected boolean overrideShowListEditor;
+
Composite composite;
protected Combo showSpecimenButton;
protected Button allowOverrideIsShowTaxonAssociationButton;
protected Button allowOverrideShowLifeFormButton;
protected Combo showLifeFormButton;
+ protected Button allowOverrideShowListEditorButton;
+ protected Combo showListEditorButton;
CdmPreference showSpecimenPref;
CdmPreference showCollectingAreaInGeneralSection;
CdmPreference showDeterminationOnlyForFieldUnits;
CdmPreference showTaxonAssociation;
CdmPreference showLifeForm;
+ CdmPreference showListEditor;
@Override
public void init() {
separator= new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
separator.setLayoutData(gridData);
+ showListEditorButton = createBooleanCombo(composite, Messages.GeneralPreference_yes, Messages.GeneralPreference_no, PreferencePredicate.ShowSpecimenListEditor, Messages.DatabasePreferncesPage_Show_Specimen_List_Editor, isAdminPreference);
+
+ showListEditorButton.addSelectionListener(this);
+ index = 0;
+ for (String itemLabel : showListEditorButton.getItems()) {
+ if (isShowListEditor == null && itemLabel.startsWith(Messages.Preference_Use_Default)) {
+ showListEditorButton.select(index);
+ break;
+ }
+ if (isShowListEditor != null && itemLabel.equals(Messages.GeneralPreference_yes) && isShowListEditor){
+ showListEditorButton.select(index);
+ break;
+ }
+ if (isShowListEditor != null && itemLabel.equals(Messages.GeneralPreference_no) && !isShowListEditor){
+ showListEditorButton.select(index);
+ break;
+ }
+ index++;
+ }
+ if (isAdminPreference){
+ allowOverrideShowListEditorButton = createAllowOverrideButton(composite);
+ allowOverrideShowListEditorButton.setSelection(allowOverrideShowListEditor);
+// allowOverrideShowCollectingAreaButton.setEnabled(isShowCollectingAreaInGeneralSection != null);
+ allowOverrideShowListEditorButton.addSelectionListener(new SelectionAdapter(){
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setApply(true);
+ allowOverrideShowListEditor = allowOverrideShowListEditorButton.getSelection();
+ }
+ });
+ }
+ isEditingAllowed = true;
+ if (showListEditor != null && !showListEditor.isAllowOverride() ){
+ isEditingAllowed = false;
+ }
+ showListEditorButton.setEnabled(isEditingAllowed);
+
showCollectingAreaInGeneralSectionButton = createBooleanCombo(composite, Messages.GeneralPreference_yes, Messages.GeneralPreference_no, PreferencePredicate.ShowCollectingAreasInGeneralSection, Messages.DatabasePreferncesPage_Show_Collecting_Areas_in_general_section, isAdminPreference);
showCollectingAreaInGeneralSectionButton.addSelectionListener(this);
showSpecimenPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, PreferencePredicate.ShowSpecimen.getDefaultValue() != null ? PreferencePredicate.ShowSpecimen.getDefaultValue().toString(): null);
}
+ key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowSpecimenListEditor);
+ showListEditor = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowSpecimenListEditor);
+
+ overrideShowListEditor = PreferencesUtil.getBooleanValue(
+ PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowSpecimenListEditor.getKey()), true) != null? PreferencesUtil.getBooleanValue(
+ PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowSpecimenListEditor.getKey()), true): false;
+ if (showListEditor != null) {
+ if (showListEditor.isAllowOverride() ) {
+ if (overrideShowListEditor){
+ isShowListEditor = PreferencesUtil.getBooleanValue(PreferencePredicate.ShowSpecimenListEditor.getKey(), true);
+ }
+ } else {
+ isShowListEditor = Boolean.valueOf(showListEditor.getValue());
+ }
+
+ } else {
+ if(!overrideShowListEditor){
+ isShowListEditor = null;
+ }else{
+ isShowListEditor = PreferencesUtil.getBooleanValue(PreferencePredicate.ShowSpecimenListEditor.getKey(), true);
+ }
+ showListEditor = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimenListEditor, PreferencePredicate.ShowSpecimenListEditor.getDefaultValue() != null ? PreferencePredicate.ShowSpecimenListEditor.getDefaultValue().toString(): null);
+ }
PreferencesUtil.setBooleanValue(
PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowSpecimen.getKey()),
override);
+ override = false;
+ if (isShowListEditor != null ) {
+ override = true;
+ PreferencesUtil.setStringValue(PreferencePredicate.ShowSpecimenListEditor.getKey(), isShowListEditor.toString());
+ }
+ PreferencesUtil.setBooleanValue(
+ PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowSpecimenListEditor.getKey()),
+ override);
override = false;
if (isShowCollectingAreaInGeneralSection != null ) {
allowOverrideShowSpecimenRelatedIssues = true;
allowOverrideIsShowSpecimenRelatedIssuesButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
}
+
+ isShowListEditor = null;
+ showListEditorButton.select(0);
+
+ if (allowOverrideShowListEditorButton != null){
+ allowOverrideShowListEditor = true;
+ allowOverrideShowListEditorButton.setSelection(allowOverrideShowListEditor);
+ }
+
isShowCollectingAreaInGeneralSection = null;
showCollectingAreaInGeneralSectionButton.select(0);
if (allowOverrideShowCollectingAreaButton != null){
allowOverrideShowCollectingAreaInGeneralSection = true;
- allowOverrideShowCollectingAreaButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
+ allowOverrideShowCollectingAreaButton.setSelection(allowOverrideShowCollectingAreaInGeneralSection);
}
isDeterminationOnlyForFieldUnits = null;
determinationOnlyForFieldUnitsButton.select(0);
if (allowOverridesDeterminationOnlyForFieldUnitsButton != null){
allowOverrideDeterminationOnlyForFieldUnits = true;
- allowOverridesDeterminationOnlyForFieldUnitsButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
+ allowOverridesDeterminationOnlyForFieldUnitsButton.setSelection(allowOverrideDeterminationOnlyForFieldUnits);
}
isShowTaxonAssociation = null;
if (allowOverrideIsShowTaxonAssociationButton != null){
allowOverrideShowTaxonAssociation = true;
- allowOverrideIsShowTaxonAssociationButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
+ allowOverrideIsShowTaxonAssociationButton.setSelection(allowOverrideShowTaxonAssociation);
}
if (allowOverrideShowLifeFormButton != null){
allowOverrideShowLifeForm = true;
- allowOverrideShowLifeFormButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
+ allowOverrideShowLifeFormButton.setSelection(allowOverrideShowLifeForm);
}
setApply(true);
}
}
+ if (e.getSource().equals(this.showListEditorButton)) {
+ String text = showListEditorButton.getText();
+ if(text.startsWith(Messages.Preference_Use_Default)){
+ isShowListEditor = null;
+ return;
+ }
+
+ if (text.equals(Messages.GeneralPreference_yes)){
+ isShowListEditor = true;
+ }else{
+ isShowListEditor = false;
+ }
+ }
+
if (e.getSource().equals(this.showCollectingAreaInGeneralSectionButton)) {
String text = showCollectingAreaInGeneralSectionButton.getText();
if(text.startsWith(Messages.Preference_Use_Default)){