Project

General

Profile

« Previous | Next » 

Revision 4b0488d0

Added by U-BGBM\k.luther over 8 years ago

fix for #5114

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
51 51
	private ITaxonTreeNode parentTreeNode;
52 52

  
53 53
	private EntitySelectionElement<Taxon> selection_reuseExistingTaxon;
54
	private EntitySelectionElement<Reference> selection_SecRef;
54 55

  
55 56
	private Taxon taxon;
57
	
58
	private Reference secReference;
56 59

  
57 60
	private TextWithLabelElement textNewTaxonName;
58 61

  
......
92 95
		selection_parentTaxonNode = formFactory
93 96
				.createTaxonNodeSelectionElement(getConversationHolder(), formElement, "Parent", null,
94 97
						EntitySelectionElement.DELETABLE, style);
98
		selection_SecRef = formFactory
99
				.createSelectionElement(Reference.class,getConversationHolder(), formElement, "Secundum Reference", null,
100
						EntitySelectionElement.DELETABLE, style);
95 101
		selection_reuseExistingTaxon = formFactory
96 102
				.createSelectionElement(Taxon.class,
97 103
						getConversationHolder(), formElement,
......
150 156
			setClassification(selection_classification.getEntity());
151 157
		} else if (eventSource == selection_parentTaxonNode) {
152 158
			setParentTreeNode(selection_parentTaxonNode.getEntity());
159
		} else if (eventSource == selection_SecRef) {
160
			setSecReference(selection_SecRef.getEntity());
153 161
		} else if (eventSource == selection_reuseExistingTaxon) {
154 162
			boolean enabled = selection_reuseExistingTaxon.getEntity() == null;
155 163
			selection_reuseExistingName.setEnabled(enabled);
......
236 244
			this.parentTreeNode = selection_classification.getEntity();
237 245
		}
238 246
	}
247
	
248
	private void setSecReference(Reference secRef){
249
		this.secReference = secRef;
250
		setTaxon(textNewTaxonName.getText());
251
	}
239 252

  
240 253
	private void setTaxon(Taxon taxon) {
241 254
		this.taxon = taxon;
......
252 265
	private void setTaxon(TaxonNameBase taxonName) {
253 266
		Reference secundum = null;
254 267
		if (getParentTreeNode() != null) {
255
			if (getParentTreeNode() instanceof Classification) {
268
			if (this.secReference != null){
269
				secundum = this.secReference;
270
			} else if (getParentTreeNode() instanceof Classification) {
256 271
				secundum = ((Classification) getParentTreeNode())
257 272
						.getReference();
258 273
			} else if (getParentTreeNode() instanceof TaxonNode) {

Also available in: Unified diff