Revision c42c7bec
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/categorical/CategoricalDataCellEditor.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider; |
14 | 14 |
import org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowComboBoxCellEditor; |
15 |
import org.eclipse.nebula.widgets.nattable.widget.NatCombo; |
|
16 |
import org.eclipse.swt.events.SelectionEvent; |
|
17 |
import org.eclipse.swt.events.SelectionListener; |
|
18 |
import org.eclipse.swt.widgets.Composite; |
|
19 |
import org.eclipse.swt.widgets.Control; |
|
15 | 20 |
|
16 | 21 |
import eu.etaxonomy.cdm.model.description.CategoricalData; |
17 | 22 |
import eu.etaxonomy.cdm.model.description.State; |
23 |
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.CharacterMatrix; |
|
18 | 24 |
|
19 | 25 |
/** |
20 | 26 |
* @author pplitzner |
... | ... | |
23 | 29 |
*/ |
24 | 30 |
public class CategoricalDataCellEditor extends FilterRowComboBoxCellEditor{ |
25 | 31 |
|
26 |
public CategoricalDataCellEditor(IComboBoxDataProvider dataProvider, int maxVisibleItems) { |
|
32 |
private CharacterMatrix matrix; |
|
33 |
|
|
34 |
public CategoricalDataCellEditor(IComboBoxDataProvider dataProvider, int maxVisibleItems, CharacterMatrix matrix) { |
|
27 | 35 |
super(dataProvider, maxVisibleItems); |
36 |
this.matrix = matrix; |
|
28 | 37 |
} |
29 | 38 |
|
30 | 39 |
@Override |
... | ... | |
41 | 50 |
} |
42 | 51 |
} |
43 | 52 |
|
53 |
/** |
|
54 |
* {@inheritDoc} |
|
55 |
*/ |
|
56 |
@Override |
|
57 |
protected Control activateCell(Composite parent, Object originalCanonicalValue) { |
|
58 |
Control editorControl = super.activateCell(parent, originalCanonicalValue); |
|
59 |
((NatCombo)editorControl).addSelectionListener(new SelectionListener() { |
|
60 |
@Override |
|
61 |
public void widgetSelected(SelectionEvent e) { |
|
62 |
matrix.setDirty(); |
|
63 |
} |
|
64 |
@Override |
|
65 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
66 |
} |
|
67 |
}); |
|
68 |
return editorControl; |
|
69 |
} |
|
70 |
|
|
44 | 71 |
} |
Also available in: Unified diff
ref #7095 Handle dirty state of character matrix when editing