I want to add a dropdown button which usually works as an expand / collapse button in a treegrid. I can't seem to find in the documentation how to add a button which is the exact width and height of the dropdown button, e.g. the specific (custom) button class. This dropdown button should be added to a cell component even if it cannot be expanded / collapsed. The outcome should be that the button in the circle should also be present in the place of the x marks.
I am not fully sure in which context you are going to use this button, but here is an example of borderless button, with html caption that uses the same styles than TreeGrid uses for collapse button.
Button btn = new Button();
btn.addStyleNames("v-treegrid-expander","collapsed");
btn.addStyleName(ValoTheme.BUTTON_BORDERLESS);
btn.addClickListener(event -> {
btn.removeStyleName("collapsed");
btn.addStyleName("expanded");
});
layout.addComponent(btn);