Project

General

Profile

« Previous | Next » 

Revision e42715ba

Added by Patrick Plitzner over 10 years ago

  • adapted detail views to new cdm3.3 model

View differences:

.gitattributes
1237 1237
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/compatibility/IEntitySelectionElement.java -text
1238 1238
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsElement.java -text
1239 1239
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsElementController.java -text
1240
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsSection.java -text
1240 1241
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsView.java -text
1241 1242
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralElement.java -text
1242 1243
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralElementController.java -text
1243
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationSection.java -text
1244
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralSection.java -text
1244 1245
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElement.java -text
1245 1246
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElementController.java -text
1247
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventSection.java -text
1246 1248
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenGeneralElement.java -text
1247 1249
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenGeneralElementController.java -text
1248 1250
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsElementController.java
9 9
 */
10 10
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
11 11

  
12
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
13
import eu.etaxonomy.taxeditor.store.CdmStore;
12
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
14 13
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
15 14
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
16 15
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
......
22 21
 * @date 15.08.2013
23 22
 *
24 23
 */
25
public class FieldObservationDetailsElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
24
public class FieldObservationDetailsElementController extends AbstractCdmDetailElement<FieldUnit> {
26 25

  
27 26
    private FieldObservationDetailsElement fieldObservationDetailsElement;
28 27

  
......
55 54

  
56 55
    /** {@inheritDoc} */
57 56
    @Override
58
    protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
59
        text_ecology = new TextFieldController(fieldObservationDetailsElement.getText_ecology(), getFormFactory(), formElement, entity.getEcology(CdmStore.getDefaultLanguage()), null);
60
        text_plantDescription = new TextFieldController(fieldObservationDetailsElement.getText_plantDescription(), getFormFactory(), formElement, entity.getPlantDescription(CdmStore.getDefaultLanguage()), style);
57
    protected void createControls(ICdmFormElement formElement, FieldUnit entity, int style) {
58
//        text_ecology = new TextFieldController(fieldObservationDetailsElement.getText_ecology(), getFormFactory(), formElement, entity.getEcology(CdmStore.getDefaultLanguage()), null);
59
//        text_plantDescription = new TextFieldController(fieldObservationDetailsElement.getText_plantDescription(), getFormFactory(), formElement, entity.getPlantDescription(CdmStore.getDefaultLanguage()), style);
61 60
        // Disable for now
62 61
        // text_fieldObjectDefinition = formFactory.createTextWithLabelElement(formElement, "Field Object Definition", entity.getFieldObjectDefinition(CdmStore.getDefaultLanguage()), style);
63 62
        text_fieldNotes = new TextFieldController(fieldObservationDetailsElement.getText_FieldNotes(), getFormFactory(), formElement, entity.getFieldNotes(), style);
......
68 67
    /** {@inheritDoc} */
69 68
    @Override
70 69
    public void handleEvent(Object eventSource) {
71
        if (eventSource == text_ecology) {
72
            getEntity().setEcology(text_ecology.getText());
73
        } else if (eventSource == text_plantDescription) {
74
            getEntity().setPlantDescription(text_plantDescription.getText());
75
        } else if (eventSource == text_fieldObjectDefinition) {
76
            getEntity().addFieldObjectDefinition(text_fieldObjectDefinition.getText(), CdmStore.getDefaultLanguage());
77
        } else if (eventSource == text_fieldNotes) {
70
//        if (eventSource == text_ecology) {
71
//            getEntity().setEcology(text_ecology.getText());
72
//        } else if (eventSource == text_plantDescription) {
73
//            getEntity().setPlantDescription(text_plantDescription.getText());
74
//        } else if (eventSource == text_fieldObjectDefinition) {
75
//            getEntity().addFieldObjectDefinition(text_fieldObjectDefinition.getText(), CdmStore.getDefaultLanguage());
76
//        } else
77
            if (eventSource == text_fieldNotes) {
78 78
            getEntity().setFieldNotes(text_fieldNotes.getText());
79 79
        } else if (eventSource == number_individualCount) {
80 80
            getEntity().setIndividualCount(number_individualCount.getInteger());
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsSection.java
1
// $Id$
2
/**
3
* Copyright (C) 2013 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
11

  
12
import org.eclipse.jface.viewers.ISelectionProvider;
13

  
14
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
16
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
17
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
20
import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
21

  
22
/**
23
 * @author pplitzner
24
 * @date 21.08.2013
25
 *
26
 */
27
public class FieldObservationDetailsSection extends AbstractCdmDetailSection<FieldUnit> implements IDerivedUnitFacadeDetailSection{
28

  
29
    /**
30
     * <p>Constructor for FieldObservationDetailSection.</p>
31
     *
32
     * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
33
     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
34
     * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
35
     * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
36
     * @param style a int.
37
     */
38
    public FieldObservationDetailsSection(CdmFormFactory formFactory, ConversationHolder conversation,
39
            ICdmFormElement parentElement,
40
            ISelectionProvider selectionProvider, int style) {
41
        super(formFactory, conversation, parentElement, selectionProvider, style);
42
    }
43

  
44
    /** {@inheritDoc} */
45
    @Override
46
    public String getHeading() {
47
        return "Field Observation Details";
48
    }
49

  
50
    /* (non-Javadoc)
51
     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
52
     */
53
    @Override
54
    protected AbstractCdmDetailElement<FieldUnit> createCdmDetailElement(AbstractCdmDetailSection<FieldUnit> parentElement, int style) {
55
        return formFactory.createFieldObservationDetailsElementController(parentElement);
56
    }
57
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralElementController.java
9 9
 */
10 10
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
11 11

  
12
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
13 12
import eu.etaxonomy.cdm.model.agent.AgentBase;
14 13
import eu.etaxonomy.cdm.model.common.LanguageString;
15 14
import eu.etaxonomy.cdm.model.location.NamedArea;
15
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
16 16
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionFieldController;
17 17
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.LanguageTextFieldController;
18 18
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
......
30 30
 * @date 13.08.2013
31 31
 *
32 32
 */
33
public class FieldObservationGeneralElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
33
public class FieldObservationGeneralElementController extends AbstractCdmDetailElement<FieldUnit> {
34 34

  
35 35
    private FieldObservationGeneralElement fieldObservationGeneralElement;
36 36

  
......
62 62
     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
63 63
     */
64 64
    @Override
65
    protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
65
    protected void createControls(ICdmFormElement formElement, FieldUnit entity, int style) {
66 66
        toggleableText_titleCache = new ToggleableTextFieldController(fieldObservationGeneralElement.getToggleableTextField(), getFormFactory(), formElement, entity.getTitleCache(), entity.isProtectedTitleCache(), style);
67 67

  
68
        selection_country = new EntitySelectionFieldController<NamedArea>(fieldObservationGeneralElement.getCountrySelectionField(), getFormFactory(), getConversationHolder(), formElement, NamedArea.class, entity.getCountry(), EntitySelectionElement.NOTHING);
69
        languageText_locality = new LanguageTextFieldController(fieldObservationGeneralElement.getTextLocality(), getFormFactory(), formElement, entity.getLocality());
70
        element_point = new PointFieldController(fieldObservationGeneralElement.getPointField(),getFormFactory(), formElement, entity.getExactLocation(), style);
71
        number_elevation = new NumberFieldController(fieldObservationGeneralElement.getTextElevation(), getFormFactory(), formElement, entity.getAbsoluteElevation());
68
        selection_country = new EntitySelectionFieldController<NamedArea>(fieldObservationGeneralElement.getCountrySelectionField(), getFormFactory(), getConversationHolder(), formElement, NamedArea.class, entity.getGatheringEvent().getCountry(), EntitySelectionElement.NOTHING);
69
        languageText_locality = new LanguageTextFieldController(fieldObservationGeneralElement.getTextLocality(), getFormFactory(), formElement, entity.getGatheringEvent().getLocality());
70
        element_point = new PointFieldController(fieldObservationGeneralElement.getPointField(),getFormFactory(), formElement, entity.getGatheringEvent().getExactLocation(), style);
71
        number_elevation = new NumberFieldController(fieldObservationGeneralElement.getTextElevation(), getFormFactory(), formElement, entity.getGatheringEvent().getAbsoluteElevation());
72 72
//        element_date = formFactory.createTimePeriodElement(formElement, "Date", entity.getGatheringPeriod(), style);
73
        selection_collector = new EntitySelectionFieldController<AgentBase>(fieldObservationGeneralElement.getCollectorSelectionField(), getFormFactory(), getConversationHolder(), formElement, AgentBase.class, entity.getCollector(), EntitySelectionElement.ALL);
73
        selection_collector = new EntitySelectionFieldController<AgentBase>(fieldObservationGeneralElement.getCollectorSelectionField(), getFormFactory(), getConversationHolder(), formElement, AgentBase.class, entity.getGatheringEvent().getCollector(), EntitySelectionElement.ALL);
74 74
        text_collectingNumber = new TextFieldController(fieldObservationGeneralElement.getTextCollectingNumber(), getFormFactory(), formElement, entity.getFieldNumber(), null);
75 75
    }
76 76

  
......
86 86
        if (eventSource == toggleableText_titleCache) {
87 87
            getEntity().setTitleCache(toggleableText_titleCache.getText(), toggleableText_titleCache.getState());
88 88
        } else if (eventSource == selection_country) {
89
            getEntity().setCountry(selection_country.getSelection());
89
            getEntity().getGatheringEvent().setCountry(selection_country.getSelection());
90 90
        } else if (eventSource == languageText_locality) {
91 91
            LanguageString locality = languageText_locality.getLanguageString();
92
            getEntity().setLocality(locality);
92
            getEntity().getGatheringEvent().setLocality(locality);
93 93
        } else if (eventSource == element_point) {
94
            getEntity().setExactLocation(element_point.getPoint());
94
            getEntity().getGatheringEvent().setExactLocation(element_point.getPoint());
95 95
        } else if (eventSource == number_elevation) {
96
            getEntity().setAbsoluteElevation(number_elevation.getInteger());
97
        } else if (eventSource == element_date) {
98
            getEntity().setGatheringPeriod(element_date.getTimePeriod());
96
            getEntity().getGatheringEvent().setAbsoluteElevation(number_elevation.getInteger());
97
//        } else if (eventSource == element_date) {
98
//            getEntity().setGatheringPeriod(element_date.getTimePeriod());
99 99
        } else if (eventSource == selection_collector) {
100
            getEntity().setCollector(selection_collector.getSelection());
100
            getEntity().getGatheringEvent().setCollector(selection_collector.getSelection());
101 101
        } else if (eventSource == text_collectingNumber) {
102 102
            getEntity().setFieldNumber(text_collectingNumber.getText());
103 103
        }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralSection.java
1
// $Id$
2
/**
3
* Copyright (C) 2013 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
11

  
12
import org.eclipse.jface.viewers.ISelectionProvider;
13

  
14
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
16
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
17
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
20
import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
21

  
22
/**
23
 * @author pplitzner
24
 * @date 16.08.2013
25
 *
26
 */
27
public class FieldObservationGeneralSection extends AbstractCdmDetailSection<FieldUnit> implements IDerivedUnitFacadeDetailSection{
28

  
29
    /**
30
     * <p>Constructor for FieldObservationDetailSection.</p>
31
     *
32
     * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
33
     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
34
     * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
35
     * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
36
     * @param style a int.
37
     */
38
    public FieldObservationGeneralSection(CdmFormFactory formFactory, ConversationHolder conversation,
39
            ICdmFormElement parentElement,
40
            ISelectionProvider selectionProvider, int style) {
41
        super(formFactory, conversation, parentElement, selectionProvider, style);
42
    }
43

  
44
    /** {@inheritDoc} */
45
    @Override
46
    public String getHeading() {
47
        return "Field Observation";
48
    }
49

  
50
    /* (non-Javadoc)
51
     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
52
     */
53
    @Override
54
    protected AbstractCdmDetailElement<FieldUnit> createCdmDetailElement(AbstractCdmDetailSection<FieldUnit> parentElement, int style) {
55
        return formFactory.createFieldObservationGeneralElementController(parentElement);
56
    }
57
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationSection.java
1
// $Id$
2
/**
3
* Copyright (C) 2013 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
11

  
12
import org.eclipse.jface.viewers.ISelectionProvider;
13

  
14
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
16
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
17
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
20
import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
21

  
22
/**
23
 * @author pplitzner
24
 * @date 16.08.2013
25
 *
26
 */
27
public class FieldObservationSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
28

  
29
    /**
30
     * <p>Constructor for FieldObservationDetailSection.</p>
31
     *
32
     * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
33
     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
34
     * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
35
     * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
36
     * @param style a int.
37
     */
38
    public FieldObservationSection(CdmFormFactory formFactory, ConversationHolder conversation,
39
            ICdmFormElement parentElement,
40
            ISelectionProvider selectionProvider, int style) {
41
        super(formFactory, conversation, parentElement, selectionProvider, style);
42
    }
43

  
44
    /** {@inheritDoc} */
45
    @Override
46
    public String getHeading() {
47
        return "Field Observation";
48
    }
49

  
50
    /* (non-Javadoc)
51
     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
52
     */
53
    @Override
54
    protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
55
        return formFactory.createFieldObservationGeneralElement(parentElement);
56
    }
57
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElementController.java
9 9
*/
10 10
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
11 11

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

  
14
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
12
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
15 13
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
16 14
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
17 15
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
18 16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
20 17
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
21
import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectingAreasDetailSection;
22 18

  
23 19
/**
24 20
 * @author pplitzner
25 21
 * @date 14.08.2013
26 22
 *
27 23
 */
28
public class GatheringEventDetailsElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
24
public class GatheringEventDetailsElementController extends AbstractCdmDetailElement<FieldUnit> {
29 25

  
30 26
    private GatheringEventDetailsElement gatheringEventDetailsElement;
31 27

  
......
43 39

  
44 40
    private TextFieldController text_gatheringEventDescription;
45 41

  
46
    private CollectingAreasDetailSection section_collectingAreas;
42
//    private CollectingAreasDetailSection section_collectingAreas;
47 43

  
48 44
    /**
49 45
     * <p>
......
64 60

  
65 61
    /** {@inheritDoc} */
66 62
    @Override
67
    protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
63
    protected void createControls(ICdmFormElement formElement, FieldUnit entity, int style) {
68 64

  
69 65
//        number_absoluteElevationError = new NumberFieldController(gatheringEventDetailsElement.getTextElevationError(), formFactory, this, entity.getAbsoluteElevation());
70 66
//        number_absoluteElevationMinimum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMinimum(), formFactory, this, entity.getAbsoluteElevationMinimum());
71
        number_absoluteElevationMaximum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMaximum(), formFactory, this, entity.getAbsoluteElevationMaximum());
72
        text_collectingMethod = new TextFieldController(gatheringEventDetailsElement.getText_CollectingMethod(), formFactory, this, entity.getCollectingMethod(), null);
73
        number_distanceToGround = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToGround(), formFactory, this, entity.getDistanceToGround());
74
        number_distanceToWaterSurface = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToWaterSurface(), formFactory, this, entity.getDistanceToWaterSurface());
75
        text_gatheringEventDescription = new TextFieldController(gatheringEventDetailsElement.getText_GatheringEventDescription(), formFactory, this, entity.getGatheringEventDescription(), null);
76
        section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
77
        section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
78
        section_collectingAreas.setEntity(entity);
67
        number_absoluteElevationMaximum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMaximum(), formFactory, this, entity.getGatheringEvent().getAbsoluteElevationMax());
68
        text_collectingMethod = new TextFieldController(gatheringEventDetailsElement.getText_CollectingMethod(), formFactory, this, entity.getGatheringEvent().getCollectingMethod(), null);
69
        number_distanceToGround = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToGround(), formFactory, this, entity.getGatheringEvent().getDistanceToGround());
70
        number_distanceToWaterSurface = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToWaterSurface(), formFactory, this, entity.getGatheringEvent().getDistanceToWaterSurface());
71
        text_gatheringEventDescription = new TextFieldController(gatheringEventDetailsElement.getText_GatheringEventDescription(), formFactory, this, entity.getGatheringEvent().getDescription(), null);
72
//        section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
73
//        section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
74
//        section_collectingAreas.setEntity(entity);
79 75
    }
80 76

  
81 77
    /** {@inheritDoc} */
......
103 99
//            }
104 100
//        } else
105 101
            if (eventSource == text_collectingMethod) {
106
            getEntity().setCollectingMethod(text_collectingMethod.getText());
102
            getEntity().getGatheringEvent().setCollectingMethod(text_collectingMethod.getText());
107 103
        } else if (eventSource == number_distanceToGround) {
108
            getEntity().setDistanceToGround(number_distanceToGround.getDouble());
104
            getEntity().getGatheringEvent().setDistanceToGround(number_distanceToGround.getDouble());
109 105
        } else if (eventSource == number_distanceToWaterSurface) {
110
            getEntity().setDistanceToWaterSurface(number_distanceToWaterSurface.getDouble());
106
            getEntity().getGatheringEvent().setDistanceToWaterSurface(number_distanceToWaterSurface.getDouble());
111 107
        } else if (eventSource == text_gatheringEventDescription) {
112
            getEntity().setGatheringEventDescription(text_gatheringEventDescription.getText());
108
            getEntity().getGatheringEvent().setDescription(text_gatheringEventDescription.getText());
113 109
        }
114 110
    }
115 111
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventSection.java
1
// $Id$
2
/**
3
* Copyright (C) 2013 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
11

  
12
import org.eclipse.jface.viewers.ISelectionProvider;
13

  
14
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
16
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
17
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
20
import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
21

  
22
/**
23
 * @author pplitzner
24
 * @date 21.08.2013
25
 *
26
 */
27
public class GatheringEventSection extends AbstractCdmDetailSection<FieldUnit> implements IDerivedUnitFacadeDetailSection{
28

  
29
    /**
30
     * <p>Constructor for GatheringEventDetailSection.</p>
31
     *
32
     * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
33
     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
34
     * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
35
     * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
36
     * @param style a int.
37
     */
38
    public GatheringEventSection(CdmFormFactory formFactory,
39
            ConversationHolder conversation, ICdmFormElement parentElement,
40
            ISelectionProvider selectionProvider, int style) {
41
        super(formFactory, conversation, parentElement, selectionProvider, style);
42
    }
43

  
44

  
45
    /* (non-Javadoc)
46
     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
47
     */
48
    /** {@inheritDoc} */
49
    @Override
50
    public String getHeading() {
51
        return "Gathering Event Details";
52
    }
53

  
54
    /* (non-Javadoc)
55
     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
56
     */
57
    @Override
58
    protected AbstractCdmDetailElement<FieldUnit> createCdmDetailElement(AbstractCdmDetailSection<FieldUnit> parentElement, int style) {
59
        return formFactory.createGatheringEventDetailsElementController(parentElement);
60
    }
61
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
90 90
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
91 91
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
92 92
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
93
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
94 93
import eu.etaxonomy.cdm.model.reference.Reference;
95 94
import eu.etaxonomy.cdm.model.taxon.Taxon;
96 95
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
......
100 99
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
101 100
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsElement;
102 101
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsElementController;
102
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsSection;
103 103
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralElement;
104 104
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralElementController;
105
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationSection;
105
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralSection;
106 106
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventDetailsElement;
107 107
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventDetailsElementController;
108
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventSection;
108 109
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenGeneralElement;
109 110
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenGeneralElementController;
110 111
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenSection;
......
2184 2185
            element = new NamedAreaDetailElement(this, parentElement, (NamedArea) entity, removeListener, style);
2185 2186
        } else if (entity instanceof DeterminationEvent) {
2186 2187
            element = new DeterminationEventDetailElement(this, parentElement, (DeterminationEvent) entity, removeListener, style);
2187
        } else if (entity instanceof DerivedUnit && ((DerivedUnit)entity).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen) {
2188
            element = new SpecimenCollectionDetailElement(this, parentElement, (DerivedUnit) entity, removeListener, style);
2189 2188
        } else if (entity instanceof User) {
2190 2189
            element = new MemberDetailElement(this, parentElement, (User) entity, removeListener, style);
2191 2190
        } else if (entity instanceof GrantedAuthority) {
......
2388 2387
     * @param i
2389 2388
     * @return
2390 2389
     */
2391
    public FieldObservationSection createFieldObservationSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
2392
        FieldObservationSection section = new FieldObservationSection(this, conversation, parentElement, selectionProvider, style);
2390
    public FieldObservationGeneralSection createFieldObservationGeneralSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
2391
        FieldObservationGeneralSection section = new FieldObservationGeneralSection(this, conversation, parentElement, selectionProvider, style);
2392
        addAndAdaptSection(parentElement, section);
2393
        return section;
2394
    }
2395
    /**
2396
     * @param conversationHolder
2397
     * @param parent
2398
     * @param detailsViewer
2399
     * @param i
2400
     * @return
2401
     */
2402
    public GatheringEventSection createGatheringEventSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
2403
        GatheringEventSection section = new GatheringEventSection(this, conversation, parentElement, selectionProvider, style);
2404
        addAndAdaptSection(parentElement, section);
2405
        return section;
2406
    }
