Search in sources :

Example 1 with Header

use of com.vaadin.flow.component.html.Header in project aire-components by aire-ux.

the class Overlay method createHeader.

protected Header createHeader() {
    val header = new Header();
    header.getElement().setAttribute("slot", "header");
    return header;
}
Also used : lombok.val(lombok.val) Header(com.vaadin.flow.component.html.Header)

Example 2 with Header

use of com.vaadin.flow.component.html.Header in project docs by vaadin.

the class DialogNoPadding method createDialogLayout.

private static VerticalLayout createDialogLayout(Dialog dialog) {
    H2 dialogTitle = new H2("Create new employee");
    Header header = new Header(dialogTitle);
    VerticalLayout personalInformationSection = createPersonalInformationSection();
    VerticalLayout employeeInformationSection = createEmployeeInformationSection();
    VerticalLayout scrollContent = new VerticalLayout(personalInformationSection, employeeInformationSection);
    Scroller scroller = new Scroller(scrollContent);
    Footer footer = createFooter(dialog);
    VerticalLayout dialogContent = new VerticalLayout(header, scroller, footer);
    dialogContent.setPadding(false);
    dialogContent.setSpacing(false);
    dialogContent.getStyle().remove("width");
    dialogContent.setAlignItems(FlexComponent.Alignment.STRETCH);
    dialogContent.setClassName("dialog-no-padding-example-overlay");
    return dialogContent;
}
Also used : Header(com.vaadin.flow.component.html.Header) Footer(com.vaadin.flow.component.html.Footer) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2) Scroller(com.vaadin.flow.component.orderedlayout.Scroller)

Example 3 with Header

use of com.vaadin.flow.component.html.Header in project sapl-demos by heutelbeck.

the class MainLayout method createHeaderContent.

private Component createHeaderContent() {
    DrawerToggle toggle = new DrawerToggle();
    toggle.addClassName("text-secondary");
    toggle.addThemeVariants(ButtonVariant.LUMO_CONTRAST);
    toggle.getElement().setAttribute("aria-label", "Menu toggle");
    viewTitle = new H1();
    viewTitle.addClassNames("m-0", "text-l", "margin-top");
    Button logoutBtn = new Button();
    logoutBtn.addClassName("nav-logout-btn");
    logoutBtn.setText("Logout");
    logoutBtn.addClickListener((x) -> SecurityUtils.logout());
    H4 userRole = new H4(SecurityContextHolder.getContext().getAuthentication().getAuthorities().toString());
    userRole.addClassName("nav-logout-btn");
    userRole.getStyle().set("margin-bottom", "18px");
    Header header = new Header(toggle, viewTitle, userRole, logoutBtn);
    header.addClassNames("bg-base", "border-b", "border-contrast-10", "box-border", "flex", "h-xl", "items-center", "w-full");
    return header;
}
Also used : Header(com.vaadin.flow.component.html.Header) Button(com.vaadin.flow.component.button.Button) H1(com.vaadin.flow.component.html.H1) H4(com.vaadin.flow.component.html.H4) DrawerToggle(com.vaadin.flow.component.applayout.DrawerToggle)

Example 4 with Header

use of com.vaadin.flow.component.html.Header in project Akros-Marketplace by AkrosAG.

the class MainLayout method createHeaderContent.

private Component createHeaderContent() {
    Header header = new Header();
    header.addClassNames("bg-base", "border-b", "border-contrast-10", "box-border", "flex", "flex-col", "w-full");
    Div layout = new Div();
    layout.addClassNames("flex", "h-xl", "items-center", "px-l");
    H1 appName = new H1("Akros Marketplace Administration");
    appName.addClassNames("my-0", "me-auto", "text-xl");
    layout.add(appName);
    Nav nav = new Nav();
    nav.addClassNames("flex", "gap-s", "overflow-auto", "px-m");
    // Wrap the links in a list; improves accessibility
    UnorderedList list = new UnorderedList();
    list.addClassNames("flex", "list-none", "m-0", "p-0");
    nav.add(list);
    for (RouterLink link : createLinks()) {
        ListItem item = new ListItem(link);
        list.add(item);
    }
    header.add(layout, nav);
    return header;
}
Also used : Div(com.vaadin.flow.component.html.Div) RouterLink(com.vaadin.flow.router.RouterLink) Nav(com.vaadin.flow.component.html.Nav) Header(com.vaadin.flow.component.html.Header) H1(com.vaadin.flow.component.html.H1) UnorderedList(com.vaadin.flow.component.html.UnorderedList) ListItem(com.vaadin.flow.component.html.ListItem)

Example 5 with Header

use of com.vaadin.flow.component.html.Header in project isis-lab by apache-isis-committers.

the class _SideMenuLayout method createHeaderContent.

Component createHeaderContent(final H1 viewTitle) {
    DrawerToggle toggle = new DrawerToggle();
    toggle.addClassName("text-secondary");
    toggle.addThemeVariants(ButtonVariant.LUMO_CONTRAST);
    toggle.getElement().setAttribute("aria-label", "Menu toggle");
    viewTitle.addClassNames("m-0", "text-l");
    Header header = new Header(toggle, viewTitle);
    header.addClassNames("bg-base", "border-b", "border-contrast-10", "box-border", "flex", "h-xl", "items-center", "w-full");
    return header;
}
Also used : Header(com.vaadin.flow.component.html.Header) DrawerToggle(com.vaadin.flow.component.applayout.DrawerToggle)

Aggregations

Header (com.vaadin.flow.component.html.Header)6 H1 (com.vaadin.flow.component.html.H1)3 DrawerToggle (com.vaadin.flow.component.applayout.DrawerToggle)2 Div (com.vaadin.flow.component.html.Div)2 Nav (com.vaadin.flow.component.html.Nav)2 UnorderedList (com.vaadin.flow.component.html.UnorderedList)2 Button (com.vaadin.flow.component.button.Button)1 Footer (com.vaadin.flow.component.html.Footer)1 H2 (com.vaadin.flow.component.html.H2)1 H4 (com.vaadin.flow.component.html.H4)1 ListItem (com.vaadin.flow.component.html.ListItem)1 Scroller (com.vaadin.flow.component.orderedlayout.Scroller)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 RouterLink (com.vaadin.flow.router.RouterLink)1 lombok.val (lombok.val)1