I am adding icons to the option entries in a combo box using the following code:
docStatusCombo.setRenderer(new ComponentRenderer<>(filterStatusType -> {
String iconName = "docIcon-" + filterStatusType.getVaadinIcon();
Div div = new Div();
Div statusTextDiv = new Div();
Span statusTextSpan = new Span(filterStatusType.getLabel());
statusTextDiv.addClassName("filter-status-option-text-div");
statusTextDiv.add(statusTextSpan);
Div statusIconDiv = new Div();
statusIconDiv.addClassName("filter-status-option-icon-div");
Icon statusIcon = new Icon(filterStatusType.getVaadinIcon());
statusIcon.addClassName(iconName);
statusIconDiv.add(statusIcon);
div.add(statusTextDiv, statusIconDiv);
return div;
}));
I am trying to add css to style the entries, but it doesn’t seem to get applied. Is it possible to do this jor am I going about this the wrong way?
The values are going to be set dynamically depending on the item being added to the combo box. Is there a way to programmatically pull out the values of a particular class from my css file that I created? It may let me set the style if I set it inline?