2407
    /**
2408
     * @param conversationHolder
2409
     * @param parent
2410
     * @param detailsViewer
2411
     * @param i
2412
     * @return
2413
     */
2414
    public FieldObservationDetailsSection createFieldObservationDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
2415
        FieldObservationDetailsSection section = new FieldObservationDetailsSection(this, conversation, parentElement, selectionProvider, style);
2393 2416
        addAndAdaptSection(parentElement, section);
2394 2417
        return section;
2395 2418
    }
......
2415 2438
        return element;
2416 2439
    }
2417 2440

  
2418
    public FieldObservationGeneralElementController createFieldObservationGeneralElement(ICdmFormElement parentElement){
2441
    public FieldObservationGeneralElementController createFieldObservationGeneralElementController(ICdmFormElement parentElement){
2419 2442
        FieldObservationGeneralElement fieldObservationGeneralElement = new FieldObservationGeneralElement(parentElement.getLayoutComposite(), SWT.NONE);
2420 2443
        fieldObservationGeneralElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
2421 2444
        FieldObservationGeneralElementController element = new FieldObservationGeneralElementController(fieldObservationGeneralElement, this, parentElement);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
38 38
import eu.etaxonomy.cdm.model.media.Media;
39 39
import eu.etaxonomy.cdm.model.name.NonViralName;
40 40
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
41
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
41 42
import eu.etaxonomy.cdm.model.reference.Reference;
42 43
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
43 44
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
......
47 48
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
48 49
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
49 50
import eu.etaxonomy.taxeditor.store.CdmStore;
50
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationSection;
51
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsSection;
52
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralSection;
53
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventSection;
51 54
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenSection;
52 55
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
53 56
import eu.etaxonomy.taxeditor.ui.element.RootElement;
......
76 79
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
77 80
import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
78 81
import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
79
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailSection;
80
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
81 82
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
82 83
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
83 84
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
......
136 137
    public void setInput(Object input) {
137 138
		if (input instanceof DerivedUnit) {
138 139
            try {
139
				input = DerivedUnitFacade.NewInstance((DerivedUnit) input,
140
                        PreferencesUtil.getDerivedUnitConfigurator());
140
				input = DerivedUnitFacade.NewInstance((DerivedUnit) input,PreferencesUtil.getDerivedUnitConfigurator());
141 141
            } catch (DerivedUnitFacadeNotSupportedException e) {
142 142
                AbstractUtility.error(getClass(), e);
143 143
            }
......
227 227
            createMediaElementSection(rootElement);
228 228

  
229 229
        } else if (input instanceof DerivedUnitFacade) {
230
            createSpecimenDetailsView(rootElement);
231

  
232
        } else if (input instanceof FieldUnit) {
230 233
            createDerivedUnitBaseElementSection(rootElement);
231 234

  
232 235
        } else if (input instanceof FeatureNodeContainer) {
......
540 543
    private void createDerivedUnitBaseElementSection(RootElement parent) {
541 544
        destroySections();
542 545

  
543
        FieldObservationSection fieldObservationSection = formFactory.createFieldObservationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
544

  
545
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
546

  
547
        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
546
        FieldObservationGeneralSection fieldObservationSection = formFactory.createFieldObservationGeneralSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
548 547

  
549 548
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
550 549

  
551
        FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFieldObservationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
550
        GatheringEventSection gatheringEventDetailSection = formFactory.createGatheringEventSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
552 551

  
553 552
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
554 553

  
555
        SpecimenSection specimenSection = formFactory.createSpecimenSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
554
        FieldObservationDetailsSection fieldObservationDetailSection = formFactory.createFieldObservationDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
556 555

  
557 556
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
558 557

  
559

  
560 558
//        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
561 559
//
562 560
//        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
......
566 564
        addPart(fieldObservationSection);
567 565
        addPart(gatheringEventDetailSection);
568 566
        addPart(fieldObservationDetailSection);
569
        addPart(specimenSection);
570 567
//        addPart(derivedUnitBaseDetailSection);
571 568
//        addPart(determinationDetailSection);
572 569
    }
573 570

  
571
    /**
572
     * createDerivedUnitBaseElementSection
573
     *
574
     * @param parent
575
     */
576
    private void createSpecimenDetailsView(RootElement parent) {
577
        destroySections();
578

  
579
        SpecimenSection specimenSection = formFactory.createSpecimenSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
580

  
581
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
582

  
583
        addPart(specimenSection);
584
    }
585

  
574 586
    /**
575 587
     * @param rootElement
576 588
     */

Also available in: Unified diff