Project

General

Profile

Download (1.63 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2009 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.section.feature;
10

    
11
import eu.etaxonomy.cdm.model.description.FeatureTree;
12
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
13
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
14
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
15
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
16

    
17
/**
18
 *
19
 * @author pplitzner
20
 * @since Dec 21, 2017
21
 *
22
 */
23
public class FeatureTreeDetailElement extends AbstractCdmDetailElement<FeatureTree> {
24

    
25
    private ToggleableTextElement toggleableText_titleCache;
26

    
27
	public FeatureTreeDetailElement(CdmFormFactory formFactory,
28
			ICdmFormElement formElement) {
29
		super(formFactory, formElement);
30
	}
31

    
32
	@Override
33
	protected void createControls(ICdmFormElement formElement, FeatureTree entity, int style) {
34
	    toggleableText_titleCache = formFactory.createToggleableTextField(
35
                formElement, "Title Cache", entity.getTitleCache(),
36
                entity.isProtectedTitleCache(), style);
37
    }
38

    
39
	@Override
40
	public void handleEvent(Object eventSource) {
41
	    if (eventSource == toggleableText_titleCache) {
42
            getEntity().setTitleCache(toggleableText_titleCache.getText(),
43
                    toggleableText_titleCache.getState());
44
        }
45
        if (eventSource != toggleableText_titleCache) {
46
            toggleableText_titleCache.setText(getEntity().getTitleCache());
47
        }
48
	}
49

    
50
}
(7-7/12)