use of com.vaadin.flow.component.html.H2 in project isis-lab by apache-isis-committers.
the class _SideMenuLayout method createDrawerContent.
Component createDrawerContent(final Iterable<MenuItemInfo> menuItems) {
H2 appName = new H2("isis-lab-experiments-layout-sidemenu");
appName.addClassNames("flex", "items-center", "h-xl", "m-0", "px-m", "text-m");
com.vaadin.flow.component.html.Section section = new com.vaadin.flow.component.html.Section(appName, createNavigation(menuItems), createFooter());
section.addClassNames("flex", "flex-col", "items-stretch", "max-h-full", "min-h-full");
return section;
}
use of com.vaadin.flow.component.html.H2 in project docs by vaadin.
the class DialogDraggable method createHeaderLayout.
private static H2 createHeaderLayout() {
// tag::snippet2[]
H2 headline = new H2("Add note");
headline.addClassName("draggable");
// end::snippet2[]
headline.getStyle().set("margin", "0").set("font-size", "1.5em").set("font-weight", "bold").set("cursor", "move").set("padding", "var(--lumo-space-m) 0").set("flex", "1");
return headline;
}
use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.
the class MemberValidationView method beforeEnter.
@Override
public void beforeEnter(@NotNull final BeforeEnterEvent event) {
Paragraph message;
try {
final var params = event.getLocation().getQueryParameters().getParameters();
final var email = params.get("email").get(0);
final var code = params.get("code").get(0);
securityService.activate(email, code);
message = new Paragraph("Your email address was successfully validated.");
message.addClassName("successful");
} catch (final BadCredentialsException e) {
message = new Paragraph("The link was invalid. Please check your email for a working validation link.");
message.addClassName("failed");
}
setContent(new Div(new H2("Validation"), message, new RouterLink("Back to home page", HomeView.class)));
}
use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.
the class MembersView method createFeedbackForm.
private Component createFeedbackForm() {
final var div = new Div();
div.addClassName("feedback-form");
div.add(new H2("Your Feedback, suggestion, idea..."));
final var firstName = new TextField("First name");
firstName.setMinLength(1);
firstName.setMaxLength(2_000);
final var lastName = new TextField("Last name");
lastName.setMinLength(1);
lastName.setMaxLength(2_000);
final var email = new EmailField("Email");
email.setMinLength(1);
email.setMaxLength(2_000);
final var feedback = new TextArea("Feedback");
feedback.setMinLength(1);
feedback.setMaxLength(2_000);
final var submit = new Button("Send");
submit.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
submit.setEnabled(false);
submit.setDisableOnClick(true);
List.of(firstName, lastName, email, feedback).forEach(field -> {
field.setRequiredIndicatorVisible(true);
field.setValueChangeMode(ValueChangeMode.EAGER);
field.addValueChangeListener(valueChangeEvent -> submit.setEnabled(!firstName.getValue().isBlank() && !lastName.getValue().isBlank() && !email.isInvalid() && !feedback.getValue().isBlank()));
});
final var form = new FormLayout();
form.setResponsiveSteps(new FormLayout.ResponsiveStep("0", 1));
form.add(firstName, lastName, email, feedback, submit);
div.add(form);
submit.addClickListener(buttonClickEvent -> {
databaseService.receiveFeedback(firstName.getValue(), lastName.getValue(), email.getValue(), feedback.getValue());
div.replace(form, new Paragraph("We have received your feedback, thank you very much!"));
});
firstName.focus();
return div;
}
use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.
the class NewsView method toNewsItem.
private static Component toNewsItem(@NotNull final NewsEntity newsEntity) {
final var newsItem = new Article();
newsItem.addClassName("news-item");
final var createdDate = new Paragraph(formatDate(newsEntity.created().toLocalDate()));
createdDate.addClassName("created-date");
newsItem.add(createdDate);
newsItem.add(new H2(newsEntity.title()));
if (!newsEntity.subtitle().isBlank()) {
newsItem.add(new H3(newsEntity.subtitle()));
}
final var teaser = new Paragraph(new Html("<div>%s</div>".formatted(newsEntity.teaser())));
teaser.addClassName("teaser");
newsItem.add(teaser);
final var message = new Paragraph(new Html("<div>%s</div>".formatted(newsEntity.message())));
message.addClassName("message");
newsItem.add(message);
return newsItem;
}
Aggregations