Search in sources :

Example 1 with H3

use of com.vaadin.flow.component.html.H3 in project flow by vaadin.

the class DemoView method addCard.

private Card addCard(String tabName, String tabUrl, String heading, Component... components) {
    Div tab = tabComponents.computeIfAbsent(tabUrl, url -> {
        navBar.addLink(tabName, getTabUrl(tabUrl));
        return new Div();
    });
    if (heading != null && !heading.isEmpty()) {
        tab.add(new H3(heading));
    }
    Card card = new Card();
    if (components != null && components.length > 0) {
        card.add(components);
    }
    List<SourceCodeExample> list = sourceCodeExamples.get(heading);
    if (list != null) {
        list.stream().map(this::createSourceContent).forEach(card::add);
    }
    tab.add(card);
    return card;
}
Also used : Div(com.vaadin.flow.component.html.Div) H3(com.vaadin.flow.component.html.H3)

Aggregations

Div (com.vaadin.flow.component.html.Div)1 H3 (com.vaadin.flow.component.html.H3)1