this demo Sampler of the Grid
widget에는 소스 코드 탭에 ComponentRenderer
이라는 클래스를 호출하는 코드가 표시됩니다.Vaadin Sampler의 '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에 나열되어 있습니다. 그렇다면이 데모 코드에서 어떤 클래스가 사용되고 있습니까?
https://github.com/datenhahn/componentrenderer/ –