Project

General

Profile

« Previous | Next » 

Revision 1731b6d1

Added by Katja Luther over 5 years ago

ref #7793: remove classification and reuse taxon in new taxon wizard

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
101 101
	protected void createControls(ICdmFormElement formElement,
102 102
	        ITaxonTreeNode entity, int style) {
103 103
	    if (isCreateNew()){
104
    		selection_classification = formFactory
105
    				.createSelectionElement(Classification.class,//getConversationHolder(),
106
    				        formElement, "Classification",
107
    						null, EntitySelectionElement.DELETABLE, style);
104
//    		selection_classification = formFactory
105
//    				.createSelectionElement(Classification.class,//getConversationHolder(),
106
//    				        formElement, "Classification",
107
//    						null, EntitySelectionElement.DELETABLE, style);
108 108
    		selection_parentTaxonNode = formFactory
109 109
    				.createTaxonNodeSelectionElement(getConversationHolder(), formElement, "Parent", null,
110 110
    						EntitySelectionElement.DELETABLE, style);
111 111

  
112
    		selection_reuseExistingTaxon = formFactory
113
    				.createSelectionElement(Taxon.class,//getConversationHolder(),
114
    				        formElement,
115
    						"Reuse existing taxon", null,
116
    						EntitySelectionElement.DELETABLE, style);
112
//    		selection_reuseExistingTaxon = formFactory
113
//    				.createSelectionElement(Taxon.class,//getConversationHolder(),
114
//    				        formElement,
115
//    						"Reuse existing taxon", null,
116
//    						EntitySelectionElement.DELETABLE, style);
117 117

  
118 118
    		selection_reuseExistingName = formFactory
119 119
    				.createSelectionElement(TaxonName.class,//getConversationHolder(),
......
267 267
		} else if (eventSource == selection_reuseExistingName) {
268 268
		    boolean enabled = selection_reuseExistingName.getEntity() == null;
269 269
			setTaxon(selection_reuseExistingName.getEntity());
270
			selection_reuseExistingTaxon.setEnabled(enabled);
270
			if (selection_reuseExistingTaxon != null){
271
			    selection_reuseExistingTaxon.setEnabled(enabled);
272
			}
271 273
			textNewTaxonName.setEnabled(enabled);
272 274

  
273 275
			complete = !textNewTaxonName.getText().isEmpty();
......
298 300
        }
299 301
		if (eventSource == textNewTaxonName) {
300 302
            boolean enabled = CdmUtils.isBlank(textNewTaxonName.getText());
301
            selection_reuseExistingTaxon.setEnabled(enabled);
303
            if (selection_reuseExistingTaxon != null){
304
                selection_reuseExistingTaxon.setEnabled(enabled);
305
            }
302 306
            selection_reuseExistingName.setEnabled(enabled);
303 307

  
304 308
            complete = CdmUtils.isNotBlank(textNewTaxonName.getText());
......
337 341

  
338 342
		if (parentTreeNode instanceof Classification) {
339 343
			classification = (Classification) parentTreeNode;
340
			selection_classification.setEntity(classification);
344
			if (selection_classification != null){
345
			    selection_classification.setEntity(classification);
346
			}
341 347
			selection_parentTaxonNode.setEntity(null);
342 348
			selection_parentTaxonNode.setClassification(classification);
343 349
			selection_SecRef.setEntity(classification.getReference());
344 350
		} else if (parentTreeNode instanceof TaxonNode) {
345 351
			classification = HibernateProxyHelper
346 352
					.deproxy(((TaxonNode) parentTreeNode).getClassification());
347
			selection_classification.setEntity(classification);
353
			if (selection_classification != null){
354
			    selection_classification.setEntity(classification);
355
			}
348 356
			selection_parentTaxonNode.setEntity(HibernateProxyHelper
349 357
                    .deproxy((TaxonNode) parentTreeNode));
350 358
			selection_parentTaxonNode.setClassification(classification);
351 359
			selection_SecRef.setEntity(((TaxonNode)parentTreeNode).getTaxon().getSec());
352 360
		} else if(parentTreeNode == null){
353
			this.parentTreeNode = selection_classification.getEntity();
361
			this.parentTreeNode = classification;
354 362
		}
355 363
	}
356 364

  

Also available in: Unified diff