io.imunity.vaadin.endpoint.common.HtmlTooltipAttacher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unity-server-vaadin-endpoint-common Show documentation
Show all versions of unity-server-vaadin-endpoint-common Show documentation
Common Vaadin endpoint components
The newest version!
/*
* Copyright (c) 2021 Bixbit - Krzysztof Benedyczak. All rights reserved.
* See LICENCE.txt file for licensing information.
*/
package io.imunity.vaadin.endpoint.common;
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;
public class HtmlTooltipAttacher
{
public static Tooltip 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);
return tooltip;
}
public static Tooltip to(Component component, String tooltipContent)
{
return to(component, new Html("" + tooltipContent + ""));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy