io.imunity.console.components.HtmlTooltipAttacher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unity-server-console Show documentation
Show all versions of unity-server-console Show documentation
Task oriented web based administration UI
/*
* Copyright (c) 2021 Bixbit - Krzysztof Benedyczak. All rights reserved.
* See LICENCE.txt file for licensing information.
*/
package io.imunity.console.components;
import com.vaadin.componentfactory.Tooltip;
import com.vaadin.componentfactory.TooltipPosition;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.Html;
import com.vaadin.flow.component.UI;
class HtmlTooltipAttacher
{
static void to(Component component, Html tooltipContent)
{
Tooltip tooltip = new Tooltip();
tooltip.attachToComponent(component);
tooltip.setPosition(TooltipPosition.BOTTOM);
tooltip.add(tooltipContent);
tooltip.setThemeName("light");
UI.getCurrent().add(tooltip);
}
}