src/main/java/org/vaadin/example/DialogHeaderBar.java
/**
     * Creates a new header bar, inserts it into the dialog, reconfigures the dialog
     * to have no content padding, and returns the header bar.
     *
     * @param dialog the dialog to control, not null.
     * @return the header bar.
     */
Creates a new header bar, inserts it into the dialog, reconfigures the dialog
to have no content padding, and returns the header bar.

@param dialog the dialog to control, not null.
@return the header bar.
Creates a new header bar inserts it into the dialog reconfigures the dialog to have no content padding and returns the header bar . @param dialog the dialog to control not null . @return the header bar .
@NotNull
    public static DialogHeaderBar addTo(@NotNull Dialog dialog) {
        if (dialog.getChildren().anyMatch(it -> it instanceof DialogHeaderBar)) {
            throw new IllegalArgumentException("Parameter dialog: invalid value " + dialog + ": already has a header bar");
        }
        dialog.getElement().getThemeList().add("no-padding");
        final DialogHeaderBar headerBar = new DialogHeaderBar(dialog);
        dialog.addComponentAsFirst(headerBar);
        return headerBar;
    }
@ NotNull public static DialogHeaderBar addTo ( @ NotNull Dialog dialog ) { if ( dialog . getChildren ( ) . anyMatch ( it -> it instanceof DialogHeaderBar ) ) { throw new IllegalArgumentException ( "Parameter dialog: invalid value " + dialog + ": already has a header bar" ) ; } dialog . getElement ( ) . getThemeList ( ) . add ( "no-padding" ) ; final DialogHeaderBar headerBar = new DialogHeaderBar ( dialog ) ; dialog . addComponentAsFirst ( headerBar ) ; return headerBar ; }
Creates a new header bar, inserts it into the dialog, reconfigures the dialog
 to have no content padding, and returns the header bar.
Creates a new header bar inserts it into the dialog reconfigures the dialog to have no content padding and returns the header bar .
// remove padding from content, to have no border around the header bar. // workaround for https://github.com/vaadin/vaadin-dialog/issues/126