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;
|
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
|
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.quantitative.QuantitativeDataComposite;
|
18
|
|
19
|
/**
|
20
|
* @author pplitzner
|
21
|
* @since Dec 7, 2017
|
22
|
*
|
23
|
*/
|
24
|
public class QuantitativeDataCellEditor extends AbstractCellEditor{
|
25
|
|
26
|
private QuantitativeDataComposite editorControl;
|
27
|
|
28
|
/**
|
29
|
* {@inheritDoc}
|
30
|
*/
|
31
|
@Override
|
32
|
public Object getEditorValue() {
|
33
|
System.out.println("getValue");
|
34
|
return editorControl.getMin()+" "+editorControl.getAvg()+" "+editorControl.getMax();
|
35
|
}
|
36
|
|
37
|
/**
|
38
|
* {@inheritDoc}
|
39
|
*/
|
40
|
@Override
|
41
|
public void setEditorValue(Object value) {
|
42
|
if(value instanceof CategoricalData){
|
43
|
System.out.println("setValue: "+value);
|
44
|
}
|
45
|
}
|
46
|
|
47
|
/**
|
48
|
* {@inheritDoc}
|
49
|
*/
|
50
|
@Override
|
51
|
public Control getEditorControl() {
|
52
|
return editorControl;
|
53
|
}
|
54
|
|
55
|
/**
|
56
|
* {@inheritDoc}
|
57
|
*/
|
58
|
@Override
|
59
|
public Control createEditorControl(Composite parent) {
|
60
|
return new QuantitativeDataComposite(parent, SWT.NONE);
|
61
|
}
|
62
|
|
63
|
/**
|
64
|
* {@inheritDoc}
|
65
|
*/
|
66
|
@Override
|
67
|
protected Control activateCell(Composite parent, Object originalCanonicalValue) {
|
68
|
this.editorControl = (QuantitativeDataComposite) createEditorControl(parent);
|
69
|
return editorControl;
|
70
|
}
|
71
|
|
72
|
|
73
|
}
|