Project

General

Profile

« Previous | Next » 

Revision e8cc5fb9

Added by Patrick Plitzner over 9 years ago

  • added preference for showing Collecting Areas below Country in DetailsView (#4473)

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
119 119

  
120 120
    public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
121 121

  
122
    public static final String SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION = "eu.etaxonomy.taxeditor.specimen.showCollectingAreasInGeneralSection";
123

  
122 124

  
123 125
    public static final String DISTRIBUTION_AREA_PREFRENCES_ACTIVE = "eu.etaxonomy.taxeditor.checklist.distributionAreaPreferencesActive";
124 126

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
37 37
        addField(new BooleanFieldEditor(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS,
38 38
                "Taxon determination only on FieldUnit level",
39 39
                getFieldEditorParent()));
40
        addField(new BooleanFieldEditor(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION,
41
                "Show \"Collecting Areas\" in \"General\" section of details view",
42
                getFieldEditorParent()));
40 43

  
41 44
    }
42 45

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailElement.java
16 16
import eu.etaxonomy.cdm.model.common.LanguageString;
17 17
import eu.etaxonomy.cdm.model.location.NamedArea;
18 18
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
19
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
20
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
19 21
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
20 22
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
21 23
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
......
74 76
        combo_specorobstype.setSelection(entity.getType());
75 77
        selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(), formElement,
76 78
                "Country", entity.getCountry(), EntitySelectionElement.NOTHING, style);
77

  
78
        section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
79
        section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
80
        section_collectingAreas.setEntity(entity);
79
        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION)){
80
            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
81
            section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
82
            section_collectingAreas.setEntity(entity);
83
        }
81 84

  
82 85
        languageText_locality = formFactory.createLanguageStringWithLabelElement(formElement, "Locality",
83 86
                entity.getLocality(), style);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java
10 10

  
11 11
package eu.etaxonomy.taxeditor.ui.section.occurrence;
12 12

  
13
import org.eclipse.ui.forms.widgets.ExpandableComposite;
14

  
13 15
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
16
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
17
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
14 18
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
15 19
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
16 20
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
21
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
17 22
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection;
18 23
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
19 24
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
......
40 45

  
41 46
	private TextWithLabelElement text_gatheringEventDescription;
42 47

  
48
	private CollectingAreasDetailSection section_collectingAreas;
49

  
43 50
	/**
44 51
	 * <p>
45 52
	 * Constructor for GatheringEventDetailElement.
......
60 67
	/** {@inheritDoc} */
61 68
	@Override
62 69
	protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
63
        text_collectingMethod = formFactory.createTextWithLabelElement(formElement, "Collecting Method", entity.getCollectingMethod(), style);
70

  
71
	    text_collectingMethod = formFactory.createTextWithLabelElement(formElement, "Collecting Method", entity.getCollectingMethod(), style);
64 72

  
65 73
        text_gatheringEventDescription = formFactory.createTextWithLabelElement(
66 74
        		formElement, "Gathering Event Description", entity.getGatheringEventDescription(), style);
......
71 79
		element_distToWater = formFactory.createGatheringEventUnitElement(
72 80
				formElement, "Dist. To Watersurface : ", entity, MinMaxTextSection.UnitType.DIST_TO_WATER,  style);
73 81

  
82

  
83
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION)){
84
            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
85
            section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
86
            section_collectingAreas.setEntity(entity);
87
        }
88

  
74 89
	}
75 90

  
76 91
	/** {@inheritDoc} */

Also available in: Unified diff