Search in sources :

Example 26 with Tabs

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

the class MainView method createMenu.

// end::drawer[]
// tag::menu[]
private Tabs createMenu() {
    final Tabs tabs = new Tabs();
    tabs.setOrientation(Tabs.Orientation.VERTICAL);
    tabs.addThemeVariants(TabsVariant.LUMO_MINIMAL);
    tabs.setId("tabs");
    tabs.add(createMenuItems());
    return tabs;
}
Also used : Tabs(com.vaadin.flow.component.tabs.Tabs)

Example 27 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project karnak by OsiriX-Foundation.

the class DicomMainView method createMenu.

private void createMenu() {
    tabDicomEchoView = new Tab("DICOM Echo");
    pageDicomEchoView = new DicomEchoView();
    tabDicomWorkListView = new Tab("DICOM Worklist");
    pageDicomWorkListView = new DicomWorkListView();
    tabMonitorView = new Tab("Monitor");
    pageMonitorView = new MonitorView();
    tabsToPages = new HashMap<>();
    tabsToPages.put(tabDicomEchoView, pageDicomEchoView);
    tabsToPages.put(tabDicomWorkListView, pageDicomWorkListView);
    tabsToPages.put(tabMonitorView, pageMonitorView);
    menu = new Tabs(tabDicomEchoView, tabDicomWorkListView, tabMonitorView);
    add(menu);
    pagesShown = Stream.of(pageDicomEchoView).collect(Collectors.toSet());
    add(pageDicomEchoView);
    menu.addSelectedChangeListener(event -> {
        pagesShown.forEach(page -> page.setVisible(false));
        pagesShown.clear();
        Component selectedPage = tabsToPages.get(menu.getSelectedTab());
        selectedPage.setVisible(true);
        pagesShown.add(selectedPage);
        add(selectedPage);
    });
}
Also used : Tab(com.vaadin.flow.component.tabs.Tab) DicomWorkListView(org.karnak.frontend.dicom.mwl.DicomWorkListView) Tabs(com.vaadin.flow.component.tabs.Tabs) DicomEchoView(org.karnak.frontend.dicom.echo.DicomEchoView) Component(com.vaadin.flow.component.Component) MonitorView(org.karnak.frontend.dicom.monitor.MonitorView)

Example 28 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project layout-examples by vaadin.

the class AppNavLayout method createMenuTabs.

private static Tabs createMenuTabs() {
    final Tabs tabs = new Tabs();
    tabs.setOrientation(Tabs.Orientation.HORIZONTAL);
    tabs.add(getAvailableTabs());
    tabs.addThemeVariants(TabsVariant.LUMO_MINIMAL);
    return tabs;
}
Also used : Tabs(com.vaadin.flow.component.tabs.Tabs)

Example 29 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project Latex-Generator by Yassine-Lafryhi.

the class MainView method createMenuTabs.

private static Tabs createMenuTabs() {
    final Tabs tabs = new Tabs();
    tabs.setOrientation(Tabs.Orientation.HORIZONTAL);
    tabs.add(getAvailableTabs());
    return tabs;
}
Also used : Tabs(com.vaadin.flow.component.tabs.Tabs)

Example 30 with Tabs

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

the class TabsPage method createTabsWithThemeVariants.

private void createTabsWithThemeVariants() {
    Tab tab1 = new Tab("Tab one");
    Tab tab2 = new Tab("Tab two");
    Tab tab3 = new Tab("Tab three");
    Tabs tabs = new Tabs(tab1, tab2, tab3);
    tabs.addThemeVariants(TabsVariant.LUMO_SMALL);
    tabs.setId("tabs-with-theme");
    NativeButton removeVariantButton = new NativeButton("Remove theme variant", e -> {
        tabs.removeThemeVariants(TabsVariant.LUMO_SMALL);
    });
    removeVariantButton.setId("remove-theme-variant-button");
    addCard("Tabs theme variant", tabs, removeVariantButton);
}
Also used : NativeButton(com.vaadin.flow.component.html.NativeButton) Tab(com.vaadin.flow.component.tabs.Tab) Tabs(com.vaadin.flow.component.tabs.Tabs)

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