Search in sources :

Example 1 with END

use of com.vaadin.flow.component.grid.ColumnTextAlign.END in project furms by unity-idm.

the class SitesView method addTable.

private void addTable() {
    FlexLayout tableLayout = new FlexLayout();
    tableLayout.setWidthFull();
    List<SiteGridItem> sites = fetchSites();
    DenseGrid<SiteGridItem> siteGrid = new DenseGrid<>(SiteGridItem.class);
    siteGrid.setItems(sites);
    Binder<SiteGridItem> siteBinder = new Binder<>(SiteGridItem.class);
    Editor<SiteGridItem> siteEditor = siteGrid.getEditor();
    siteEditor.setBinder(siteBinder);
    siteEditor.setBuffered(true);
    siteEditor.addOpenListener(event -> onEditorOpen(event, siteBinder));
    siteEditor.addCloseListener(event -> onEditorClose(siteBinder));
    siteGrid.addComponentColumn(site -> new RouterLink(site.getName(), SitesAdminsView.class, site.getId())).setHeader(getTranslation("view.sites.main.grid.column.name")).setKey("name").setSortable(true).setComparator(SiteGridItem::getName).setEditorComponent(addEditForm(siteEditor));
    siteGrid.addComponentColumn(site -> createLastColumnContent(site, siteGrid)).setHeader(getTranslation("view.sites.main.grid.column.actions")).setKey("actions").setEditorComponent(addEditButtons(siteEditor)).setTextAlign(END);
    tableLayout.add(siteGrid);
    getContent().add(tableLayout);
}
Also used : DuplicatedNameValidationError(io.imunity.furms.api.validation.exceptions.DuplicatedNameValidationError) Component(com.vaadin.flow.component.Component) LoggerFactory(org.slf4j.LoggerFactory) MenuButton(io.imunity.furms.ui.components.MenuButton) PageTitle(io.imunity.furms.ui.components.PageTitle) Route(com.vaadin.flow.router.Route) FlexLayout(com.vaadin.flow.component.orderedlayout.FlexLayout) DenseGrid(io.imunity.furms.ui.components.DenseGrid) Key(com.vaadin.flow.component.Key) UI(com.vaadin.flow.component.UI) TextField(com.vaadin.flow.component.textfield.TextField) USERS(com.vaadin.flow.component.icon.VaadinIcon.USERS) MethodHandles(java.lang.invoke.MethodHandles) Editor(com.vaadin.flow.component.grid.editor.Editor) RouterGridLink(io.imunity.furms.ui.components.RouterGridLink) END(com.vaadin.flow.component.grid.ColumnTextAlign.END) Objects(java.util.Objects) List(java.util.List) Optional(java.util.Optional) NotificationUtils.showSuccessNotification(io.imunity.furms.ui.utils.NotificationUtils.showSuccessNotification) ViewHeaderLayout(io.imunity.furms.ui.components.ViewHeaderLayout) EditorOpenEvent(com.vaadin.flow.component.grid.editor.EditorOpenEvent) NotificationUtils.showErrorNotification(io.imunity.furms.ui.utils.NotificationUtils.showErrorNotification) SiteHasResourceCreditsRemoveValidationError(io.imunity.furms.api.validation.exceptions.SiteHasResourceCreditsRemoveValidationError) Binder(com.vaadin.flow.data.binder.Binder) Div(com.vaadin.flow.component.html.Div) FurmsDialog(io.imunity.furms.ui.components.FurmsDialog) PLUS_CIRCLE(com.vaadin.flow.component.icon.VaadinIcon.PLUS_CIRCLE) LUMO_TERTIARY(com.vaadin.flow.component.button.ButtonVariant.LUMO_TERTIARY) FurmsViewComponent(io.imunity.furms.ui.components.FurmsViewComponent) RouterLink(com.vaadin.flow.router.RouterLink) SiteService(io.imunity.furms.api.sites.SiteService) Icon(com.vaadin.flow.component.icon.Icon) EAGER(com.vaadin.flow.data.value.ValueChangeMode.EAGER) Logger(org.slf4j.Logger) Grid(com.vaadin.flow.component.grid.Grid) TRASH(com.vaadin.flow.component.icon.VaadinIcon.TRASH) FENIX_ADMIN_SITES(io.imunity.furms.domain.constant.RoutesConst.FENIX_ADMIN_SITES) EDIT(com.vaadin.flow.component.icon.VaadinIcon.EDIT) GridActionMenu(io.imunity.furms.ui.components.GridActionMenu) GridActionsButtonLayout(io.imunity.furms.ui.components.GridActionsButtonLayout) ClickEvent(com.vaadin.flow.component.ClickEvent) Site(io.imunity.furms.domain.sites.Site) FenixAdminMenu(io.imunity.furms.ui.views.fenix.menu.FenixAdminMenu) Collectors.toList(java.util.stream.Collectors.toList) Button(com.vaadin.flow.component.button.Button) SitesAdminsView(io.imunity.furms.ui.views.fenix.sites.admins.SitesAdminsView) Comparator(java.util.Comparator) SitesAddView(io.imunity.furms.ui.views.fenix.sites.add.SitesAddView) NAME_MAX_LENGTH(io.imunity.furms.ui.utils.FormSettings.NAME_MAX_LENGTH) Binder(com.vaadin.flow.data.binder.Binder) RouterLink(com.vaadin.flow.router.RouterLink) FlexLayout(com.vaadin.flow.component.orderedlayout.FlexLayout) DenseGrid(io.imunity.furms.ui.components.DenseGrid)

Aggregations

ClickEvent (com.vaadin.flow.component.ClickEvent)1 Component (com.vaadin.flow.component.Component)1 Key (com.vaadin.flow.component.Key)1 UI (com.vaadin.flow.component.UI)1 Button (com.vaadin.flow.component.button.Button)1 LUMO_TERTIARY (com.vaadin.flow.component.button.ButtonVariant.LUMO_TERTIARY)1 END (com.vaadin.flow.component.grid.ColumnTextAlign.END)1 Grid (com.vaadin.flow.component.grid.Grid)1 Editor (com.vaadin.flow.component.grid.editor.Editor)1 EditorOpenEvent (com.vaadin.flow.component.grid.editor.EditorOpenEvent)1 Div (com.vaadin.flow.component.html.Div)1 Icon (com.vaadin.flow.component.icon.Icon)1 EDIT (com.vaadin.flow.component.icon.VaadinIcon.EDIT)1 PLUS_CIRCLE (com.vaadin.flow.component.icon.VaadinIcon.PLUS_CIRCLE)1 TRASH (com.vaadin.flow.component.icon.VaadinIcon.TRASH)1 USERS (com.vaadin.flow.component.icon.VaadinIcon.USERS)1 FlexLayout (com.vaadin.flow.component.orderedlayout.FlexLayout)1 TextField (com.vaadin.flow.component.textfield.TextField)1 Binder (com.vaadin.flow.data.binder.Binder)1 EAGER (com.vaadin.flow.data.value.ValueChangeMode.EAGER)1