Project

General

Profile

« Previous | Next » 

Revision 23783f7a

Added by Niels Hoffmann about 12 years ago

Refactoring of selection elements. Additional minor refactoring. Fixed a bug with Translation Editor (#2752)

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
13 13
import java.util.Arrays;
14 14

  
15 15
import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
16
import eu.etaxonomy.cdm.model.agent.Team;
16 17
import eu.etaxonomy.cdm.model.name.NonViralName;
17 18
import eu.etaxonomy.taxeditor.model.AuthorHelper;
18 19
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19 20
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
20 21
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
21 22
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
22
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.SelectionType;
23
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
24 23
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
25
import eu.etaxonomy.taxeditor.ui.selection.AbstractSelectionElement;
24
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
26 25
import eu.etaxonomy.taxeditor.ui.selection.NomenclaturalAuthorTeamSelectionElement;
27 26

  
28 27
/**
......
38 37
	AbstractIdentifiableEntityDetailElement<NonViralName> implements
39 38
		IEnableableFormElement {
40 39

  
41
	private AbstractSelectionElement selection_exBasionymAuthorTeam;
42
	private AbstractSelectionElement selection_basionymAuthorTeam;
43
	private AbstractSelectionElement selection_exCombinationAuthorTeam;
44
	private AbstractSelectionElement selection_combinationAuthorTeam;
40
	private NomenclaturalAuthorTeamSelectionElement selection_exBasionymAuthorTeam;
41
	private NomenclaturalAuthorTeamSelectionElement selection_basionymAuthorTeam;
42
	private NomenclaturalAuthorTeamSelectionElement selection_exCombinationAuthorTeam;
43
	private NomenclaturalAuthorTeamSelectionElement selection_combinationAuthorTeam;
45 44

  
46 45
	/**
47 46
	 * <p>
......
69 68
		toggleable_cache = formFactory.createToggleableTextField(this,
70 69
				"Authorship Cache", entity.getAuthorshipCache(),
71 70
				entity.isProtectedAuthorshipCache(), style);
72

  
73
		selection_combinationAuthorTeam = formFactory.createSelectionElement(
74
				SelectionType.AUTHOR_TEAM, getConversationHolder(),
71
		selection_combinationAuthorTeam = formFactory.createNomenclaturalAuthorTeamSelectionElement(
72
				getConversationHolder(),
75 73
				formElement, "Author",
76 74
				AuthorHelper.getAuthor(entity.getCombinationAuthorTeam()),
77
				NomenclaturalAuthorTeamSelectionElement.DEFAULT, style);
75
				EntitySelectionElement.ALL, style);
78 76
		addElement(selection_combinationAuthorTeam);
79
		selection_exCombinationAuthorTeam = formFactory.createSelectionElement(
80
				SelectionType.AUTHOR_TEAM, getConversationHolder(),
77
		selection_exCombinationAuthorTeam = formFactory.createNomenclaturalAuthorTeamSelectionElement(
78
				getConversationHolder(),
81 79
				formElement, "Ex Author",
82 80
				AuthorHelper.getAuthor(entity.getExCombinationAuthorTeam()),
83
				NomenclaturalAuthorTeamSelectionElement.DEFAULT, style);
81
				EntitySelectionElement.ALL, style);
84 82
		addElement(selection_exCombinationAuthorTeam);
85
		selection_basionymAuthorTeam = formFactory.createSelectionElement(
86
				SelectionType.AUTHOR_TEAM, getConversationHolder(),
83
		selection_basionymAuthorTeam = formFactory.createNomenclaturalAuthorTeamSelectionElement(
84
				getConversationHolder(),
87 85
				formElement, "Basionym Author",
88 86
				AuthorHelper.getAuthor(entity.getBasionymAuthorTeam()),
89
				NomenclaturalAuthorTeamSelectionElement.DEFAULT, style);
87
				EntitySelectionElement.ALL, style);
90 88
		addElement(selection_basionymAuthorTeam);
91
		selection_exBasionymAuthorTeam = formFactory.createSelectionElement(
92
				SelectionType.AUTHOR_TEAM, getConversationHolder(),
89
		selection_exBasionymAuthorTeam = formFactory.createNomenclaturalAuthorTeamSelectionElement(
90
				getConversationHolder(),
93 91
				formElement, "Ex Basionym Author",
94 92
				AuthorHelper.getAuthor(entity.getExBasionymAuthorTeam()),
95
				NomenclaturalAuthorTeamSelectionElement.DEFAULT, style);
93
				EntitySelectionElement.ALL, style);
96 94
		addElement(selection_exBasionymAuthorTeam);
97 95
	}
98 96

  
......
102 100
		if (getEntity() == null) {
103 101
			setEntity(NonViralName.NewInstance(null));
104 102
		}
105
		NonViralName nonViralName = getEntity();
106

  
103
		
107 104
		super.updateContent();
108 105
		toggleable_cache.setEnabled(getEntity().isProtectedAuthorshipCache());
109 106

  

Also available in: Unified diff