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