use of com.vaadin.flow.component.icon.Icon in project ArchCNL by Mari-Wie.
the class MappingEditorView method createTitleBar.
private HorizontalLayout createTitleBar(String mappingType) {
final Label title = new Label("Create or edit a " + mappingType);
title.setClassName("card-title-box--title");
final Button closeButton = new Button(new Icon(VaadinIcon.CLOSE), click -> fireEvent(new MappingCloseButtonClicked(this, true)));
final HorizontalLayout titleBar = new HorizontalLayout(title, closeButton);
titleBar.setWidthFull();
title.setWidthFull();
titleBar.setDefaultVerticalComponentAlignment(Alignment.CENTER);
return titleBar;
}
use of com.vaadin.flow.component.icon.Icon in project komunumo-server by komunumo.
the class RegistrationsDialog method configureGrid.
private void configureGrid() {
grid.setSelectionMode(Grid.SelectionMode.NONE);
grid.addThemeVariants(GridVariant.LUMO_NO_BORDER, GridVariant.LUMO_ROW_STRIPES);
grid.addClassName("registration-dialog");
grid.addColumn(new ComponentRenderer<>(registrationListEntity -> new Anchor("mailto:" + registrationListEntity.email(), registrationListEntity.fullName()))).setHeader("Attendee").setAutoWidth(true).setFlexGrow(0);
grid.addColumn(new LocalDateTimeRenderer<>(RegistrationListEntity::date, FormatterUtil.dateTimeFormatter())).setHeader("Registration date").setAutoWidth(true).setFlexGrow(0);
grid.addColumn(RegistrationListEntity::source).setHeader("Source").setAutoWidth(true).setFlexGrow(0);
if (event.getDate().isBefore(LocalDateTime.now())) {
grid.addColumn(new ComponentRenderer<>(registrationListEntity -> new Icon(registrationListEntity.noShow() ? VaadinIcon.CLOSE_CIRCLE_O : VaadinIcon.CHECK_CIRCLE_O))).setHeader("No show").setTextAlign(ColumnTextAlign.CENTER).setAutoWidth(true).setFlexGrow(0);
}
grid.addColumn(new ComponentRenderer<>(registrationListEntity -> {
final var deregisterButton = new EnhancedButton(new Icon(VaadinIcon.TRASH), clickEvent -> deregister(registrationListEntity));
deregisterButton.setTitle("Deregister this attendee");
deregisterButton.setEnabled(event.getDate() != null && event.getDate().isAfter(LocalDateTime.now()));
return deregisterButton;
})).setHeader("Actions").setAutoWidth(true).setFlexGrow(0);
grid.setWidthFull();
grid.setHeightFull();
}
use of com.vaadin.flow.component.icon.Icon in project komunumo-server by komunumo.
the class FaqView method configureGrid.
private void configureGrid() {
grid.setSelectionMode(Grid.SelectionMode.NONE);
grid.addThemeVariants(GridVariant.LUMO_NO_BORDER, GridVariant.LUMO_ROW_STRIPES);
grid.addColumn(FaqRecord::getQuestion).setHeader("Question").setAutoWidth(true).setFlexGrow(0);
grid.addColumn(new ComponentRenderer<>(faqRecord -> {
final var editButton = new EnhancedButton(new Icon(VaadinIcon.EDIT), clickEvent -> showEditDialog(faqRecord));
editButton.setTitle("Edit this entry");
final var deleteButton = new EnhancedButton(new Icon(VaadinIcon.TRASH), clickEvent -> deleteEntry(faqRecord));
deleteButton.setTitle("Delete this entry");
return new HorizontalLayout(editButton, deleteButton);
})).setHeader("Actions").setAutoWidth(true).setFlexGrow(0);
grid.setHeightFull();
}
use of com.vaadin.flow.component.icon.Icon in project komunumo-server by komunumo.
the class SpeakersView method configureGrid.
private void configureGrid() {
grid.setSelectionMode(Grid.SelectionMode.NONE);
grid.addThemeVariants(GridVariant.LUMO_NO_BORDER, GridVariant.LUMO_ROW_STRIPES);
grid.addColumn(LitRenderer.<SpeakerListEntity>of("<span style=\"font-weight: bold;\">${item.fullName}</span><br/>" + "<a href=\"${item.website}\" target=\"_blank\" title=\"${item.title}\">${item.company}</a>").withProperty("fullName", SpeakerListEntity::fullName).withProperty("company", speakerListEntity -> FormatterUtil.formatString(speakerListEntity.company(), 50)).withProperty("title", SpeakerListEntity::company).withProperty("website", SpeakerListEntity::website)).setHeader("Name & Company").setAutoWidth(true).setFlexGrow(1);
grid.addColumn(LitRenderer.<SpeakerListEntity>of("<a href=\"mailto:${item.email}\" target=\"_blank\">${item.email}</a>").withProperty("email", SpeakerListEntity::email)).setHeader("Email").setAutoWidth(true).setFlexGrow(0).setKey("email");
grid.addColumn(LitRenderer.<SpeakerListEntity>of("<a href=\"https://twitter.com/${item.twitter}\" target=\"_blank\" title=\"${item.twitter}\">${item.twitter}</a>").withProperty("twitter", SpeakerListEntity::twitter)).setHeader("Twitter").setAutoWidth(true).setFlexGrow(0).setKey("twitter");
final var eventCountRenderer = LitRenderer.<SpeakerListEntity>of("<a href=\"/admin/events?filter=${item.filterValue}\">${item.eventCount}</a>").withProperty("eventCount", SpeakerListEntity::eventCount).withProperty("filterValue", speakerListEntity -> URLEncoder.encode(speakerListEntity.fullName(), UTF_8));
grid.addColumn(eventCountRenderer).setHeader("Events").setAutoWidth(true).setTextAlign(ColumnTextAlign.CENTER).setFlexGrow(0);
grid.addColumn(new ComponentRenderer<>(speakerListEntity -> {
final var editButton = new EnhancedButton(new Icon(VaadinIcon.EDIT), clickEvent -> showSpeakerDialog(speakerListEntity));
editButton.setTitle("Edit this speaker");
final var deleteButton = new EnhancedButton(new Icon(VaadinIcon.TRASH), clickEvent -> deleteSpeaker(speakerListEntity));
deleteButton.setTitle("Delete this speaker");
deleteButton.setEnabled(speakerListEntity.eventCount() == 0);
return new HorizontalLayout(editButton, deleteButton);
})).setHeader("Actions").setAutoWidth(true).setFlexGrow(0);
grid.setHeightFull();
}
use of com.vaadin.flow.component.icon.Icon in project komunumo-server by komunumo.
the class SponsorsView method configureGrid.
private void configureGrid() {
grid.setSelectionMode(Grid.SelectionMode.NONE);
grid.addThemeVariants(GridVariant.LUMO_NO_BORDER, GridVariant.LUMO_ROW_STRIPES);
grid.addColumn(TemplateRenderer.<SponsorEntity>of("<a style=\"font-weight: bold;\" href=\"[[item.website]]\" target=\"_blank\">[[item.name]]</a>").withProperty("name", SponsorEntity::name).withProperty("website", SponsorEntity::website)).setHeader("Name").setAutoWidth(true).setFlexGrow(1);
grid.addColumn(TemplateRenderer.<SponsorEntity>of("<img style=\"max-width: 100%;\" src=\"[[item.logo]]\" /></span>").withProperty("logo", SponsorEntity::logo)).setHeader("Logo").setWidth("96px").setFlexGrow(0);
grid.addColumn(SponsorEntity::level).setHeader("Level").setAutoWidth(true);
grid.addColumn(sponsorEntity -> formatDate(sponsorEntity.validFrom())).setHeader("Valid from").setAutoWidth(true).setFlexGrow(0).setKey("validFrom");
grid.addColumn(sponsorEntity -> formatDate(sponsorEntity.validTo())).setHeader("Valid to").setAutoWidth(true).setFlexGrow(0).setKey("validTo");
grid.addColumn(new ComponentRenderer<>(sponsorEntity -> {
final var editButton = new EnhancedButton(new Icon(VaadinIcon.EDIT), clickEvent -> showSponsorDialog(sponsorEntity));
editButton.setTitle("Edit this sponsor");
final var deleteButton = new EnhancedButton(new Icon(VaadinIcon.TRASH), clickEvent -> deleteSponsor(sponsorEntity));
deleteButton.setTitle("Delete this sponsor");
return new HorizontalLayout(editButton, deleteButton);
})).setHeader("Actions").setAutoWidth(true).setFlexGrow(0);
grid.setHeightFull();
}
Aggregations