Search in sources :

Example 1 with ShowComponentRequestedEvent

use of org.archcnl.ui.outputview.sidebar.events.ShowComponentRequestedEvent 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 2 with ShowComponentRequestedEvent

use of org.archcnl.ui.outputview.sidebar.events.ShowComponentRequestedEvent 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)2 ShowComponentRequestedEvent (org.archcnl.ui.outputview.sidebar.events.ShowComponentRequestedEvent)2