Revision 90d7f315
Added by Patrick Plitzner almost 8 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java | ||
---|---|---|
5 | 5 |
|
6 | 6 |
import com.vaadin.annotations.AutoGenerated; |
7 | 7 |
import com.vaadin.data.Container; |
8 |
import com.vaadin.data.Item; |
|
8 | 9 |
import com.vaadin.data.util.IndexedContainer; |
9 | 10 |
import com.vaadin.event.ShortcutAction.KeyCode; |
10 | 11 |
import com.vaadin.navigator.View; |
... | ... | |
85 | 86 |
public void dataBinding(){ |
86 | 87 |
List<TaxonNode> classificationList = distListener.getTaxonNodeList(); |
87 | 88 |
List<TermVocabulary<DefinedTermBase>> namedAreaList = distListener.getNamedAreaList(); |
88 |
Container c = new IndexedContainer(classificationList); |
|
89 |
Container c = new IndexedContainer(); |
|
90 |
String propertyId = "label"; |
|
91 |
c.addContainerProperty(propertyId, String.class, "[no taxon]"); |
|
92 |
for (TaxonNode taxonNode : classificationList) { |
|
93 |
Item item = c.addItem(taxonNode); |
|
94 |
if(taxonNode.getTaxon()!=null){ |
|
95 |
item.getItemProperty(propertyId).setValue(taxonNode.getTaxon().getName().getTitleCache()); |
|
96 |
} |
|
97 |
else if(taxonNode.getClassification()!=null){ |
|
98 |
item.getItemProperty(propertyId).setValue(taxonNode.getClassification().getName().getText()); |
|
99 |
} |
|
100 |
} |
|
101 |
classificationBox.setItemCaptionPropertyId(propertyId); |
|
89 | 102 |
classificationBox.setContainerDataSource(c); |
90 | 103 |
// classificationSelection.setContainerDataSource(c); |
91 | 104 |
Container d = new IndexedContainer(namedAreaList); |
Also available in: Unified diff
Fix label of selection box #5458