Search in sources :

Example 1 with Tooltip

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;
}
Also used : RouterGridLink(io.imunity.furms.ui.components.RouterGridLink) Tooltip(com.vaadin.componentfactory.Tooltip) Icon(com.vaadin.flow.component.icon.Icon) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 2 with Tooltip

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;
}
Also used : VaadinExceptionHandler.handleExceptions(io.imunity.furms.ui.utils.VaadinExceptionHandler.handleExceptions) ResourceGetter.getCurrentResourceId(io.imunity.furms.ui.utils.ResourceGetter.getCurrentResourceId) AssignedPolicyRemovingException(io.imunity.furms.api.validation.exceptions.AssignedPolicyRemovingException) Component(com.vaadin.flow.component.Component) NotificationUtils.showErrorNotification(io.imunity.furms.ui.utils.NotificationUtils.showErrorNotification) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout) Label(com.vaadin.flow.component.html.Label) FurmsDialog(io.imunity.furms.ui.components.FurmsDialog) MenuButton(io.imunity.furms.ui.components.MenuButton) PageTitle(io.imunity.furms.ui.components.PageTitle) Route(com.vaadin.flow.router.Route) PLUS_CIRCLE(com.vaadin.flow.component.icon.VaadinIcon.PLUS_CIRCLE) DenseGrid(io.imunity.furms.ui.components.DenseGrid) ProjectAllocationService(io.imunity.furms.api.project_allocation.ProjectAllocationService) FurmsViewComponent(io.imunity.furms.ui.components.FurmsViewComponent) Map(java.util.Map) RouterLink(com.vaadin.flow.router.RouterLink) UI(com.vaadin.flow.component.UI) Comparator.comparing(java.util.Comparator.comparing) ProjectAdminMenu(io.imunity.furms.ui.views.project.ProjectAdminMenu) Grid(com.vaadin.flow.component.grid.Grid) TRASH(com.vaadin.flow.component.icon.VaadinIcon.TRASH) EDIT(com.vaadin.flow.component.icon.VaadinIcon.EDIT) GridActionMenu(io.imunity.furms.ui.components.GridActionMenu) GridActionsButtonLayout(io.imunity.furms.ui.components.GridActionsButtonLayout) AlarmId(io.imunity.furms.domain.alarms.AlarmId) Collectors(java.util.stream.Collectors) Checkbox(com.vaadin.flow.component.checkbox.Checkbox) Tooltip(com.vaadin.componentfactory.Tooltip) Button(com.vaadin.flow.component.button.Button) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) AlarmService(io.imunity.furms.api.alarms.AlarmService) ColumnTextAlign(com.vaadin.flow.component.grid.ColumnTextAlign) Dialog(com.vaadin.flow.component.dialog.Dialog) Collections(java.util.Collections) ViewHeaderLayout(io.imunity.furms.ui.components.ViewHeaderLayout) RouterLink(com.vaadin.flow.router.RouterLink) DenseGrid(io.imunity.furms.ui.components.DenseGrid) Tooltip(com.vaadin.componentfactory.Tooltip) Label(com.vaadin.flow.component.html.Label)

Example 3 with Tooltip

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;
}
Also used : Tooltip(com.vaadin.componentfactory.Tooltip)

Example 4 with Tooltip

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;
}
Also used : Tooltip(com.vaadin.componentfactory.Tooltip) Label(com.vaadin.flow.component.html.Label)

Example 5 with Tooltip

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);
}
Also used : Div(com.vaadin.flow.component.html.Div) Button(com.vaadin.flow.component.button.Button) Tooltip(com.vaadin.componentfactory.Tooltip) Label(com.vaadin.flow.component.html.Label)

Aggregations

Tooltip (com.vaadin.componentfactory.Tooltip)5 Label (com.vaadin.flow.component.html.Label)3 Button (com.vaadin.flow.component.button.Button)2 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)2 Component (com.vaadin.flow.component.Component)1 UI (com.vaadin.flow.component.UI)1 Checkbox (com.vaadin.flow.component.checkbox.Checkbox)1 Dialog (com.vaadin.flow.component.dialog.Dialog)1 ColumnTextAlign (com.vaadin.flow.component.grid.ColumnTextAlign)1 Grid (com.vaadin.flow.component.grid.Grid)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 Route (com.vaadin.flow.router.Route)1 RouterLink (com.vaadin.flow.router.RouterLink)1 AlarmService (io.imunity.furms.api.alarms.AlarmService)1 ProjectAllocationService (io.imunity.furms.api.project_allocation.ProjectAllocationService)1 AssignedPolicyRemovingException (io.imunity.furms.api.validation.exceptions.AssignedPolicyRemovingException)1