Search in sources :

Example 16 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project docs by vaadin.

the class AppLayoutBasic method getTabs.

// end::snippet[]
private Tabs getTabs() {
    Tabs tabs = new Tabs();
    tabs.add(createTab(VaadinIcon.DASHBOARD, "Dashboard"), createTab(VaadinIcon.CART, "Orders"), createTab(VaadinIcon.USER_HEART, "Customers"), createTab(VaadinIcon.PACKAGE, "Products"), createTab(VaadinIcon.RECORDS, "Documents"), createTab(VaadinIcon.LIST, "Tasks"), createTab(VaadinIcon.CHART, "Analytics"));
    tabs.setOrientation(Tabs.Orientation.VERTICAL);
    return tabs;
}
Also used : Tabs(com.vaadin.flow.component.tabs.Tabs)

Example 17 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project docs by vaadin.

the class AppLayoutDrawer method getTabs.

// end::snippet[]
private Tabs getTabs() {
    Tabs tabs = new Tabs();
    tabs.add(createTab(VaadinIcon.DASHBOARD, "Dashboard"), createTab(VaadinIcon.CART, "Orders"), createTab(VaadinIcon.USER_HEART, "Customers"), createTab(VaadinIcon.PACKAGE, "Products"), createTab(VaadinIcon.RECORDS, "Documents"), createTab(VaadinIcon.LIST, "Tasks"), createTab(VaadinIcon.CHART, "Analytics"));
    tabs.setOrientation(Tabs.Orientation.VERTICAL);
    return tabs;
}
Also used : Tabs(com.vaadin.flow.component.tabs.Tabs)

Example 18 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project docs by vaadin.

the class AppLayoutNavbar method getTabs.

// end::snippet[]
private Tabs getTabs() {
    Tabs tabs = new Tabs();
    tabs.getStyle().set("margin", "auto");
    tabs.add(createTab("Dashboard"), createTab("Orders"), createTab("Customers"), createTab("Products"));
    return tabs;
}
Also used : Tabs(com.vaadin.flow.component.tabs.Tabs)

Example 19 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project docs by vaadin.

the class AppLayoutNavbarPlacement method getTabs.

// end::snippet[]
private Tabs getTabs() {
    Tabs tabs = new Tabs();
    tabs.add(createTab(VaadinIcon.DASHBOARD, "Dashboard"), createTab(VaadinIcon.CART, "Orders"), createTab(VaadinIcon.USER_HEART, "Customers"), createTab(VaadinIcon.PACKAGE, "Products"), createTab(VaadinIcon.RECORDS, "Documents"), createTab(VaadinIcon.LIST, "Tasks"), createTab(VaadinIcon.CHART, "Analytics"));
    tabs.setOrientation(Tabs.Orientation.VERTICAL);
    return tabs;
}
Also used : Tabs(com.vaadin.flow.component.tabs.Tabs)

Example 20 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project sapl-demos by heutelbeck.

the class LoginView method createUserList.

private void createUserList() {
    add(new H3("User list"));
    Div contentContainer = new Div();
    Map<String, Component> tabComponentMap = createUserTabs();
    var tabs = new Tabs();
    tabComponentMap.forEach((title, component) -> tabs.add(new Tab(title)));
    tabs.addSelectedChangeListener(event -> {
        contentContainer.removeAll();
        contentContainer.add(tabComponentMap.get(event.getSelectedTab().getLabel()));
    });
    // init
    contentContainer.add(tabComponentMap.get(tabs.getSelectedTab().getLabel()));
    add(tabs, contentContainer);
}
Also used : Div(com.vaadin.flow.component.html.Div) Tab(com.vaadin.flow.component.tabs.Tab) Tabs(com.vaadin.flow.component.tabs.Tabs) H3(com.vaadin.flow.component.html.H3) Component(com.vaadin.flow.component.Component)

Aggregations

Tabs (com.vaadin.flow.component.tabs.Tabs)40 Tab (com.vaadin.flow.component.tabs.Tab)17 Test (org.junit.Test)16 Component (com.vaadin.flow.component.Component)5 Div (com.vaadin.flow.component.html.Div)3 FlexComponent (com.vaadin.flow.component.orderedlayout.FlexComponent)2 ShowComponentRequestedEvent (org.archcnl.ui.outputview.sidebar.events.ShowComponentRequestedEvent)2 HasElement (com.vaadin.flow.component.HasElement)1 Text (com.vaadin.flow.component.Text)1 H3 (com.vaadin.flow.component.html.H3)1 NativeButton (com.vaadin.flow.component.html.NativeButton)1 Icon (com.vaadin.flow.component.icon.Icon)1 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 TabsVariant (com.vaadin.flow.component.tabs.TabsVariant)1 Element (com.vaadin.flow.dom.Element)1 FurmsViewComponent (io.imunity.furms.ui.components.FurmsViewComponent)1 LogoutIconFactory (io.imunity.furms.ui.components.LogoutIconFactory)1 MenuComponent (io.imunity.furms.ui.components.MenuComponent)1 TabComponent (io.imunity.furms.ui.components.TabComponent)1