Project

General

Profile

« Previous | Next » 

Revision f18e39bb

Added by Niels Hoffmann over 12 years ago

Taxon Relationship type is now editable in details view

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
32 32
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
33 33
import eu.etaxonomy.cdm.model.reference.Reference;
34 34
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
35
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
35 36
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
36 37
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
37 38
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
......
42 43
import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
43 44
import eu.etaxonomy.taxeditor.ui.section.agent.TeamDetailSection;
44 45
import eu.etaxonomy.taxeditor.ui.section.agent.TeamOrPersonBaseDetailSection;
46
import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
45 47
import eu.etaxonomy.taxeditor.ui.section.description.DescribedSpecimenSection;
46 48
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailSection;
47 49
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailSection;
......
74 76
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
75 77
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
76 78
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
79
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
77 80
import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection;
78 81
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailSection;
79 82
import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
......
91 94
public class DetailsViewer extends AbstractCdmDataViewer {
92 95

  
93 96
	private enum VIEW_PART {
94
		TAXON, NAME, REFEERENCE, TEAM, PERSON, DESCRIPTION, DESCRIPTION_ELEMENT, EMPTY, IMAGE_GALLERY, MEDIA, TEAM_OR_PERSON_BASE, DERIVED_UNIT, FEATURE_DISTRIBUTION, POLYTOMOUS_KEY, POLYTOMOUS_KEY_NODE, USER, GROUP
97
		TAXON, 
98
		NAME, 
99
		REFEERENCE, 
100
		TEAM, 
101
		PERSON, 
102
		DESCRIPTION, 
103
		DESCRIPTION_ELEMENT, 
104
		EMPTY, 
105
		IMAGE_GALLERY, 
106
		MEDIA, 
107
		TEAM_OR_PERSON_BASE, 
108
		DERIVED_UNIT, 
109
		FEATURE_DISTRIBUTION, 
110
		POLYTOMOUS_KEY, 
111
		POLYTOMOUS_KEY_NODE, 
112
		USER, 
113
		GROUP,
114
		TAXON_RELATIONSHIP
95 115
	}
96 116

  
97 117
	private VIEW_PART currentViewPart;
......
242 262
				createGroupSection(rootElement);
243 263
				currentViewPart = VIEW_PART.GROUP;
244 264
			}
265
		} else if (getInput() instanceof TaxonRelationship) {
266
			if (currentViewPart != VIEW_PART.TAXON_RELATIONSHIP) {
267
				createTaxonRelationshipSection(rootElement);
268
				currentViewPart = VIEW_PART.TAXON_RELATIONSHIP;
269
			}
245 270
		} else {
246 271
			destroySections();
247 272
			currentViewPart = VIEW_PART.EMPTY;
......
657 682
		addPart(userDetailSection);
658 683
		addPart(groupByUserDetailSection);
659 684
	}
685
	
686
	private void createTaxonRelationshipSection(RootElement parent){
687
		destroySections();
688
		
689
		TaxonRelationshipDetailSection taxonRelationshipDetailSection = (TaxonRelationshipDetailSection) formFactory
690
				.createCdmDetailSection(DetailType.TAXON_RELATIONSHIP, getConversationHolder(), parent, this, Section.TWISTIE
691
								| Section.EXPANDED);
692
		
693
		ReferencedEntityDetailSection referencedEntityBaseDetailSection = (ReferencedEntityDetailSection) formFactory
694
				.createCdmDetailSection(DetailType.REFERENCED_ENTITY, getConversationHolder(), parent, this, Section.TWISTIE
695
								| Section.EXPANDED);
696
		addPart(taxonRelationshipDetailSection);
697
		addPart(referencedEntityBaseDetailSection);
698
	}
660 699
}

Also available in: Unified diff