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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations