1 |
bd0b8f0e
|
Patrick Plitzner
|
// $Id$
|
2 |
|
|
/**
|
3 |
|
|
* Copyright (C) 2018 EDIT
|
4 |
|
|
* European Distributed Institute of Taxonomy
|
5 |
|
|
* http://www.e-taxonomy.eu
|
6 |
|
|
*
|
7 |
|
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9 |
|
|
*/
|
10 |
|
|
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical;
|
11 |
|
|
|
12 |
|
|
import java.util.List;
|
13 |
|
|
|
14 |
|
|
import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider;
|
15 |
|
|
|
16 |
|
|
import eu.etaxonomy.cdm.model.description.Feature;
|
17 |
|
|
import eu.etaxonomy.cdm.model.description.State;
|
18 |
|
|
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
|
19 |
|
|
|
20 |
|
|
/**
|
21 |
|
|
* @author pplitzner
|
22 |
|
|
* @date 24.07.2018
|
23 |
|
|
*
|
24 |
|
|
*/
|
25 |
|
|
public class CategoricalComboBoxDataProvider implements IComboBoxDataProvider {
|
26 |
|
|
|
27 |
|
|
private CharacterMatrix matrix;
|
28 |
|
|
|
29 |
|
|
public CategoricalComboBoxDataProvider(CharacterMatrix matrix) {
|
30 |
|
|
super();
|
31 |
|
|
this.matrix = matrix;
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
@Override
|
35 |
|
|
public List<?> getValues(int columnIndex, int rowIndex) {
|
36 |
77aef047
|
Patrick Plitzner
|
Feature feature = matrix.getIndexToCharacterMap().get(columnIndex);
|
37 |
bd0b8f0e
|
Patrick Plitzner
|
List<State> supportedStatesForCategoricalFeature = matrix.getSupportedStatesForCategoricalFeature(feature);
|
38 |
|
|
return supportedStatesForCategoricalFeature;
|
39 |
|
|
}
|
40 |
|
|
|
41 |
|
|
}
|