Project

General

Profile

« Previous | Next » 

Revision 3adf46dc

Added by Katja Luther about 5 years ago

ref #8088: taxon should be selectable in taxonnode wizard when editing existing node

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
60 60
	private EntitySelectionElement<Taxon> selection_reuseExistingTaxon;
61 61
	private EntitySelectionElement<Reference> selection_SecRef;
62 62
	private EntitySelectionElement<Reference> selection_Ref;
63
	TextWithLabelElement textTaxonSec;
63 64
	private TextWithLabelElement microReference;
64 65

  
65 66
	private Taxon taxon;
......
137 138
	        TextWithLabelElement textClassification = formFactory.createTextWithLabelElement(formElement,"Classification", entity.getClassification().getTitleCache(), style);
138 139
	        textClassification.setEnabled(false);
139 140

  
140
	        TextWithLabelElement textTaxon = formFactory.createTextWithLabelElement(formElement,"Taxon", taxon.getTitleCache(), style);
141
	        textTaxon.setEnabled(false);
141
//	        TextWithLabelElement textTaxon = formFactory.createTextWithLabelElement(formElement,"Taxon", taxon.getTitleCache(), style);
142
//	        textTaxon.setEnabled(false);
142 143

  
143
            TextWithLabelElement textTaxonSec = formFactory.createTextWithLabelElement(formElement,"Secundum Reference", "", style);
144
	        selection_reuseExistingTaxon = formFactory
145
                  .createSelectionElement(Taxon.class,//getConversationHolder(),
146
                          formElement,
147
                          "Reuse existing taxon", taxon,
148
                          EntitySelectionElement.DELETABLE, style);
149

  
150
	        textTaxonSec = formFactory.createTextWithLabelElement(formElement,"Secundum Reference", "", style);
144 151
            if (entity.getTaxon().getSec() != null){
145 152
                textTaxonSec.setText(taxon.getSec().getTitleCache());
146 153
            }
......
256 263
		if (eventSource == selection_parentTaxonNode) {
257 264
		    setParentTreeNode(selection_parentTaxonNode.getEntity());
258 265
		} else if (eventSource == selection_reuseExistingTaxon) {
259
				boolean enabled = selection_reuseExistingTaxon.getEntity() == null;
260
				selection_reuseExistingName.setEnabled(enabled);
261
				if (!enabled){
262
                    setTaxon(selection_reuseExistingTaxon.getEntity());
263
                }else{
264
			        textNewTaxonName.setText(null);
265
			    }
266
				complete = !textNewTaxonName.getText().isEmpty();
267

  
268

  
266
		    if (selection_reuseExistingTaxon.getEntity() != null){
267
		        setTaxon(selection_reuseExistingTaxon.getEntity());
268
            }
269
			complete = true;
269 270
		} else if (eventSource == selection_reuseExistingName) {
270 271
		    boolean enabled = selection_reuseExistingName.getEntity() == null;
271 272
			setTaxon(HibernateProxyHelper.deproxy(selection_reuseExistingName.getEntity()));
......
375 376
		getEntity().setTaxon(taxon);
376 377
		if (isCreateNew()){
377 378
		    textNewTaxonName.setText(taxon.getName().getTitleCache());
379
		    if (taxon.getSec() != null){
380
		        selection_SecRef.setEntity(taxon.getSec());
381
		    }
382
		}else{
383
		    if (taxon.getSec() != null) {
384
                this.textTaxonSec.setText(taxon.getSec().getTitleCache());
385
            }
378 386
		}
379
		selection_SecRef.setEntity(taxon.getSec());
387

  
388

  
380 389
	}
381 390

  
382 391
	private void setTaxon(TaxonName taxonName) {

Also available in: Unified diff