Project

General

Profile

« Previous | Next » 

Revision 6b5ad34c

Added by Patrick Plitzner about 10 years ago

  • added preference which shows determination section only for FieldUnits in the DetailsView
    • added missing parameters for SingleRead DetailsView

View differences:

.gitattributes
1237 1237
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java -text
1238 1238
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java -text
1239 1239
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/Resources.java -text
1240
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java -text
1240 1241
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java -text
1241 1242
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicPreferences.java -text
1242 1243
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TypeDesignationPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
116 116
	public static final String SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS = "eu.etaxonomy.taxeditor.navigation.search.openResultInSeparateWindows";
117 117

  
118 118
	public static final String ADD_TYPES_TO_ALL_NAMES = "eu.etaxonomy.taxeditor.store.addTypeToAllNames";
119

  
120
    public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
119 121
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
1
// $Id$
2
/**
3
* Copyright (C) 2014 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.preference;
11

  
12
import org.eclipse.jface.preference.BooleanFieldEditor;
13
import org.eclipse.jface.preference.FieldEditorPreferencePage;
14
import org.eclipse.ui.IWorkbench;
15
import org.eclipse.ui.IWorkbenchPreferencePage;
16

  
17
/**
18
 * @author pplitzner
19
 * @date 13.02.2014
20
 *
21
 */
22
public class SpecimenOrObservationPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
23

  
24
    /* (non-Javadoc)
25
     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
26
     */
27
    @Override
28
    public void init(IWorkbench workbench) {
29
        setPreferenceStore(PreferencesUtil.getPreferenceStore());
30
    }
31

  
32
    /* (non-Javadoc)
33
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
34
     */
35
    @Override
36
    protected void createFieldEditors() {
37

  
38
        addField(new BooleanFieldEditor(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS,
39
                "Taxon determination only on FieldUnit level",
40
                getFieldEditorParent()));
41

  
42
    }
43

  
44

  
45
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java
10 10
package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
11 11

  
12 12
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
13
import eu.etaxonomy.cdm.model.agent.AgentBase;
14
import eu.etaxonomy.cdm.model.occurrence.Collection;
13 15
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
14 16
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
17
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
18
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
15 19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
20
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
16 21

  
17 22
/**
18 23
 * @author pplitzner
......
21 26
 */
22 27
public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
23 28

  
29
    //title cache
30
    //sample designation
31
    private TimePeriodElement datePreparation;
32
    private EntitySelectionElement<AgentBase> selectionPreparedBy;
33
    private TextWithLabelElement textPreservationMedium;
34
    private TimePeriodElement datePreservation;
35
    private EntitySelectionElement<AgentBase> selectionStoredAt;
36
    private EntitySelectionElement<Collection> selectionCollection;
37
    private TextWithLabelElement textAccessionNumber;
38
    private TextWithLabelElement textBarcode;
39

  
40

  
24 41
    /**
25 42
     * @param formFactory
26 43
     * @param formElement
......
38 55
     */
39 56
    @Override
40 57
    protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
58
        datePreparation = formFactory.createTimePeriodElement(formElement, "Preparation date", null, style);
59
        selectionPreparedBy = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Prepared By", null, EntitySelectionElement.ALL, style);
60
        textPreservationMedium = formFactory.createTextWithLabelElement(formElement, "Preservation medium", null, style);
61
        datePreservation = formFactory.createTimePeriodElement(formElement, "Preservation date", null, style);
62
        selectionStoredAt = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Stored at", null, EntitySelectionElement.ALL, style);
63
        selectionCollection = formFactory.createSelectionElement(Collection.class, getConversationHolder(), formElement, "Collection", null, EntitySelectionElement.ALL, style);
64
        textAccessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", null, style);
65
        textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", null, style);
41 66

  
42 67
    }
43 68

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
54 54
import eu.etaxonomy.taxeditor.model.AbstractUtility;
55 55
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
56 56
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
57
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
57 58
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
58 59
import eu.etaxonomy.taxeditor.store.CdmStore;
59 60
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
......
659 660

  
660 661
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
661 662

  
662
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
663

  
664
        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
665

  
666 663
        addPart(derivedUnitGeneralDetailSection);
667 664
        addPart(gatheringEventDetailSection);
668 665
        addPart(fieldUnitDetailSection);
669 666
        addPart(derivedUnitBaseDetailSection);
670
        addPart(determinationDetailSection);
667

  
668
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
669
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
670
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
671
            addPart(determinationDetailSection);
672
        }
673

  
671 674

  
672 675
    }
673 676

  
......
687 690
        addPart(fielUnitGeneralDetailSection);
688 691
        addPart(gatheringEventDetailSection);
689 692
        addPart(fieldUnitDetailSection);
693

  
694
        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
695
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
696
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
697
            addPart(determinationDetailSection);
698
        }
690 699
    }
691 700

  
692 701
    private void createPreservedSpecimenSpecimenSection(RootElement parent) {

Also available in: Unified diff