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