use of io.imunity.furms.ui.views.user_settings.projects.UserStatus.ACTIVE in project furms by unity-idm.
the class ProjectsView method createProjectGrid.
private Grid<ProjectGridModel> createProjectGrid() {
Grid<ProjectGridModel> grid = new DenseGrid<>(ProjectGridModel.class);
Grid.Column<ProjectGridModel> firstColumn = grid.addComponentColumn(project -> {
Component component = new Span(project.name);
if (project.status.equals(ACTIVE))
component = new RouterLink(project.name, ProjectView.class, project.id);
return component;
}).setHeader(getTranslation("view.user-settings.projects.grid.column.1")).setSortable(true).setComparator(comparing(project -> project.name)).setComparator(project -> project.name.toLowerCase());
grid.addColumn(project -> project.description).setHeader(getTranslation("view.user-settings.projects.grid.column.2")).setSortable(true);
grid.addColumn(project -> getTranslation(project.status.gridText)).setHeader(getTranslation("view.user-settings.projects.grid.column.3")).setTextAlign(ColumnTextAlign.END).setSortable(true);
grid.addComponentColumn(this::createLastColumnContent).setHeader(getTranslation("view.user-settings.projects.grid.column.4")).setTextAlign(ColumnTextAlign.END);
grid.sort(ImmutableList.of(new GridSortOrder<>(firstColumn, SortDirection.ASCENDING)));
return grid;
}
Aggregations