use of com.vaadin.componentfactory.Tooltip in project furms by unity-idm.
the class ProjectsView method createNameComponent.
private HorizontalLayout createNameComponent(ProjectViewGridModel projectViewModel) {
HorizontalLayout nameComponent = new HorizontalLayout();
if (projectViewModel.expired) {
final Icon warningIcon = TIME_BACKWARD.create();
final Tooltip warningTooltip = new Tooltip(warningIcon, TooltipPosition.BOTTOM, TooltipAlignment.CENTER);
warningTooltip.add(getTranslation("view.community-admin.projects.grid.column.1.expired.project.tooltip"));
getContent().add(warningTooltip);
nameComponent.add(warningIcon);
}
nameComponent.add(new RouterGridLink(projectViewModel.name, projectViewModel.id, ProjectView.class, PARAM_NAME, ADMINISTRATORS_PARAM));
return nameComponent;
}
use of com.vaadin.componentfactory.Tooltip in project furms by unity-idm.
the class AlarmsView method createAlarmGrid.
private Grid<AlarmGridModel> createAlarmGrid() {
Grid<AlarmGridModel> grid = new DenseGrid<>(AlarmGridModel.class);
grid.addComponentColumn(model -> new RouterLink(model.name, AlarmFormView.class, model.id.id.toString())).setHeader(getTranslation("view.project-admin.alarms.page.grid.1")).setSortable(true).setComparator(x -> x.name.toLowerCase());
grid.addColumn(model -> model.allocationName).setHeader(getTranslation("view.project-admin.alarms.page.grid.2")).setSortable(true);
grid.addColumn(model -> model.threshold + "%").setHeader(getTranslation("view.project-admin.alarms.page.grid.3")).setSortable(true);
grid.addComponentColumn(model -> new DisableCheckbox(model.allUsers)).setHeader(getTranslation("view.project-admin.alarms.page.grid.4")).setSortable(true).setComparator(model -> model.allUsers);
grid.addComponentColumn(model -> {
Label label = new Label(model.users.stream().limit(3).collect(Collectors.joining()) + (model.users.size() > 3 ? "..." : ""));
Tooltip tooltip = new Tooltip();
tooltip.add(String.join(", ", model.users));
tooltip.attachToComponent(label);
getContent().add(tooltip);
return label;
}).setHeader(getTranslation("view.project-admin.alarms.page.grid.5")).setSortable(true).setComparator(model -> model.users.toString());
grid.addComponentColumn(this::createLastColumnContent).setHeader(getTranslation("view.project-admin.alarms.page.grid.6")).setTextAlign(ColumnTextAlign.END);
grid.setClassNameGenerator(model -> model.fired ? "light-red-row" : "usual-row");
return grid;
}
use of com.vaadin.componentfactory.Tooltip in project furms by unity-idm.
the class ProjectsView method addApplyTooltip.
private MenuButton addApplyTooltip(MenuButton menuButton) {
Tooltip tooltip = new Tooltip();
tooltip.add(getTranslation("view.user-settings.projects.apply"));
tooltip.attachToComponent(menuButton);
getContent().add(tooltip);
return menuButton;
}
use of com.vaadin.componentfactory.Tooltip in project furms by unity-idm.
the class PolicyDocumentsView method getTooltipName.
private Label getTooltipName(PolicyDocumentExtended policyDocument) {
Tooltip tooltip = new Tooltip();
tooltip.add(policyDocument.name);
Label label = new Label(policyDocument.name);
tooltip.attachToComponent(label);
getContent().add(tooltip);
return label;
}
use of com.vaadin.componentfactory.Tooltip in project furms by unity-idm.
the class SitesView method showStatus.
private Div showStatus(UserSitesGridModel item) {
final Label label = new Label(getTranslation(format("view.user-settings.sites.grid.status.%s", item.getStatus().name())));
if (item.getStatus().isErrorStatus()) {
final Button button = new Button(WARNING.create());
button.addThemeVariants(LUMO_TERTIARY);
final Tooltip tooltip = new Tooltip(button, TooltipPosition.BOTTOM, TooltipAlignment.RIGHT);
tooltip.add(item.getErrorMessage());
tooltip.setThemeName("Light");
getContent().add(tooltip);
return new Div(label, button);
}
return new Div(label);
}
Aggregations