Project

General

Profile

« Previous | Next » 

Revision 40ffaa10

Added by Cherian Mathew over 10 years ago

UseRecordDetailElement : FIXME tag for 'Uses' code
SpecimenTypeDesignationElement : updated construction of DervivedUnit using default SpecimenOrObservationType
ScopeRestrictionSection : updated construction of DefinedTerm using default TermType
AbstractOriginalSourceElement : added combo list for OriginalSourceTypes
IdentifiableSourceElement : added interaction update code for the new OriginalSourceType combo list
SourceSection : changed construction of IdentifiableSource from a dialog to a default type

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java
31 31

  
32 32
	@Override
33 33
	public DefinedTerm createNewElement() {		
34
		return DefinedTerm.NewInstance(TermType.Scope);
34
		return DefinedTerm.NewInstance(TermType.Scope,"","Untitled","");
35 35
			
36 36
	}
37 37

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SpecimenTypeDesignationElement.java
16 16
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
17 17
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
18 18
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
19
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
19 20
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
20 21
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
21 22
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
......
100 101
		else if (eventSource == text_specimenTypeText) {
101 102
			// TODO this is a simple workaround to enter type specimen as text
102 103
			// strings
103
			if (getEntity().getTypeSpecimen() == null) {
104
				DerivedUnit typeSpecimen = DerivedUnit.NewInstance();
104
			if (getEntity().getTypeSpecimen() == null) {				
105
				DerivedUnit typeSpecimen = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);									
105 106
				getEntity().setTypeSpecimen(typeSpecimen);
106 107
			}
107 108
			getEntity().getTypeSpecimen().setTitleCache(
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractOriginalSourceElement.java
13 13
import org.eclipse.swt.events.SelectionListener;
14 14

  
15 15
import eu.etaxonomy.cdm.model.common.OriginalSourceBase;
16
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
17
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
18
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
16 19
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
17 20
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18 21
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
......
26 29
 * @version 1.0
27 30
 */
28 31
public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase> extends AbstractReferencedEntityElement<T> {
32
	protected EnumComboElement<OriginalSourceType> combo_origsourcetype;
29 33
	protected TextWithLabelElement text_idInSource;
30 34
	protected TextWithLabelElement text_idNamespace;
31 35

  
......
56 60
	/** {@inheritDoc} */
57 61
	@Override
58 62
	public void createControls(ICdmFormElement formElement, int style) {
63
		combo_origsourcetype = formFactory
64
				.createEnumComboElement(OriginalSourceType.class,
65
						formElement, style);		
59 66
		text_idInSource = formFactory.createTextWithLabelElement(formElement, "Id In Source", null, style);
60 67
		text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", null, style);
61 68
		super.createControls(formElement, style);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/IdentifiableSourceElement.java
6 6
import org.eclipse.swt.events.SelectionListener;
7 7

  
8 8
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
9
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
9 10
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
10 11
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
11 12
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
......
55 56

  
56 57
		selection_reference.setEntity(entity.getCitation());
57 58
		text_referenceDetail.setText(entity.getCitationMicroReference());
59
		combo_origsourcetype.setSelection(entity.getType());
58 60
		if(hasOriginalNameString()) text_originaleNameString.setText(entity.getOriginalNameString());
59 61
	}	
60 62
	
......
75 77
		}
76 78
		else if(eventSource == text_originaleNameString){
77 79
			getEntity().setOriginalNameString(text_originaleNameString.getText());
80
		} else if(eventSource == combo_origsourcetype){
81
			getEntity().setType(combo_origsourcetype.getSelection());
78 82
		}
79 83
	}
80 84
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/SourceSection.java
41 41
	/** {@inheritDoc} */
42 42
	@Override
43 43
	public IdentifiableSource createNewElement() {
44
		OriginalSourceType ost = OriginalSourceTypeSelectionDialog.select(getShell(), getConversationHolder());	
45
		if(ost != null) {
46
			return IdentifiableSource.NewInstance(ost);
47
		} else {
48
			return null;
49
		}
50

  
44
		return IdentifiableSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
51 45
	}
52 46

  
53 47
	/** {@inheritDoc} */
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java
493 493
					}
494 494
				}
495 495
				List<DefinedTerm> emptyListToResetComboBox = new ArrayList<DefinedTerm>();
496
				DefinedTerm emptyMod = DefinedTerm.NewInstance();
496
				//FIXME:3.3MC----
497
				//DefinedTerm emptyMod = DefinedTerm.NewInstance();
498
				DefinedTerm emptyMod = null;
499
				//FIXME:3.3MC----
500
				
501
				
497 502
				emptyListToResetComboBox.add(emptyMod);
498 503
				combo_EthnicGroup.setTerms(emptyListToResetComboBox);
499 504
				combo_EthnicGroup.setEnabled(false);

Also available in: Unified diff