Project

General

Profile

Download (1.73 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 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.editor.workingSet.matrix.quantitative;
10

    
11
import org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor;
12
import org.eclipse.swt.SWT;
13
import org.eclipse.swt.widgets.Composite;
14
import org.eclipse.swt.widgets.Control;
15

    
16
import eu.etaxonomy.cdm.model.description.CategoricalData;
17

    
18
/**
19
 * @author pplitzner
20
 * @since Dec 7, 2017
21
 *
22
 */
23
public class QuantitativeDataCellEditor extends AbstractCellEditor{
24

    
25
    private QuantitativeDataComposite editorControl;
26

    
27
    /**
28
     * {@inheritDoc}
29
     */
30
    @Override
31
    public Object getEditorValue() {
32
        System.out.println("getValue");
33
        return editorControl.getMin()+" "+editorControl.getAvg()+" "+editorControl.getMax();
34
    }
35

    
36
    /**
37
     * {@inheritDoc}
38
     */
39
    @Override
40
    public void setEditorValue(Object value) {
41
        if(value instanceof CategoricalData){
42
            System.out.println("setValue: "+value);
43
        }
44
    }
45

    
46
    /**
47
     * {@inheritDoc}
48
     */
49
    @Override
50
    public Control getEditorControl() {
51
        return editorControl;
52
    }
53

    
54
    /**
55
     * {@inheritDoc}
56
     */
57
    @Override
58
    public Control createEditorControl(Composite parent) {
59
        return new QuantitativeDataComposite(parent, SWT.NONE);
60
    }
61

    
62
    /**
63
     * {@inheritDoc}
64
     */
65
    @Override
66
    protected Control activateCell(Composite parent, Object originalCanonicalValue) {
67
        this.editorControl = (QuantitativeDataComposite) createEditorControl(parent);
68
        return editorControl;
69
    }
70

    
71

    
72
}
(1-1/3)