Revision 5decc8b9
Added by Patrick Plitzner about 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalComboBoxDataProvider.java | ||
---|---|---|
25 | 25 |
public class CategoricalComboBoxDataProvider implements IComboBoxDataProvider { |
26 | 26 |
|
27 | 27 |
private CharacterMatrix matrix; |
28 |
private int maxVisibleItems; |
|
29 | 28 |
|
30 | 29 |
public CategoricalComboBoxDataProvider(CharacterMatrix matrix) { |
31 | 30 |
super(); |
... | ... | |
36 | 35 |
public List<?> getValues(int columnIndex, int rowIndex) { |
37 | 36 |
Feature feature = matrix.getIndexToCharacterMap().get(columnIndex); |
38 | 37 |
List<State> supportedStatesForCategoricalFeature = matrix.getSupportedStatesForCategoricalFeature(feature); |
39 |
maxVisibleItems = Math.max(3, Math.min(supportedStatesForCategoricalFeature.size()-1, 10)); |
|
40 | 38 |
return supportedStatesForCategoricalFeature; |
41 | 39 |
} |
42 | 40 |
|
43 |
int getMaxVisibleItems(){ |
|
44 |
return maxVisibleItems; |
|
45 |
} |
|
46 | 41 |
} |
Also available in: Unified diff
ref #8242 Set max items for dropdown to 10 + sort items