Project

General

Profile

Revision 436a661e

ID436a661e6d6f9efdd6d0c04f7bf6433b8229dad2
Parent 92a795af
Child bcc1d18a

Added by Katja Luther about 3 years ago

ref #2444: enable and disable binom/trinom flag

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/HybridDetailElement.java
9 9

  
10 10
package eu.etaxonomy.taxeditor.ui.section.name;
11 11

  
12
import org.eclipse.jface.util.PropertyChangeEvent;
13

  
12 14
import eu.etaxonomy.cdm.model.name.INonViralName;
15
import eu.etaxonomy.cdm.model.name.Rank;
13 16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
14 17
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
15 18
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
......
38 41
	@Override
39 42
	protected void createControls(ICdmFormElement formElement, INonViralName entity,
40 43
			int style) {
44
	    boolean enableBinom = false;
45
	    boolean enableTrinom = false;
46
	    if (entity.getRank() != null){
47
    	    if (entity.getRank().isLower(Rank.GENUS())){
48
    	        enableBinom = true;
49
    	    }
50

  
51
    	    if (entity.getRank().isLower(Rank.SPECIES())){
52
                enableTrinom = true;
53
            }
54
	    }
41 55
		checkboxMonomHybrid = formFactory.createCheckbox(formElement, "Monom hybrid", entity.isMonomHybrid(), style);
42 56
		checkboxBinomHybrid = formFactory.createCheckbox(formElement, "Binom hybrid", entity.isBinomHybrid(), style);
57
		checkboxBinomHybrid.setEnabled(enableBinom);
43 58
		checkboxTrinomHybrid = formFactory.createCheckbox(formElement, "Trinom hybrid", entity.isTrinomHybrid(), style);
59
		checkboxTrinomHybrid.setEnabled(enableTrinom);
44 60
		checkboxHybridFormula = formFactory.createCheckbox(formElement, "Hybrid formula", entity.isHybridFormula(), style);
45 61
		checkboxHybridFormula.setEnabled(false);//read-only
46 62
	}
......
58 74
		}
59 75
	}
60 76

  
77

  
78

  
79

  
80
    @Override
81
    public void propertyChange(PropertyChangeEvent event) {
82
        if (event == null) {
83
            return;
84
        }
85
        updateContent();
86

  
87
    }
88

  
89

  
61 90
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)