Project

General

Profile

« Previous | Next » 

Revision 231d61a4

Added by Patrick Plitzner about 6 years ago

Used UnboundEntityCollectionSection to avoid the saving of dummy terms
#5280

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeElement.java
51 51
	@Override
52 52
	public void setEntity(DefinedTerm entity) {
53 53
		this.entity = entity;
54
		if(!entity.getLabel().isEmpty()){
54
		if(entity.getId()!=0){
55 55
		    combo_scope.setSelection(entity);
56
		    combo_scope.removeEmptyElement();
56 57
		}
57 58
	}
58 59

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java
11 11
import eu.etaxonomy.cdm.model.description.PolytomousKey;
12 12
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
13 13
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
14
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
14
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
15 15

  
16 16
/**
17 17
 * @author n.hoffmann
18 18
 *
19 19
 */
20
public class ScopeRestrictionSection extends AbstractEntityCollectionSection<PolytomousKey, DefinedTerm> {
20
public class ScopeRestrictionSection extends AbstractUnboundEntityCollectionSection<PolytomousKey, DefinedTerm> {
21 21

  
22 22
	public ScopeRestrictionSection(CdmFormFactory formFactory,
23 23
			ConversationHolder conversation, ICdmFormElement parentElement, int style) {
24 24
		super(formFactory, conversation, parentElement, "Scope Restriction", style);
25 25
	}
26 26

  
27

  
27 28
	@Override
28
	public Collection<DefinedTerm> getCollection(PolytomousKey entity) {
29
	protected Collection<DefinedTerm> getEntityCollection(PolytomousKey entity) {
29 30
		return entity.getScopeRestrictions();
30 31
	}
31 32

  

Also available in: Unified diff