在this demo Sampler of the Grid
widget中,源代码标签显示调用名为ComponentRenderer
的类的代码。
Map<CountryData, Double> countryRatings = new HashMap<>();
Grid<CountryData> countryGrid = new Grid<CountryData>(
"Rate your favorite Countries");
countryGrid.setItems(countries);
countryGrid.addColumn(country -> new Label(country.getFullName()),
new ComponentRenderer()).setCaption("Name");
countryGrid.addColumn(country -> {
RatingStars ratingStars = new RatingStars();
ratingStars.setMaxValue(5);
ratingStars.setValue(countryRatings.containsKey(country)
? countryRatings.get(country) : 0.0d);
ratingStars.addValueChangeListener(
event -> countryRatings.put(country, event.getValue()));
return ratingStars;
}, new ComponentRenderer()).setCaption("Rating");
我找不到Vaadin 8.0.3 API JavaDoc中列出的这个类。那么这个演示代码中使用的是什么类?