Search in sources :

Example 36 with H2

use of com.vaadin.flow.component.html.H2 in project karnak by OsiriX-Foundation.

the class PseudonymMappingView method addComponentsView.

/**
 * Add components in the view
 */
private void addComponentsView() {
    setSizeFull();
    // Layout
    mappingLayout = new VerticalLayout();
    VerticalLayout inputLayout = new VerticalLayout();
    // Titles
    mappingLayout.add(new H2("Pseudonym Mapping"));
    // Input
    inputLayout.add(mappingInputComponent);
    inputLayout.getElement().getStyle().set("margin-left", "22%");
    mappingLayout.add(inputLayout);
    // Layout
    add(mappingLayout);
}
Also used : VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2)

Example 37 with H2

use of com.vaadin.flow.component.html.H2 in project layout-examples by vaadin.

the class MarketingView method createCard.

private Component createCard(String cardHeader, String cardContent) {
    VerticalLayout layout = new VerticalLayout();
    layout.setWidth("30%");
    layout.setMinWidth("250px");
    H2 header = new H2(cardHeader);
    Div content = new Div();
    content.setText(cardContent);
    Button button = new Button("View details", new Icon(VaadinIcon.ANGLE_DOUBLE_RIGHT));
    button.addThemeVariants(ButtonVariant.LUMO_SMALL);
    layout.getElement().getStyle().set("flex-grow", "1");
    layout.add(header, content, button);
    return layout;
}
Also used : Div(com.vaadin.flow.component.html.Div) Button(com.vaadin.flow.component.button.Button) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon)

Example 38 with H2

use of com.vaadin.flow.component.html.H2 in project furms by unity-idm.

the class DefaultErrorViewsGenerator method generate.

static Element generate(String title, String message) {
    VerticalLayout error = new VerticalLayout();
    Button backButton = new Button(getTranslation("view.error-page.error.back-button"), ARROW_LEFT.create(), e -> UI.getCurrent().navigate(LandingPageView.class));
    backButton.addThemeVariants(LUMO_TERTIARY);
    error.add(backButton);
    VerticalLayout messageLayout = new VerticalLayout(new H2(title), new Text(message));
    messageLayout.setAlignItems(FlexComponent.Alignment.CENTER);
    messageLayout.setDefaultHorizontalComponentAlignment(FlexComponent.Alignment.CENTER);
    messageLayout.setSizeFull();
    error.add(messageLayout);
    return error.getElement();
}
Also used : LandingPageView(io.imunity.furms.ui.views.landing.LandingPageView) Button(com.vaadin.flow.component.button.Button) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2) Text(com.vaadin.flow.component.Text)

Example 39 with H2

use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.

the class ServerSideEvents method initDemo.

