AligningHorizontalLayout toolbar = new AligningHorizontalLayout(Alignment.MIDDLE_RIGHT);
toolbar.setWidth(100, UNITS_PERCENTAGE);
toolbar.setMargin(false);
toolbar.setSpacing(false);
toolbar.addComponent(titleLabel);
for (Component comp : otherButtons) {
if (comp instanceof Button) {
Button button = (Button) comp;
if (button.getIcon() != null && button.getWidth() > 0 && button.getWidthUnits() == UNITS_PIXELS) {
button.setWidth(button.getWidth() + 20, UNITS_PIXELS);