use of com.vaadin.flow.component.icon.Icon in project furms by unity-idm.
the class AuditLogView method createCommunityGrid.
private Grid<AuditLogGridModel> createCommunityGrid() {
Grid<AuditLogGridModel> grid = new DenseGrid<>(AuditLogGridModel.class);
Column<AuditLogGridModel> timestamp = grid.addComponentColumn(model -> {
if (model.data.isEmpty())
return new Div(new Label(model.timestamp.format(dateTimeFormatter)));
Icon icon = grid.isDetailsVisible(model) ? ANGLE_DOWN.create() : ANGLE_RIGHT.create();
return new Div(icon, new Label(model.timestamp.format(dateTimeFormatter)));
}).setHeader(getTranslation("view.fenix-admin.audit-log.grid.1")).setSortable(true).setComparator(model -> model.timestamp);
grid.addColumn(model -> model.originator).setHeader(getTranslation("view.fenix-admin.audit-log.grid.2")).setSortable(true).setComparator(model -> model.originator);
grid.addColumn(model -> getTranslation("view.fenix-admin.audit-log.operation." + model.operation)).setHeader(getTranslation("view.fenix-admin.audit-log.grid.3")).setSortable(true).setComparator(comparing(model -> model.operation));
grid.addColumn(model -> getTranslation("view.fenix-admin.audit-log.action." + model.action)).setHeader(getTranslation("view.fenix-admin.audit-log.grid.4")).setSortable(true).setComparator(comparing(model -> model.action));
grid.addColumn(model -> model.name).setHeader(getTranslation("view.fenix-admin.audit-log.grid.5")).setSortable(true).setComparator(comparing(model -> model.name));
grid.addColumn(model -> model.id).setHeader(getTranslation("view.fenix-admin.audit-log.grid.6")).setSortable(true).setComparator(comparing(model -> model.id));
grid.sort(ImmutableList.of(new GridSortOrder<>(timestamp, SortDirection.DESCENDING)));
grid.setItemDetailsRenderer(new ComponentRenderer<>(c -> AuditLogDetailsComponentFactory.create(c.data)));
grid.setSelectionMode(Grid.SelectionMode.NONE);
return grid;
}
use of com.vaadin.flow.component.icon.Icon in project furms by unity-idm.
the class CommunityAllocationComponent method createCommunityGrid.
private Grid<CommunityAllocationGridModel> createCommunityGrid() {
Grid<CommunityAllocationGridModel> grid = new DenseGrid<>(CommunityAllocationGridModel.class);
grid.addComponentColumn(model -> {
Icon icon = grid.isDetailsVisible(model) ? ANGLE_DOWN.create() : ANGLE_RIGHT.create();
return new Div(icon, new Text(model.siteName));
}).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.1")).setSortable(true);
grid.addComponentColumn(model -> new RouterLink(model.name, CommunityAllocationFormView.class, model.id)).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.2")).setSortable(true).setComparator(model -> model.name.toLowerCase());
grid.addColumn(model -> model.resourceCreditName).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.3")).setSortable(true);
grid.addColumn(model -> model.resourceTypeName).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.4")).setSortable(true);
grid.addColumn(model -> model.amountWithUnit).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.5")).setSortable(true).setComparator(comparing(model -> model.amountWithUnit.amount));
grid.addColumn(model -> model.distributedWithUnit).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.6")).setSortable(true).setComparator(comparing(model -> model.distributedWithUnit.amount));
grid.addColumn(model -> model.remainingWithUnit).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.7")).setSortable(true).setComparator(comparing(model -> model.remainingWithUnit.amount));
grid.addComponentColumn(model -> new ResourceProgressBar(model.amountWithUnit.amount, model.consumed, 0)).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.8")).setComparator(comparing(model -> model.consumed));
grid.addComponentColumn(this::createLastColumnContent).setHeader(getTranslation("view.fenix-admin.resource-credits-allocation.grid.column.9")).setTextAlign(ColumnTextAlign.END);
grid.setItemDetailsRenderer(new ComponentRenderer<>(model -> AllocationDetailsComponentFactory.create(model.creationTime, model.validFrom, model.validTo)));
return grid;
}
use of com.vaadin.flow.component.icon.Icon in project furms by unity-idm.
the class FurmsAppLayoutComponentsHolder method createRightNavbarSite.
private HorizontalLayout createRightNavbarSite(Component notificationBar, FurmsRolePicker furmsRolePicker) {
final Icon logout = LogoutIconFactory.create();
final HorizontalLayout rightNavbarSite = new HorizontalLayout();
rightNavbarSite.setAlignItems(FlexComponent.Alignment.CENTER);
rightNavbarSite.setJustifyContentMode(FlexComponent.JustifyContentMode.END);
rightNavbarSite.setSizeFull();
final Text navbarTitle = new Text(getTranslation("navbar.text"));
rightNavbarSite.add(navbarTitle, furmsRolePicker, notificationBar, logout);
return rightNavbarSite;
}
use of com.vaadin.flow.component.icon.Icon in project furms by unity-idm.
the class LogoutIconFactory method create.
public static Icon create() {
Icon logout = new Icon(VaadinIcon.SIGN_OUT);
logout.getStyle().set("cursor", "pointer");
logout.addClickListener(event -> UI.getCurrent().getPage().setLocation(LOGOUT_TRIGGER_URL));
return logout;
}
use of com.vaadin.flow.component.icon.Icon in project alibaba-rsocket-broker by alibaba.
the class MainLayout method serviceTesting.
private Tab serviceTesting() {
final Span label = new Span("Service Testing");
final Icon icon = TOOLS.create();
final Tab tab = new Tab(new HorizontalLayout(icon, label));
tab2Workspace.put(tab, new ServiceTestingView(this.handlerRegistry, this.serviceRoutingSelector));
return tab;
}
Aggregations