Project

General

Profile

Download (1.47 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2007 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9
package eu.etaxonomy.taxeditor.ui.element;
10

    
11
import org.eclipse.ui.forms.widgets.ExpandableComposite;
12

    
13
import eu.etaxonomy.cdm.model.common.TimePeriod;
14

    
15
/**
16
 * TimePeriodElement class.
17
 *
18
 * @author n.hoffmann
19
 * @created Nov 17, 2009
20
 */
21
public class TimePeriodElement
22
			extends TimePeriodElementBase<TimePeriod> implements IEnableableFormElement{
23
    boolean isEnabled = true;
24

    
25
    public TimePeriodElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString,
26
			TimePeriod timePeriod, int style) {
27
		super(formFactory, parentElement, labelString, timePeriod, style);
28
	}
29

    
30
	@Override
31
	protected DateDetailSection<TimePeriod> createDateDetailSection() {
32
		return formFactory.createDateDetailSection(this,
33
				ExpandableComposite.TWISTIE);
34
	}
35

    
36
    @Override
37
    public void setEnabled(boolean enabled) {
38
        this.isEnabled = enabled;
39
        for (ICdmFormElement element: getElements()){
40
            if (element instanceof IEnableableFormElement){
41
                IEnableableFormElement enableableElement = (IEnableableFormElement) element;
42
                enableableElement.setEnabled(enabled);
43
            }
44
        }
45

    
46
    }
47

    
48
    @Override
49
    public boolean isEnabled() {
50
        return isEnabled;
51
    }
52

    
53
}
(52-52/57)