Project

General

Profile

Revision b393d65c

IDb393d65cb518423c66163fe6ede8cbea77fd93ae
Parent eeb8c46f
Child 9c1f8392

Added by Patrick Plitzner almost 3 years ago

ref #6746 Fix some titleCache problems

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CreateFeatureTreeHandler.java
31 31
    @Execute
32 32
    public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart thisPart){
33 33
        FeatureTree tree = FeatureTree.NewInstance();
34
        tree.setTitleCache("New feature tree", true);
34 35
        FeatureTreeEditor editor = (FeatureTreeEditor) thisPart.getObject();
35 36
        List<FeatureTree> trees = (List<FeatureTree>) editor.getViewer().getInput();
36 37
        trees.add(tree);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureTreeDetailElement.java
11 11
import eu.etaxonomy.cdm.model.description.FeatureTree;
12 12
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
13 13
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
14
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
15
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
14
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
16 15

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

  
25
    private ToggleableTextElement toggleableText_titleCache;
22
public class FeatureTreeDetailElement extends AbstractIdentifiableEntityDetailElement<FeatureTree> {
26 23

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

  
29

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

  
37
	/**
38
	 * {@inheritDoc}
39
	 */
40
	@Override
41
	protected void updateControlStates() {
42
	    super.updateControlStates();
43
	    toggleable_cache.setEnabled(getEntity().isProtectedTitleCache());
44
	}
45

  
39 46
	@Override
40 47
	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());
48
	    if (eventSource == toggleable_cache) {
49
	            handleToggleableCacheField();
47 50
        }
48 51
	}
49 52

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)