@Override
public void initDemo() {
    historyLayout = new OrderedList();
    historyLayout.setId("history");
    chart = new Chart();
    chart.setId("chart");
    final Configuration configuration = chart.getConfiguration();
    configuration.getChart().setWidth(500);
    configuration.getChart().setType(ChartType.SCATTER);
    configuration.getTitle().setText("Test server side events.");
    configuration.getSubTitle().setText("When an event occurs, the details are shown below the chart");
    configuration.setExporting(true);
    configuration.getChart().setAnimation(false);
    configuration.getChart().setZoomType(Dimension.XY);
    configuration.getAccessibility().setEnabled(false);
    XAxis xAxis = configuration.getxAxis();
    xAxis.setMinPadding(0.2);
    xAxis.setMaxPadding(0.2);
    YAxis yAxis = configuration.getyAxis();
    yAxis.setTitle(new AxisTitle("Value"));
    PlotLine plotline = new PlotLine();
    plotline.setValue(0);
    plotline.setWidth(1);
    plotline.setColor(new SolidColor("#808080"));
    yAxis.setPlotLines(plotline);
    yAxis.setMinPadding(0.2);
    yAxis.setMaxPadding(0.2);
    YAxis yAxis1 = new YAxis();
    yAxis1.setTitle("Another axis");
    yAxis1.setOpposite(true);
    configuration.addyAxis(yAxis1);
    PlotOptionsSeries opt = new PlotOptionsSeries();
    opt.setShowCheckbox(true);
    opt.setAllowPointSelect(true);
    configuration.setPlotOptions(opt);
    configuration.setTooltip(new Tooltip(false));
    final DataSeries series1 = createDataSeries(0);
    final DataSeries series2 = createDataSeries(20);
    DataSeries series3 = createDataSeries(100);
    series3.get(0).setY(105);
    series3.get(3).setY(95);
    series3.setName("Another axis");
    series3.setyAxis(1);
    DataSeriesItem firstDataPoint = series1.get(0);
    firstDataPoint.setSelected(true);
    configuration.setSeries(series1, series2, series3);
    chart.addChartClickListener(this::logEvent);
    chart.addPointClickListener(this::logEvent);
    chart.addCheckBoxClickListener(this::logEvent);
    chart.addSeriesLegendItemClickListener(this::logEvent);
    chart.addSeriesHideListener(this::logEvent);
    chart.addSeriesShowListener(this::logEvent);
    chart.addPointSelectListener(this::logEvent);
    chart.addPointUnselectListener(this::logEvent);
    chart.addYAxesExtremesSetListener(this::logEvent);
    chart.drawChart();
    chart.setVisibilityTogglingDisabled(false);
    VerticalLayout layout = new VerticalLayout();
    layout.setId("master");
    layout.add(createControls());
    layout.add(new H2("Event History"), historyLayout);
    add(chart, layout);
}
Also used : Configuration(com.vaadin.flow.component.charts.model.Configuration) Tooltip(com.vaadin.flow.component.charts.model.Tooltip) SolidColor(com.vaadin.flow.component.charts.model.style.SolidColor) H2(com.vaadin.flow.component.html.H2) XAxis(com.vaadin.flow.component.charts.model.XAxis) OrderedList(com.vaadin.flow.component.html.OrderedList) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) PlotLine(com.vaadin.flow.component.charts.model.PlotLine) DataSeries(com.vaadin.flow.component.charts.model.DataSeries) AxisTitle(com.vaadin.flow.component.charts.model.AxisTitle) Chart(com.vaadin.flow.component.charts.Chart) PlotOptionsSeries(com.vaadin.flow.component.charts.model.PlotOptionsSeries) DataSeriesItem(com.vaadin.flow.component.charts.model.DataSeriesItem) YAxis(com.vaadin.flow.component.charts.model.YAxis)

Example 40 with H2

use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.

the class ComboBoxView method addCard.

private void addCard(String title, String description, Component... components) {
    if (description != null) {
        title = title + ": " + description;
    }
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.add(new H2(title));
    layout.add(components);
    add(layout);
}
Also used : VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2)

Aggregations

H2 (com.vaadin.flow.component.html.H2)68 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)29 Div (com.vaadin.flow.component.html.Div)25 Grid (com.vaadin.flow.component.grid.Grid)11 ComboBox (com.vaadin.flow.component.combobox.ComboBox)10 Button (com.vaadin.flow.component.button.Button)8 Paragraph (com.vaadin.flow.component.html.Paragraph)7 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)7 Route (com.vaadin.flow.router.Route)6 List (java.util.List)6 IntStream (java.util.stream.IntStream)6 NativeButton (com.vaadin.flow.component.html.NativeButton)5 ArrayList (java.util.ArrayList)5 Html (com.vaadin.flow.component.Html)4 TextField (com.vaadin.flow.component.textfield.TextField)4 Faker (com.github.javafaker.Faker)3 ItemFilter (com.vaadin.flow.component.combobox.ComboBox.ItemFilter)3 Label (com.vaadin.flow.component.html.Label)3 CallbackDataProvider (com.vaadin.flow.data.provider.CallbackDataProvider)3 ComponentRenderer (com.vaadin.flow.data.renderer.ComponentRenderer)3