Project

General

Profile

Revision 4eb4e01e

ID4eb4e01e4fc30736435abb862135f69684d3d8fb
Parent 9c1f8392
Child cedc4ff1

Added by Patrick Plitzner over 1 year ago

ref #6746 Fix detail element enabling

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
3026 3026
                    style);
3027 3027
        } else if (entity instanceof Distribution && !enabled) {
3028 3028
            detailedDescriptionElement = new DistributionDetailElement(this, parentElement, (Distribution) entity,
3029
                    style);
3030
            detailedDescriptionElement.setEnabled(enabled);
3029
                    enabled, style);
3031 3030
        } else if (entity instanceof Distribution) {
3032 3031
            detailedDescriptionElement = new DistributionDetailElement(this, parentElement, (Distribution) entity,
3033
                    style);
3032
                    true, style);
3034 3033
        }else if (entity instanceof IndividualsAssociation) {
3035 3034
            detailedDescriptionElement = new IndividualsAssociationDetailElement(this, parentElement,
3036 3035
                    (IndividualsAssociation) entity, style);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java
53 53

  
54 54
	private boolean irrelevant;
55 55

  
56
	private boolean enabled;
56
	private boolean enabled = true;
57 57

  
58 58
	private LabelElement warnForReferencedObjects;
59 59

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailSection.java
126 126
	public void setEntity(ENTITY entity) {
127 127
		if (detailElement != null) {
128 128
			detailElement.setEntity(entity);
129
			detailElement.setEnabled(getEnabled());
129
	        Collection<Object> except = new ArrayList<Object>();
130
	        for(ICdmFormElement formElement:detailElement.getElements()){
131
	            if(formElement instanceof IEnableableFormElement && !((IEnableableFormElement) formElement).isEnabled()){
132
	                except.add(formElement);
133
	            }
134
	        }
135
			detailElement.setEnabled(isEnabled(), except);
130 136
		}
131 137
		super.setEntity(entity);
132 138
		setSectionTitle();
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/DistributionDetailElement.java
41 41
	 * @param style a int.
42 42
	 */
43 43
	public DistributionDetailElement(CdmFormFactory formFactory,
44
			ICdmFormElement formElement, Distribution entity, int style) {
44
			ICdmFormElement formElement, Distribution entity, boolean enabled, int style) {
45 45
		super(formFactory, formElement, entity, style);
46
		setEnabled(enabled);
46 47

  
47 48
	}
48 49

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)