Search in sources :

Example 11 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project ArchCNL by Mari-Wie.

the class SideBarWidget method addTabs.

public void addTabs(final QueryResultsComponent defaultQueryView, final CustomQueryView customQueryView, final FreeTextQueryComponent freeTextQueryView) {
    generalInformationTab = new SideBarTab("General Information", VaadinIcon.INFO_CIRCLE, defaultQueryView);
    customQueryTab = new SideBarTab("Custom Queries", VaadinIcon.AUTOMATION, customQueryView);
    freeTextQueryTab = new SideBarTab("Free Text Queries", VaadinIcon.TEXT_INPUT, freeTextQueryView);
    tabs = new Tabs(generalInformationTab, customQueryTab, freeTextQueryTab);
    tabs.setOrientation(Tabs.Orientation.VERTICAL);
    tabs.setHeightFull();
    tabs.addSelectedChangeListener(event -> {
        if (event.getSelectedTab() instanceof SideBarTab) {
            final SideBarTab tab = (SideBarTab) event.getSelectedTab();
            fireEvent(new ShowComponentRequestedEvent(this, true, tab.getLinkedComponent()));
        }
    });
    add(tabs);
}
Also used : ShowComponentRequestedEvent(org.archcnl.ui.outputview.sidebar.events.ShowComponentRequestedEvent) Tabs(com.vaadin.flow.component.tabs.Tabs)

Example 12 with Tabs

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

the class MainView method createMenu.

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 13 with Tabs

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

the class ContentView method createRightUpperSideTabVisibleLogic.

private void createRightUpperSideTabVisibleLogic(Div page1JsonEditorDiv, Div page2MockInput, Div page3MockHelpText) {
    this.tabsToPages = new HashMap<>();
    tabsToPages.put(this.tab1AuthzSubInput, page1JsonEditorDiv);
    tabsToPages.put(this.tab2MockInput, page2MockInput);
    tabsToPages.put(this.tab3MockHelpText, page3MockHelpText);
    this.tabs = new Tabs(this.tab1AuthzSubInput, this.tab2MockInput, this.tab3MockHelpText);
    this.tabs.addSelectedChangeListener(event -> {
        this.tabsToPages.values().forEach(page -> page.setVisible(false));
        Component selectedTab = this.tabs.getSelectedTab();
        Component selectedPage = this.tabsToPages.get(selectedTab);
        if (selectedTab.equals(tab2MockInput)) {
            mockDefinitionEditor.refresh();
        }
        if (selectedTab.equals(tab1AuthzSubInput)) {
            authzSubEditor.refresh();
        }
        selectedPage.setVisible(true);
    });
}
Also used : Tabs(com.vaadin.flow.component.tabs.Tabs) Component(com.vaadin.flow.component.Component) FlexComponent(com.vaadin.flow.component.orderedlayout.FlexComponent)

Example 14 with Tabs

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

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 15 with Tabs

use of com.vaadin.flow.component.tabs.Tabs in project ArchCNL by Mari-Wie.

the class SideBarWidget method addTabs.

public void addTabs(final QueryResultsComponent defaultQueryView, List<PredefinedQueryComponent> predefinedQueries, final CustomQueryView customQueryView, final FreeTextQueryComponent freeTextQueryView) {
    generalInformationTab = new SideBarTab("General Information", VaadinIcon.INFO_CIRCLE, defaultQueryView);
    customQueryTab = new SideBarTab("Custom Queries", VaadinIcon.AUTOMATION, customQueryView);
    freeTextQueryTab = new SideBarTab("Free Text Queries", VaadinIcon.TEXT_INPUT, freeTextQueryView);
    tabs = new Tabs(generalInformationTab);
    predefinedQueries.forEach(query -> addPredefinedQueryTab(query, query.getName()));
    tabs.add(customQueryTab);
    tabs.add(freeTextQueryTab);
    tabs.setOrientation(Tabs.Orientation.VERTICAL);
    tabs.setHeightFull();
    tabs.addSelectedChangeListener(event -> {
        if (event.getSelectedTab() instanceof SideBarTab) {
            final SideBarTab tab = (SideBarTab) event.getSelectedTab();
            fireEvent(new ShowComponentRequestedEvent(this, true, tab.getLinkedComponent()));
        }
    });
    add(tabs);
}
Also used : ShowComponentRequestedEvent(org.archcnl.ui.outputview.sidebar.events.ShowComponentRequestedEvent) 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